Skip to content

Commit

Permalink
Remove obsolete comment in cmmOffset
Browse files Browse the repository at this point in the history
Summary:
as obviously, the code does _not_ adhere to the comment, and yet the
compiler does _not_ go into an infinite loop.

Test Plan: Run validate

Reviewers: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D719
  • Loading branch information
nomeata committed Mar 9, 2015
1 parent c439af5 commit d01844f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions compiler/cmm/CmmUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,6 @@ cmmOffsetExpr :: DynFlags -> CmmExpr -> CmmExpr -> CmmExpr
cmmOffsetExpr dflags e (CmmLit (CmmInt n _)) = cmmOffset dflags e (fromInteger n)
cmmOffsetExpr dflags e byte_off = CmmMachOp (MO_Add (cmmExprWidth dflags e)) [e, byte_off]

-- NB. Do *not* inspect the value of the offset in these smart constructors!!!
-- because the offset is sometimes involved in a loop in the code generator
-- (we don't know the real Hp offset until we've generated code for the entire
-- basic block, for example). So we cannot eliminate zero offsets at this
-- stage; they're eliminated later instead (either during printing or
-- a later optimisation step on Cmm).
--
cmmOffset :: DynFlags -> CmmExpr -> Int -> CmmExpr
cmmOffset _ e 0 = e
cmmOffset _ (CmmReg reg) byte_off = cmmRegOff reg byte_off
Expand Down

0 comments on commit d01844f

Please sign in to comment.