[llvm-bugs] [Bug 26816] New: [ScalarEvolution] Iteration order over Set depends on pointer values

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Mar 2 10:39:15 PST 2016


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

            Bug ID: 26816
           Summary: [ScalarEvolution] Iteration order over Set depends on
                    pointer values
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
          Assignee: unassignedbugs at nondot.org
          Reporter: mattias.v.eriksson at ericsson.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I am seeing some non-deterministic behavior in the output files in some tests
that I am running.

I have been tracking the problem and I think it is caused by a new for loop in
ScalarEvolutionExpander. The iteration order over Set below will depend on
pointer values. I am not sure how to fix this.

Value *SCEVExpander::FindValueInExprValueMap(const SCEV *S,
                                             const Instruction *InsertPt) {
  SetVector<Value *> *Set = SE.getSCEVValues(S);
  // If the expansion is not in CanonicalMode, and the SCEV contains any
  // sub scAddRecExpr type SCEV, it is required to expand the SCEV literally.
  if (CanonicalMode || !SE.containsAddRecurrence(S)) {
    // If S is scConstant, it may be worse to reuse an existing Value.
    if (S->getSCEVType() != scConstant && Set) {
      // Choose a Value from the set which dominates the insertPt.
      // insertPt should be inside the Value's parent loop so as not to break
      // the LCSSA form.
      for (auto const &Ent : *Set) {

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160302/d0485766/attachment.html>


More information about the llvm-bugs mailing list