[llvm] r334235 - [NFC][InstSimplify] One more negative test for shl nuw C, %x -> C fold.

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 14:19:45 PDT 2018


Author: lebedevri
Date: Thu Jun  7 14:19:45 2018
New Revision: 334235

URL: http://llvm.org/viewvc/llvm-project?rev=334235&view=rev
Log:
[NFC][InstSimplify] One more negative test for shl nuw C, %x -> C fold.

Follow-up for rL334200, rL334206.

Modified:
    llvm/trunk/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll

Modified: llvm/trunk/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll?rev=334235&r1=334234&r2=334235&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll (original)
+++ llvm/trunk/test/Transforms/InstSimplify/constantfold-shl-nuw-C-to-C.ll Thu Jun  7 14:19:45 2018
@@ -108,12 +108,21 @@ define i8 @shl_127 (i8 %x) {
   ret i8 %ret
 }
 
+define i8 @bad_shl (i8 %x) {
+; CHECK-LABEL: @bad_shl(
+; CHECK-NEXT:    [[RET:%.*]] = shl i8 -1, [[X:%.*]]
+; CHECK-NEXT:    ret i8 [[RET]]
+;
+  %ret = shl i8 -1, %x ; need nuw
+  ret i8 %ret
+}
+
 define i8 @bad_nsw (i8 %x) {
 ; CHECK-LABEL: @bad_nsw(
 ; CHECK-NEXT:    [[RET:%.*]] = shl nsw i8 -1, [[X:%.*]]
 ; CHECK-NEXT:    ret i8 [[RET]]
 ;
-  %ret = shl nsw i8 -1, %x
+  %ret = shl nsw i8 -1, %x ; need nuw
   ret i8 %ret
 }
 




More information about the llvm-commits mailing list