We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a7687c commit 0e89596Copy full SHA for 0e89596
llvm/test/Transforms/AggressiveInstCombine/memchr.ll
@@ -161,3 +161,17 @@ entry:
161
%memchr = call ptr @memchr(ptr @str_long, i32 %x, i64 8)
162
ret ptr %memchr
163
}
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