[llvm] r274887 - add test to show multi-use output
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 8 10:12:27 PDT 2016
Author: spatel
Date: Fri Jul 8 12:12:27 2016
New Revision: 274887
URL: http://llvm.org/viewvc/llvm-project?rev=274887&view=rev
Log:
add test to show multi-use output
Modified:
llvm/trunk/test/Transforms/InstCombine/or.ll
Modified: llvm/trunk/test/Transforms/InstCombine/or.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/or.ll?rev=274887&r1=274886&r2=274887&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/or.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/or.ll Fri Jul 8 12:12:27 2016
@@ -445,6 +445,21 @@ define i32 @orsext_to_sel_swap(i32 %x, i
ret i32 %or
}
+; FIXME: Don't replace an 'or' with a select unless it allows further simplification.
+
+define i32 @orsext_to_sel_multi_use(i32 %x, i1 %y) {
+; CHECK-LABEL: @orsext_to_sel_multi_use(
+; CHECK-NEXT: [[SEXT:%.*]] = sext i1 %y to i32
+; CHECK-NEXT: [[OR:%.*]] = select i1 %y, i32 -1, i32 %x
+; CHECK-NEXT: [[ADD:%.*]] = add i32 [[SEXT]], [[OR]]
+; CHECK-NEXT: ret i32 [[ADD]]
+;
+ %sext = sext i1 %y to i32
+ %or = or i32 %sext, %x
+ %add = add i32 %sext, %or
+ ret i32 %add
+}
+
define <2 x i32> @orsext_to_sel_vec(<2 x i32> %x, <2 x i1> %y) {
; CHECK-LABEL: @orsext_to_sel_vec(
; CHECK-NEXT: [[OR:%.*]] = select <2 x i1> %y, <2 x i32> <i32 -1, i32 -1>, <2 x i32> %x
More information about the llvm-commits
mailing list