brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · c75360d Raw
55 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=instcombine -S | FileCheck %s3; Verify that the non-default calling conv doesn't prevent the libcall simplification4 5; Layout specifies type of pointer which determines "size_t"6; which is used to identify libcalls such as "size_t strlen(char*)".7 8target datalayout = "p:32:32"9 10@.str = private unnamed_addr constant [4 x i8] c"abc\00", align 111 12define arm_aapcscc i32 @_abs(i32 %i) nounwind readnone {13; CHECK-LABEL: @_abs(14; CHECK-NEXT:    [[CALL:%.*]] = call i32 @llvm.abs.i32(i32 [[I:%.*]], i1 true)15; CHECK-NEXT:    ret i32 [[CALL]]16;17  %call = tail call arm_aapcscc i32 @abs(i32 %i) nounwind readnone18  ret i32 %call19}20 21declare arm_aapcscc i32 @abs(i32) nounwind readnone22 23define arm_aapcscc i32 @_labs(i32 %i) nounwind readnone {24; CHECK-LABEL: @_labs(25; CHECK-NEXT:    [[CALL:%.*]] = call i32 @llvm.abs.i32(i32 [[I:%.*]], i1 true)26; CHECK-NEXT:    ret i32 [[CALL]]27;28  %call = tail call arm_aapcscc i32 @labs(i32 %i) nounwind readnone29  ret i32 %call30}31 32declare arm_aapcscc i32 @labs(i32) nounwind readnone33 34define arm_aapcscc i32 @_strlen1() {35; CHECK-LABEL: @_strlen1(36; CHECK-NEXT:    ret i32 337;38  %call = tail call arm_aapcscc i32 @strlen(ptr @.str)39  ret i32 %call40}41 42declare arm_aapcscc i32 @strlen(ptr)43 44define arm_aapcscc zeroext i1 @_strlen2(ptr %str) {45; CHECK-LABEL: @_strlen2(46; CHECK-NEXT:    [[CHAR0:%.*]] = load i8, ptr [[STR:%.*]], align 147; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i8 [[CHAR0]], 048; CHECK-NEXT:    ret i1 [[CMP]]49;50  %call = tail call arm_aapcscc i32 @strlen(ptr %str)51  %cmp = icmp ne i32 %call, 052  ret i1 %cmp53}54 55