[LLVMbugs] [Bug 2864] New: instcombine removes live stores and calls

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Oct 6 13:47:38 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2864

           Summary: instcombine removes live stores and calls
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: miscompilation
          Severity: major
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: alenhar2 at uiuc.edu
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2061)
 --> (http://llvm.org/bugs/attachment.cgi?id=2061)
butpoint-tooptimize.bc

Instcombine removes stores and recursive calls from this function.

opt bugpoint-tooptimize.bc -instcombine -o foo.bc

--- bugpoint-tooptimize.ll      2008-10-06 15:41:47.000000000 -0500
+++ foo.ll      2008-10-06 15:41:51.000000000 -0500
@@ -1,4 +1,4 @@
-; ModuleID = 'bugpoint-tooptimize.bc'
+; ModuleID = 'foo.bc'
 target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
 target triple = "x86_64-unknown-linux-gnu"
        %PoolDescriptor = type [16 x i8*]
@@ -50,23 +50,14 @@
        br label %bb1

 bb1.ret.exitStub:              ; preds = %bb1
-       store %struct.tree_t* %1, %struct.tree_t** %.out
+       %0 = bitcast i8* %1 to %struct.tree_t*          ; <%struct.tree_t*>
[#uses=1]
+       store %struct.tree_t* %0, %struct.tree_t** %.out
        ret void

 bb1:           ; preds = %newFuncRoot
-       %0 = call i8* @poolalloc(%PoolDescriptor* %PDa, i32 24)         ; <i8*>
[#uses=1]
-       %1 = bitcast i8* %0 to %struct.tree_t*          ; <%struct.tree_t*>
[#uses=4]
-       %2 = sdiv i32 %proc, 2          ; <i32> [#uses=3]
-       %3 = add i32 %2, %lo            ; <i32> [#uses=1]
-       %4 = add i32 %level, -1         ; <i32> [#uses=2]
-       %5 = call %struct.tree_t* @TreeAlloc2(%PoolDescriptor* %PDa, i32 %4,
i32 %3, i32 %2)            ; <%struct.tree_t*> [#uses=1]
-       %6 = call %struct.tree_t* @TreeAlloc2(%PoolDescriptor* %PDa, i32 %4,
i32 %lo, i32 %2)           ; <%struct.tree_t*> [#uses=1]
-       %7 = getelementptr %struct.tree_t* %1, i64 0, i32 0             ;
<i32*> [#uses=1]
-       store i32 1, i32* %7, align 8
-       %8 = getelementptr %struct.tree_t* %1, i64 0, i32 1             ;
<%struct.tree_t**> [#uses=1]
-       store %struct.tree_t* %5, %struct.tree_t** %8, align 8
-       %9 = getelementptr %struct.tree_t* %1, i64 0, i32 2             ;
<%struct.tree_t**> [#uses=1]
-       store %struct.tree_t* %6, %struct.tree_t** %9, align 8
+       %1 = call i8* @poolalloc(%PoolDescriptor* %PDa, i32 24)         ; <i8*>
[#uses=2]
+       %2 = bitcast i8* %1 to i32*             ; <i32*> [#uses=1]
+       store i32 1, i32* %2, align 8
        br label %bb1.ret.exitStub
 }


-- 
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