Skip to content

Commit d09b521

Browse files
committed
[InstSimplify] Add pre-commit tests. NFC.
1 parent 5c3c0a8 commit d09b521

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

llvm/test/Transforms/InstSimplify/select-icmp.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,21 @@ cond.true: ; preds = %entry
244244
cond.end: ; preds = %entry, %cond.true
245245
ret i8 0
246246
}
247+
248+
define ptr @icmp_ptr_eq_replace(ptr %a, ptr %b) {
249+
; CHECK-LABEL: @icmp_ptr_eq_replace(
250+
; CHECK-NEXT: ret ptr [[B:%.*]]
251+
;
252+
%cmp = icmp eq ptr %a, %b
253+
%sel = select i1 %cmp, ptr %a, ptr %b
254+
ret ptr %sel
255+
}
256+
257+
define ptr @icmp_ptr_eq_replace_null(ptr %a) {
258+
; CHECK-LABEL: @icmp_ptr_eq_replace_null(
259+
; CHECK-NEXT: ret ptr [[A:%.*]]
260+
;
261+
%cmp = icmp eq ptr %a, null
262+
%sel = select i1 %cmp, ptr null, ptr %a
263+
ret ptr %sel
264+
}

0 commit comments

Comments
 (0)