[llvm] 821c332 - [ConstraintElim] Add missing checks in test_overflow_in_negate_constraint (#65841)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 10 11:52:30 PDT 2023


Author: Yingwei Zheng
Date: 2023-09-11T02:52:26+08:00
New Revision: 821c332b53db9818d193bf4813d00db1485e35c8

URL: https://github.com/llvm/llvm-project/commit/821c332b53db9818d193bf4813d00db1485e35c8
DIFF: https://github.com/llvm/llvm-project/commit/821c332b53db9818d193bf4813d00db1485e35c8.diff

LOG: [ConstraintElim] Add missing checks in test_overflow_in_negate_constraint (#65841)

This patch adds missing checks in the function
`test_overflow_in_negate_constraint`.
Related commit: 0a0181dc2061fc60b309f231a5b2f6251046c552

Added: 
    

Modified: 
    llvm/test/Transforms/ConstraintElimination/overflows.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/ConstraintElimination/overflows.ll b/llvm/test/Transforms/ConstraintElimination/overflows.ll
index 1fd6bdbf6615bac..556ae0c56f9aad7 100644
--- a/llvm/test/Transforms/ConstraintElimination/overflows.ll
+++ b/llvm/test/Transforms/ConstraintElimination/overflows.ll
@@ -18,6 +18,14 @@ bb:
 }
 
 define i1 @test_overflow_in_negate_constraint(i8 %x, i64 %y) {
+; CHECK-LABEL: define i1 @test_overflow_in_negate_constraint
+; CHECK-SAME: (i8 [[X:%.*]], i64 [[Y:%.*]]) {
+; CHECK-NEXT:  bb:
+; CHECK-NEXT:    [[ZEXT:%.*]] = zext i8 [[X]] to i64
+; CHECK-NEXT:    [[SHL:%.*]] = shl nuw nsw i64 [[ZEXT]], 63
+; CHECK-NEXT:    [[ICMP:%.*]] = icmp uge i64 [[Y]], [[SHL]]
+; CHECK-NEXT:    ret i1 [[ICMP]]
+;
 bb:
   %zext = zext i8 %x to i64
   %shl = shl nuw nsw i64 %zext, 63


        


More information about the llvm-commits mailing list