[LLVMbugs] [Bug 7357] New: simplify-libcalls produces declarations without a calling convention

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 11 09:14:11 PDT 2010


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

           Summary: simplify-libcalls produces declarations without a
                    calling convention
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


given
------------------------------------------------------------------
; ModuleID = 'test.ll'
target datalayout =
"e-p:32:32:32-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-n32"
target triple = "armv5-none-linux-gnueabi"

@.str1 = private constant [11 x i8] c"(){};[]&|:\00", align 4

define arm_aapcscc i32 @foo(i32 %argc) nounwind {
bb.nph:
  call arm_aapcscc  i8* @strchr(i8* getelementptr ([11 x i8]* @.str1, i32 0,
i32 0), i32 %argc) nounwind readonly
  ret i32 0
}

declare arm_aapcscc i8* @strchr(i8*, i32) nounwind readonly
----------------------------------------------------------------

opt -simplify-libcalls  -S test.ll -o test2.ll

will produce

declare i8* @memchr(i8*, i32, i32) nounwind readonly


I think there are two ways we could fix this. First is get simplify-libcalls to
ask the target for the calling convention. The second one is to have it
preserve the calling convention of the function it is replacing.

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