[llvm] r367577 - [InstCombine] add test with swapped select operands; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 08:32:10 PDT 2019
Author: spatel
Date: Thu Aug 1 08:32:10 2019
New Revision: 367577
URL: http://llvm.org/viewvc/llvm-project?rev=367577&view=rev
Log:
[InstCombine] add test with swapped select operands; NFC
More coverage for the proposal in D65576.
Modified:
llvm/trunk/test/Transforms/InstCombine/select.ll
Modified: llvm/trunk/test/Transforms/InstCombine/select.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/select.ll?rev=367577&r1=367576&r2=367577&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/select.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/select.ll Thu Aug 1 08:32:10 2019
@@ -1329,6 +1329,19 @@ define i32 @PR23757(i32 %x) {
ret i32 %sel
}
+define i32 @PR23757_swapped(i32 %x) {
+; CHECK-LABEL: @PR23757_swapped(
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[X:%.*]], 2147483647
+; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[X]], 1
+; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], i32 [[ADD]], i32 -2147483648
+; CHECK-NEXT: ret i32 [[SEL]]
+;
+ %cmp = icmp eq i32 %x, 2147483647
+ %add = add nsw i32 %x, 1
+ %sel = select i1 %cmp, i32 %add, i32 -2147483648
+ ret i32 %sel
+}
+
; max(max(~a, -1), -1) --> ~min(a, 0)
define i32 @PR27137(i32 %a) {
More information about the llvm-commits
mailing list