forked from OSchip/llvm-project
When possible, use "mvn ra, rb" instead of "eor ra, rb, -1" because mvn has a narrow version and eor(i) does not.
llvm-svn: 74355
This commit is contained in:
parent
cf0b47d179
commit
5285817490
|
@ -482,6 +482,8 @@ defm t2ORN : T2I_bin_irs<"orn", BinOpFrag<(or node:$LHS, (not node:$RHS))>>;
|
|||
def : Thumb2Pat<(or GPR:$src, t2_so_imm_not:$imm),
|
||||
(t2ORNri GPR:$src, t2_so_imm_not:$imm)>;
|
||||
|
||||
// Prefer over of t2EORri ra, rb, -1 because mvn has 16-bit version
|
||||
let AddedComplexity = 1 in
|
||||
defm t2MVN : T2I_un_irs <"mvn", UnOpFrag<(not node:$Src)>, 1, 1>;
|
||||
|
||||
def : Thumb2Pat<(t2_so_imm_not:$src),
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mvn\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 2
|
||||
|
||||
define i32 @f1(i32 %a) {
|
||||
%tmp = xor i32 4294967295, %a
|
||||
ret i32 %tmp
|
||||
}
|
||||
|
||||
define i32 @f2(i32 %a) {
|
||||
%tmp = xor i32 %a, 4294967295
|
||||
ret i32 %tmp
|
||||
}
|
Loading…
Reference in New Issue