Skip to content

Commit f599f43

Browse files
committed
[Mips]Add test file for 'xor' and 'and' instructions
For llvm#99783
1 parent 090c92e commit f599f43

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

llvm/test/CodeGen/Mips/xor-and.ll

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
; RUN: llc -O3 -mcpu=mips64r6 -mtriple=mips64el-unknown-linux-gnuabi64 < %s -o - | FileCheck %s
2+
3+
; This test shows the unoptimized result with unnecessary SLLs.
4+
define noundef signext i32 @xor_and(i32 noundef signext %a, i32 noundef signext %b) local_unnamed_addr {
5+
; CHECK-LABEL: xor_and:
6+
; CHECK: # %bb.0: # %entry
7+
; CHECK-NEXT: and $1, $5, $4
8+
; CHECK-NEXT: sll $1, $1, 0
9+
; CHECK-NEXT: not $1, $1
10+
; CHECK-NEXT: jr $ra
11+
; CHECK-NEXT: sll $2, $1, 0
12+
13+
entry:
14+
%0 = and i32 %b, %a
15+
%or1 = xor i32 %0, -1
16+
ret i32 %or1
17+
}

0 commit comments

Comments
 (0)