mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Turn strcmp into memcmp, such as strcmp(P, "x") --> memcmp(P, "x", 2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61297 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
10
test/Transforms/SimplifyLibCalls/2008-12-20-StrcmpMemcmp.ll
Normal file
10
test/Transforms/SimplifyLibCalls/2008-12-20-StrcmpMemcmp.ll
Normal file
@@ -0,0 +1,10 @@
|
||||
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | grep call.*memcmp
|
||||
|
||||
@.str = internal constant [2 x i8] c"x\00"
|
||||
|
||||
declare i32 @strcmp(i8* %dest, i8* %src)
|
||||
|
||||
define i32 @foo(i8* %x, i8* %y) {
|
||||
%A = call i32 @strcmp(i8* %x, i8* getelementptr ([2 x i8]* @.str, i32 0, i32 0))
|
||||
ret i32 %A
|
||||
}
|
Reference in New Issue
Block a user