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 e437ba2 commit 0e3837bCopy full SHA for 0e3837b
llvm/test/Transforms/InstSimplify/select-icmp.ll
@@ -264,3 +264,15 @@ define ptr @icmp_ptr_eq_replace_null(ptr %a) {
264
%sel = select i1 %cmp, ptr null, ptr %a
265
ret ptr %sel
266
}
267
+
268
+define ptr @ptr_eq_replace_same_underlying_object(ptr %st, i64 %i, i64 %j) {
269
+; CHECK-LABEL: @ptr_eq_replace_same_underlying_object(
270
+; CHECK-NEXT: [[B:%.*]] = getelementptr inbounds i8, ptr [[ST:%.*]], i64 [[J:%.*]]
271
+; CHECK-NEXT: ret ptr [[B]]
272
+;
273
+ %a = getelementptr inbounds i8, ptr %st, i64 %i
274
+ %b = getelementptr inbounds i8, ptr %st, i64 %j
275
+ %cmp = icmp eq ptr %a, %b
276
+ %sel = select i1 %cmp, ptr %a, ptr %b
277
+ ret ptr %sel
278
+}
0 commit comments