]> granicus.if.org Git - llvm/commitdiff
Revert "[RISCV] Set isAsCheapAsAMove for ADDI, ORI, XORI, LUI"
authorAna Pazos <apazos@codeaurora.org>
Thu, 24 Jan 2019 03:00:26 +0000 (03:00 +0000)
committerAna Pazos <apazos@codeaurora.org>
Thu, 24 Jan 2019 03:00:26 +0000 (03:00 +0000)
This reverts commit ccfb060ecb5d7e18ea729455660484d576bde2cc.

Some tests need to to fixed before reapplying this commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352014 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/RISCV/RISCVInstrInfo.cpp
lib/Target/RISCV/RISCVInstrInfo.h
lib/Target/RISCV/RISCVInstrInfo.td

index afa872b4a5ce04205ff524f41a4394627fe2a505..d99d789fb7e9de106314296b0010e0eae1e3922c 100644 (file)
@@ -447,16 +447,3 @@ unsigned RISCVInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const {
   }
   }
 }
-
-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();
-}
index ff098e660d1915c52ddacd326460bb36f31b8a54..28a7e2fb2b6662ba3a129d379da6131bee5e090e 100644 (file)
@@ -78,8 +78,6 @@ public:
 
   bool isBranchOffsetInRange(unsigned BranchOpc,
                              int64_t BrOffset) const override;
-
-  bool isAsCheapAsAMove(const MachineInstr &MI) const override;
 };
 }
 #endif
index 9ad7681f2ff233f222bdc3d1b6c59206450f0ec1..3ba86cfcdfd30a20cf7517f1adc2cfbb0e79101d 100644 (file)
@@ -312,7 +312,7 @@ class Priv<string opcodestr, bits<7> funct7>
 //===----------------------------------------------------------------------===//
 
 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">;
 }