[llvm] aa6bb16 - [CVP] Add test for #76705 (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 02:24:56 PST 2024


Author: Nikita Popov
Date: 2024-01-02T11:24:47+01:00
New Revision: aa6bb1697f2ef0881ae11cd5351d980fc98a4a14

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

LOG: [CVP] Add test for #76705 (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/CorrelatedValuePropagation/basic.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/CorrelatedValuePropagation/basic.ll b/llvm/test/Transforms/CorrelatedValuePropagation/basic.ll
index 9fcf7c320f62dd..7b9375784dae82 100644
--- a/llvm/test/Transforms/CorrelatedValuePropagation/basic.ll
+++ b/llvm/test/Transforms/CorrelatedValuePropagation/basic.ll
@@ -1910,6 +1910,21 @@ exit:
   ret i1 false
 }
 
+define i1 @binop_eval_order(i32 %x) {
+; CHECK-LABEL: @binop_eval_order(
+; CHECK-NEXT:    [[A:%.*]] = add nuw nsw i32 [[X:%.*]], 1
+; CHECK-NEXT:    [[B:%.*]] = add nuw nsw i32 [[A]], 1
+; CHECK-NEXT:    [[C:%.*]] = add nuw nsw i32 [[A]], [[B]]
+; CHECK-NEXT:    [[D:%.*]] = icmp ugt i32 [[C]], 2
+; CHECK-NEXT:    ret i1 [[D]]
+;
+  %a = add nuw nsw i32 %x, 1
+  %b = add nuw nsw i32 %a, 1
+  %c = add nuw nsw i32 %a, %b
+  %d = icmp ugt i32 %c, 2
+  ret i1 %d
+}
+
 declare i32 @llvm.uadd.sat.i32(i32, i32)
 declare i32 @llvm.usub.sat.i32(i32, i32)
 declare i32 @llvm.sadd.sat.i32(i32, i32)


        


More information about the llvm-commits mailing list