mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
Mark some pattern-less instructions as neverHasSideEffects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73252 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -451,7 +451,7 @@ multiclass AsXI1_bin_c_irs<bits<4> opcod, string opc, PatFrag opnode> {
|
|||||||
/// the function. The first operand is the ID# for this instruction, the second
|
/// the function. The first operand is the ID# for this instruction, the second
|
||||||
/// is the index into the MachineConstantPool that this is, the third is the
|
/// is the index into the MachineConstantPool that this is, the third is the
|
||||||
/// size in bytes of this constant pool entry.
|
/// size in bytes of this constant pool entry.
|
||||||
let isNotDuplicable = 1 in
|
let neverHasSideEffects = 1, isNotDuplicable = 1 in
|
||||||
def CONSTPOOL_ENTRY :
|
def CONSTPOOL_ENTRY :
|
||||||
PseudoInst<(outs), (ins cpinst_operand:$instid, cpinst_operand:$cpidx,
|
PseudoInst<(outs), (ins cpinst_operand:$instid, cpinst_operand:$cpidx,
|
||||||
i32imm:$size),
|
i32imm:$size),
|
||||||
@@ -771,6 +771,7 @@ def STM : AXI4st<(outs),
|
|||||||
// Move Instructions.
|
// Move Instructions.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
let neverHasSideEffects = 1 in
|
||||||
def MOVr : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
|
def MOVr : AsI1<0b1101, (outs GPR:$dst), (ins GPR:$src), DPFrm,
|
||||||
"mov", " $dst, $src", []>, UnaryDP;
|
"mov", " $dst, $src", []>, UnaryDP;
|
||||||
def MOVs : AsI1<0b1101, (outs GPR:$dst), (ins so_reg:$src), DPSoRegFrm,
|
def MOVs : AsI1<0b1101, (outs GPR:$dst), (ins so_reg:$src), DPSoRegFrm,
|
||||||
@@ -946,6 +947,7 @@ def MLA : AsMul1I<0b0000001, (outs GPR:$dst), (ins GPR:$a, GPR:$b, GPR:$c),
|
|||||||
[(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>;
|
[(set GPR:$dst, (add (mul GPR:$a, GPR:$b), GPR:$c))]>;
|
||||||
|
|
||||||
// Extra precision multiplies with low / high results
|
// Extra precision multiplies with low / high results
|
||||||
|
let neverHasSideEffects = 1 in {
|
||||||
def SMULL : AsMul1I<0b0000110, (outs GPR:$ldst, GPR:$hdst),
|
def SMULL : AsMul1I<0b0000110, (outs GPR:$ldst, GPR:$hdst),
|
||||||
(ins GPR:$a, GPR:$b),
|
(ins GPR:$a, GPR:$b),
|
||||||
"smull", " $ldst, $hdst, $a, $b", []>;
|
"smull", " $ldst, $hdst, $a, $b", []>;
|
||||||
@@ -967,6 +969,7 @@ def UMAAL : AMul1I <0b0000010, (outs GPR:$ldst, GPR:$hdst),
|
|||||||
(ins GPR:$a, GPR:$b),
|
(ins GPR:$a, GPR:$b),
|
||||||
"umaal", " $ldst, $hdst, $a, $b", []>,
|
"umaal", " $ldst, $hdst, $a, $b", []>,
|
||||||
Requires<[IsARM, HasV6]>;
|
Requires<[IsARM, HasV6]>;
|
||||||
|
} // neverHasSideEffects
|
||||||
|
|
||||||
// Most significant word multiply
|
// Most significant word multiply
|
||||||
def SMMUL : AMul2I <0b0111010, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
|
def SMMUL : AMul2I <0b0111010, (outs GPR:$dst), (ins GPR:$a, GPR:$b),
|
||||||
|
@@ -298,6 +298,7 @@ def tADDrr : TI<(outs tGPR:$dst), (ins tGPR:$lhs, tGPR:$rhs),
|
|||||||
"add $dst, $lhs, $rhs",
|
"add $dst, $lhs, $rhs",
|
||||||
[(set tGPR:$dst, (add tGPR:$lhs, tGPR:$rhs))]>;
|
[(set tGPR:$dst, (add tGPR:$lhs, tGPR:$rhs))]>;
|
||||||
|
|
||||||
|
let neverHasSideEffects = 1 in
|
||||||
def tADDhirr : TIt<(outs tGPR:$dst), (ins GPR:$lhs, GPR:$rhs),
|
def tADDhirr : TIt<(outs tGPR:$dst), (ins GPR:$lhs, GPR:$rhs),
|
||||||
"add $dst, $rhs @ addhirr", []>;
|
"add $dst, $rhs @ addhirr", []>;
|
||||||
|
|
||||||
@@ -387,6 +388,7 @@ def tMOVi8 : TI<(outs tGPR:$dst), (ins i32imm:$src),
|
|||||||
|
|
||||||
// Note: MOV(2) of two low regs updates the flags, so we emit this as 'cpy',
|
// Note: MOV(2) of two low regs updates the flags, so we emit this as 'cpy',
|
||||||
// which is MOV(3). This also supports high registers.
|
// which is MOV(3). This also supports high registers.
|
||||||
|
let neverHasSideEffects = 1 in {
|
||||||
def tMOVr : TI<(outs tGPR:$dst), (ins tGPR:$src),
|
def tMOVr : TI<(outs tGPR:$dst), (ins tGPR:$src),
|
||||||
"cpy $dst, $src", []>;
|
"cpy $dst, $src", []>;
|
||||||
def tMOVhir2lor : TI<(outs tGPR:$dst), (ins GPR:$src),
|
def tMOVhir2lor : TI<(outs tGPR:$dst), (ins GPR:$src),
|
||||||
@@ -395,6 +397,7 @@ def tMOVlor2hir : TI<(outs GPR:$dst), (ins tGPR:$src),
|
|||||||
"cpy $dst, $src\t@ lor2hir", []>;
|
"cpy $dst, $src\t@ lor2hir", []>;
|
||||||
def tMOVhir2hir : TI<(outs GPR:$dst), (ins GPR:$src),
|
def tMOVhir2hir : TI<(outs GPR:$dst), (ins GPR:$src),
|
||||||
"cpy $dst, $src\t@ hir2hir", []>;
|
"cpy $dst, $src\t@ hir2hir", []>;
|
||||||
|
} // neverHasSideEffects
|
||||||
|
|
||||||
def tMUL : TIt<(outs tGPR:$dst), (ins tGPR:$lhs, tGPR:$rhs),
|
def tMUL : TIt<(outs tGPR:$dst), (ins tGPR:$lhs, tGPR:$rhs),
|
||||||
"mul $dst, $rhs",
|
"mul $dst, $rhs",
|
||||||
|
@@ -192,11 +192,13 @@ def FCVTSD : AI<(outs SPR:$dst), (ins DPR:$a), VFPUnaryFrm,
|
|||||||
let Inst{7-4} = 0b1100;
|
let Inst{7-4} = 0b1100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let neverHasSideEffects = 1 in {
|
||||||
def FCPYD : ADuI<0b11101011, 0b0000, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
def FCPYD : ADuI<0b11101011, 0b0000, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
||||||
"fcpyd", " $dst, $a", []>;
|
"fcpyd", " $dst, $a", []>;
|
||||||
|
|
||||||
def FCPYS : ASuI<0b11101011, 0b0000, 0b0100, (outs SPR:$dst), (ins SPR:$a),
|
def FCPYS : ASuI<0b11101011, 0b0000, 0b0100, (outs SPR:$dst), (ins SPR:$a),
|
||||||
"fcpys", " $dst, $a", []>;
|
"fcpys", " $dst, $a", []>;
|
||||||
|
} // neverHasSideEffects
|
||||||
|
|
||||||
def FNEGD : ADuI<0b11101011, 0b0001, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
def FNEGD : ADuI<0b11101011, 0b0001, 0b0100, (outs DPR:$dst), (ins DPR:$a),
|
||||||
"fnegd", " $dst, $a",
|
"fnegd", " $dst, $a",
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
; RUN: llvm-as < %s | llc -stats |& grep {40.*Number of machine instrs printed}
|
; RUN: llvm-as < %s | llc -stats |& grep {39.*Number of machine instrs printed}
|
||||||
; RUN: llvm-as < %s | llc -stats |& grep {.*Number of re-materialization}
|
; RUN: llvm-as < %s | llc -stats |& grep {.*Number of re-materialization}
|
||||||
; This test really wants to check that the resultant "cond_true" block only
|
; This test really wants to check that the resultant "cond_true" block only
|
||||||
; has a single store in it, and that cond_true55 only has code to materialize
|
; has a single store in it, and that cond_true55 only has code to materialize
|
||||||
|
Reference in New Issue
Block a user