[LLVMbugs] [Bug 5441] New: Load not simplified in spite of llvm.invariant.start/end

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 9 06:28:48 PST 2009


           Summary: Load not simplified in spite of llvm.invariant.start/end
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=3794)
 --> (http://llvm.org/bugs/attachment.cgi?id=3794)
testcase .ll

In the following testcase, there are a few places in which a value
is stored to an alloca, which is then immediately declared invariant,
for example:

  store i8* %adjusted, i8** %6, align 1
  %7 = bitcast i8** %6 to i8*                     ; <i8*> [#uses=2]
  %8 = call { }* @llvm.invariant.start(i64 24, i8* %7) ; <{ }*> [#uses=1]

Later the stored value is loaded out again:

  %17 = bitcast %"struct __builtin_trampoline"* %1 to i8** ; <i8**> [#uses=1]
  %adjusted4 = load i8** %17, align 1             ; <i8*> [#uses=1]

The load should be eliminated, and the stored value (%adjusted in this
case) used.  However the optimizers fail to perform this simplification.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list