[llvm] 298257b - [NFC] Autogenerate CodeGen/X86/and-or-fold.ll .

Amaury Séchet via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 06:13:29 PDT 2023


Author: Amaury Séchet
Date: 2023-04-11T13:13:17Z
New Revision: 298257bade9c666e51aa640f3c1eb4e1cb964664

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

LOG: [NFC] Autogenerate CodeGen/X86/and-or-fold.ll .

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/and-or-fold.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/and-or-fold.ll b/llvm/test/CodeGen/X86/and-or-fold.ll
index ec39522e6b10d..314e05b772b97 100644
--- a/llvm/test/CodeGen/X86/and-or-fold.ll
+++ b/llvm/test/CodeGen/X86/and-or-fold.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
 ; RUN: llc < %s -mtriple=i686-apple-darwin | FileCheck -check-prefix=DARWIN %s
 ; RUN: opt < %s -O2 | llc -mtriple=x86_64-apple-darwin | FileCheck -check-prefix=DARWIN-OPT %s
 
@@ -5,22 +6,48 @@
 ; in this case.
 
 define i32 @test1(i32 %x, i16 %y) {
+; DARWIN-LABEL: test1:
+; DARWIN:       ## %bb.0:
+; DARWIN-NEXT:    movzwl {{[0-9]+}}(%esp), %ecx
+; DARWIN-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; DARWIN-NEXT:    shll $16, %eax
+; DARWIN-NEXT:    orl %ecx, %eax
+; DARWIN-NEXT:    andl $16711807, %eax ## imm = 0xFF007F
+; DARWIN-NEXT:    retl
+;
+; DARWIN-OPT-LABEL: test1:
+; DARWIN-OPT:       ## %bb.0:
+; DARWIN-OPT-NEXT:    andl $127, %esi
+; DARWIN-OPT-NEXT:    movzbl %dil, %eax
+; DARWIN-OPT-NEXT:    shll $16, %eax
+; DARWIN-OPT-NEXT:    orl %esi, %eax
+; DARWIN-OPT-NEXT:    retq
   %tmp1 = zext i16 %y to i32
   %tmp2 = and i32 %tmp1, 127
   %tmp4 = shl i32 %x, 16
   %tmp5 = and i32 %tmp4, 16711680
   %tmp6 = or i32 %tmp2, %tmp5
   ret i32 %tmp6
-; DARWIN: andl $16711807, %eax
 }
 
 ; <rdar://problem/7529774> The optimizer shouldn't fold this into (and (or, C),  D)
 ; if (C & D) == 0
 define i64 @test2(i64 %x) nounwind readnone ssp {
+; DARWIN-LABEL: test2:
+; DARWIN:       ## %bb.0: ## %entry
+; DARWIN-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; DARWIN-NEXT:    orl $3, %eax
+; DARWIN-NEXT:    andl $123127, %eax ## imm = 0x1E0F7
+; DARWIN-NEXT:    xorl %edx, %edx
+; DARWIN-NEXT:    retl
+;
+; DARWIN-OPT-LABEL: test2:
+; DARWIN-OPT:       ## %bb.0: ## %entry
+; DARWIN-OPT-NEXT:    andl $123124, %edi ## imm = 0x1E0F4
+; DARWIN-OPT-NEXT:    leaq 3(%rdi), %rax
+; DARWIN-OPT-NEXT:    retq
 entry:
   %tmp1 = and i64 %x, 123127
   %tmp2 = or i64 %tmp1, 3
   ret i64 %tmp2
-; DARWIN-OPT:       andl $123124
-; DARWIN-OPT-NEXT:  leaq 3
 }


        


More information about the llvm-commits mailing list