[llvm] r352014 - Revert "[RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI"
Ana Pazos via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 23 19:00:27 PST 2019
Author: apazos
Date: Wed Jan 23 19:00:26 2019
New Revision: 352014
URL: http://llvm.org/viewvc/llvm-project?rev=352014&view=rev
Log:
Revert "[RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI"
This reverts commit ccfb060ecb5d7e18ea729455660484d576bde2cc.
Some tests need to to fixed before reapplying this commit.
Modified:
llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.h
llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.td
Modified: llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.cpp?rev=352014&r1=352013&r2=352014&view=diff
==============================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.cpp Wed Jan 23 19:00:26 2019
@@ -447,16 +447,3 @@ unsigned RISCVInstrInfo::getInstSizeInBy
}
}
}
-
-bool RISCVInstrInfo::isAsCheapAsAMove(const MachineInstr &MI) const {
- const unsigned Opcode = MI.getOpcode();
- switch(Opcode) {
- default:
- break;
- case RISCV::ADDI:
- case RISCV::ORI:
- case RISCV::XORI:
- return (MI.getOperand(1).isReg() && MI.getOperand(1).getReg() == RISCV::X0);
- }
- return MI.isAsCheapAsAMove();
-}
Modified: llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.h?rev=352014&r1=352013&r2=352014&view=diff
==============================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.h (original)
+++ llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.h Wed Jan 23 19:00:26 2019
@@ -78,8 +78,6 @@ public:
bool isBranchOffsetInRange(unsigned BranchOpc,
int64_t BrOffset) const override;
-
- bool isAsCheapAsAMove(const MachineInstr &MI) const override;
};
}
#endif
Modified: llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.td?rev=352014&r1=352013&r2=352014&view=diff
==============================================================================
--- llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.td (original)
+++ llvm/trunk/lib/Target/RISCV/RISCVInstrInfo.td Wed Jan 23 19:00:26 2019
@@ -312,7 +312,7 @@ class Priv<string opcodestr, bits<7> fun
//===----------------------------------------------------------------------===//
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
-let isReMaterializable = 1, isAsCheapAsAMove = 1 in
+let isReMaterializable = 1 in
def LUI : RVInstU<OPC_LUI, (outs GPR:$rd), (ins uimm20_lui:$imm20),
"lui", "$rd, $imm20">;
@@ -348,13 +348,13 @@ def SW : Store_rri<0b010, "sw">;
// ADDI isn't always rematerializable, but isReMaterializable will be used as
// a hint which is verified in isReallyTriviallyReMaterializable.
-let isReMaterializable = 1, isAsCheapAsAMove = 1 in
+let isReMaterializable = 1 in
def ADDI : ALU_ri<0b000, "addi">;
def SLTI : ALU_ri<0b010, "slti">;
def SLTIU : ALU_ri<0b011, "sltiu">;
-let isReMaterializable = 1, isAsCheapAsAMove = 1 in {
+let isReMaterializable = 1 in {
def XORI : ALU_ri<0b100, "xori">;
def ORI : ALU_ri<0b110, "ori">;
}
More information about the llvm-commits
mailing list