def32 here means the producing instruction zeroed bits 63:32. We already do this for zext, but it looks like we can get an and+anyext sometimes.
Spotted in the diffs from D33587.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352303
91177308-0d34-0410-b5e6-
96231b3b80d8
// we can use a SUBREG_TO_REG.
def : Pat<(i64 (zext def32:$src)),
(SUBREG_TO_REG (i64 0), GR32:$src, sub_32bit)>;
+def : Pat<(i64 (and (anyext def32:$src), 0x00000000FFFFFFFF)),
+ (SUBREG_TO_REG (i64 0), GR32:$src, sub_32bit)>;
//===----------------------------------------------------------------------===//
// Pattern match OR as ADD
; CHECK-NEXT: movzwl %ax, %eax
; CHECK-NEXT: shrl $2, %eax
; CHECK-NEXT: orl $60, %eax
-; CHECK-NEXT: movl %eax, %eax
; CHECK-NEXT: retq
entry:
%bf.load = load i8, i8* %data, align 4