[llvm] 0d677c8 - [InstCombine] Add test for PR64114 (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 01:12:15 PDT 2023


Author: Nikita Popov
Date: 2023-07-27T10:11:48+02:00
New Revision: 0d677c81c4f6fb556592b793c24f03cbd68a9d99

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

LOG: [InstCombine] Add test for PR64114 (NFC)

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/and-or.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/and-or.ll b/llvm/test/Transforms/InstCombine/and-or.ll
index 65a27ecb1fa81e..a6933d73f3d0ac 100644
--- a/llvm/test/Transforms/InstCombine/and-or.ll
+++ b/llvm/test/Transforms/InstCombine/and-or.ll
@@ -318,6 +318,16 @@ define <2 x i8> @and_or_hoist_mask_commute_vec_splat(<2 x i8> %a, <2 x i8> %b) {
   ret <2 x i8> %and
 }
 
+ at g = external global i32
+
+define i32 @pr64114_and_xor_hoist_mask_constexpr() {
+; CHECK-LABEL: @pr64114_and_xor_hoist_mask_constexpr(
+; CHECK-NEXT:    ret i32 and (i32 xor (i32 lshr (i32 ptrtoint (ptr @g to i32), i32 8), i32 ptrtoint (ptr @g to i32)), i32 1)
+;
+  %and = and i32 xor (i32 lshr (i32 ptrtoint (ptr @g to i32), i32 8), i32 ptrtoint (ptr @g to i32)), 1
+  ret i32 %and
+}
+
 ; Don't transform if the 'or' has multiple uses because that would increase instruction count.
 
 define i8 @and_or_do_not_hoist_mask(i8 %a, i8 %b) {


        


More information about the llvm-commits mailing list