https://llvm.org/bugs/show_bug.cgi?id=23527

            Bug ID: 23527
           Summary: [ScalarEvolution] createNodeForGEP over-optimistic
                    about preserving nsw
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

[Copied from llvmdev@]

I was looking at ScalarEvolution::createNodeForGEP
(http://llvm.org/docs/doxygen/html/ScalarEvolution_8cpp_source.html#l03702),
and noticed that the code that applies nsw flags to the resultant SCEV is
inconsistent with the comment. 

While the comment says

03709   // Don't blindly transfer the inbounds flag from the GEP instruction to
the
03710   // Add expression, because the Instruction may be guarded by control
flow
03711   // and the no-overflow bits may not be valid for the expression in any
03712   // context.
03713   SCEV::NoWrapFlags Wrap = GEP->isInBounds() ? SCEV::FlagNSW :
SCEV::FlagAnyWrap;

the code still transfers nsw to LocalOffset and BaseS+TotalOffset.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to