[llvm-bugs] [Bug 25469] New: Invariant load still in parameter list even if optimized away

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 9 18:40:54 PST 2015


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-dev at googlegroups.com
          Reporter: llvm at meinersbur.de
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151110/5765c34d/attachment.html>


More information about the llvm-bugs mailing list