Skip to content

Commit 0e89596

Browse files
committed
[AggressiveInstCombine] Add tests for inline threshold (if l=2, memchr is called)
1 parent 6a7687c commit 0e89596

File tree

1 file changed

+14
-0
lines changed
  • llvm/test/Transforms/AggressiveInstCombine

1 file changed

+14
-0
lines changed

llvm/test/Transforms/AggressiveInstCombine/memchr.ll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,17 @@ entry:
161161
%memchr = call ptr @memchr(ptr @str_long, i32 %x, i64 8)
162162
ret ptr %memchr
163163
}
164+
165+
166+
define ptr @test_memchr_non_constant_length2(i32 %x, i64 %len) {
167+
; CHECK-LABEL: define ptr @test_memchr_non_constant_length2(
168+
; CHECK-SAME: i32 [[X:%.*]], i64 [[LEN:%.*]]) {
169+
; CHECK-NEXT: [[ENTRY:.*:]]
170+
; CHECK-NEXT: ; We want to check that the compiler still calls memchr:
171+
; CHECK-NEXT: [[MEMCHR:%.*]] = call ptr @memchr(ptr @str, i32 [[X]], i64 [[LEN]])
172+
; CHECK-NEXT: ret ptr [[MEMCHR]]
173+
;
174+
entry:
175+
%memchr = call ptr @memchr(ptr @str, i32 %x, i64 %len)
176+
ret ptr %memchr
177+
}

0 commit comments

Comments
 (0)