[llvm-bugs] [Bug 32829] New: SmallPtrSet usage in SROA could introduce non-determinism in Clang
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Thu Apr 27 11:10:12 PDT 2017
    
    
  
http://bugs.llvm.org/show_bug.cgi?id=32829
            Bug ID: 32829
           Summary: SmallPtrSet usage in SROA could introduce
                    non-determinism in Clang
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: gkistanova at gmail.com
                CC: llvm-bugs at lists.llvm.org
SROA uses a SmallPtrSet for holding speculated SelectInst items.
In lib/Transforms/Scalar/SROA.cpp
SmallPtrSet<SelectInst *, 8> SelectUsers;
The result depends on a particular order in which the items get iterated from
that set.
This works fine while that SmallPtrSet object remains small. However, if  it
grows, the addresses get changed, and the iteration order gets 
nondeterministic.
The issue could be exposed, for example, by nondeterministic
".sroa.speculated<changing-number>" names in IR.
The same might apply to SmallPtrSet<PHINode *, 8> PHIUsers; as well.
-- 
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/20170427/ec05b194/attachment.html>
    
    
More information about the llvm-bugs
mailing list