Skip to content

Commit 597618f

Browse files
author
Reid Spencer
committed
Add a case with non-constant argument for testing the transform:
ffs(x) -> (x == 0 ? 0 : llvm.cttz(0)+1) llvm-svn: 22069
1 parent 17f7784 commit 597618f

File tree

1 file changed

+7
-1
lines changed
  • llvm/test/Regression/Transforms/SimplifyLibCalls

1 file changed

+7
-1
lines changed

llvm/test/Regression/Transforms/SimplifyLibCalls/FFS.ll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@
44
declare int %ffs(int)
55
declare int %ffsl(int)
66
declare int %ffsll(long)
7+
declare int %__builtin_ffs(int)
8+
9+
%non_const = external global int
710

811
implementation ; Functions:
912

1013
int %main () {
14+
%arg = load int* %non_const
15+
%val0 = call int %ffs(int %arg)
1116
%val1 = call int %ffs(int 1)
12-
%val2 = call int %ffs(int 2048)
17+
%val2 = call int %__builtin_ffs(int 2048)
1318
%val3 = call int %ffsl(int 65536)
1419
%val4 = call int %ffsll(long 1024)
1520
%val5 = call int %ffsll(long 17179869184)
@@ -19,5 +24,6 @@ int %main () {
1924
%rslt3 = add int %val5, %val6
2025
%rslt4 = add int %rslt1, %rslt2
2126
%rslt5 = add int %rslt4, %rslt3
27+
%rslt6 = add int %rslt5, %val0
2228
ret int %rslt5
2329
}

0 commit comments

Comments
 (0)