[llvm] 2d93326 - [InstCombine] Precommit test

Piotr Sobczak via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 05:01:39 PDT 2022


Author: Piotr Sobczak
Date: 2022-07-15T13:57:54+02:00
New Revision: 2d9332646a9c37eb2934a4370a57ead2aece706f

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

LOG: [InstCombine] Precommit test

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/add.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll
index 4218cb91ceec1..86f65e5135379 100644
--- a/llvm/test/Transforms/InstCombine/add.ll
+++ b/llvm/test/Transforms/InstCombine/add.ll
@@ -759,6 +759,19 @@ define i8 @not_masked_add(i8 %x) {
   ret i8 %r
 }
 
+define i8 @masked_add_multi_use(i8 %x) {
+; CHECK-LABEL: @masked_add_multi_use(
+; CHECK-NEXT:    [[TMP:%.*]] = add i8 [[X:%.*]], 96
+; CHECK-NEXT:    [[R:%.*]] = and i8 [[TMP:%.*]], -16
+; CHECK-NEXT:    call void @use(i8 [[X]])
+; CHECK-NEXT:    ret i8 [[R]]
+;
+  %and = and i8 %x, -16 ; 0xf0
+  %r = add i8 %and, 96  ; 0x60
+  call void @use(i8 %x) ; extra use
+  ret i8 %r
+}
+
 define i32 @test35(i32 %a) {
 ; CHECK-LABEL: @test35(
 ; CHECK-NEXT:    ret i32 -1


        


More information about the llvm-commits mailing list