[LLVMbugs] [Bug 7171] New: target datalayout needed to perform optimization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 19 05:21:05 PDT 2010


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

           Summary: target datalayout needed to perform optimization
           Product: libraries
           Version: 2.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jos.decoster at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Hi,

In the example below:

; ModuleID = 'test.c'
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-n8:16:32:64"

define i32 @test4(i32 %x, i32 %y) readnone {
block0:
  %stack = alloca [100 x i32], align 4
  %p1 = getelementptr inbounds [100 x i32]* %stack, i32 0, i32 0
  store i32 %x, i32* %p1
  %p2 = getelementptr inbounds [100 x i32]* %stack, i32 0, i32 1
  store i32 %y, i32* %p2
  %p3 = getelementptr inbounds [100 x i32]* %stack, i32 0, i32 0
  %v1 = load i32* %p3
  %p4 = getelementptr inbounds [100 x i32]* %stack, i32 0, i32 1
  %v2 = load i32* %p4
  %result = add i32 %v1, %v2
  ret i32 %result
}

the 'target datalayout' is required to perform optimization to:

define i32 @test4(i32 %x, i32 %y) nounwind readnone {
block0:
  %result = add i32 %x, %y                        ; <i32> [#uses=1]
  ret i32 %result
}


Why is the datalayout important in this example?

Kind regards,

Jos.

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