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

            Bug ID: 25469
           Summary: Invariant load still in parameter list even if
                    optimized away
           Product: Projects
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Polly
          Assignee: polly-...@googlegroups.com
          Reporter: l...@meinersbur.de
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

In the test case there is a invariant load in while.body and therefore added in
into the scop's parameter list. The loop however, is never executed due to a
constant branch condition and therefor is optimized away in simplifyScop
including the invariant MemoryAccess. Because there is not more MemoryAccess,
hoistInvariantLoad() will never add it to InvariantEquivClasses.

CodeGeneration will still generate code for the (now unused) parameter,
including the load. Because there is no entry in InvariantEquivClasses, it will
use the original value from inside the scop, which causes a domination
verication fail.

I can think of 4 solutions:
- Never remove statements that have accesses before hoistInvariantLoad()
- Remove parameters again that are not used anywhere
- Do not expand SCEVs in CodeGen that uses unkowns from inside the scop
- Do not expand SCEVS in CodeGen that have no use

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to