[llvm-commits] CVS: llvm/lib/Target/ARM/ARMInstrInfo.cpp ARMInstrInfo.h ARMInstrInfo.td ARMInstrThumb.td

Evan Cheng evan.cheng at apple.com
Mon Jun 18 18:25:53 PDT 2007



Changes in directory llvm/lib/Target/ARM:

ARMInstrInfo.cpp updated: 1.37 -> 1.38
ARMInstrInfo.h updated: 1.14 -> 1.15
ARMInstrInfo.td updated: 1.110 -> 1.111
ARMInstrThumb.td updated: 1.30 -> 1.31
---
Log message:

Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.

---
Diffs of the changes:  (+7 -31)

 ARMInstrInfo.cpp |   29 -----------------------------
 ARMInstrInfo.h   |    2 --
 ARMInstrInfo.td  |    6 ++++++
 ARMInstrThumb.td |    1 +
 4 files changed, 7 insertions(+), 31 deletions(-)


Index: llvm/lib/Target/ARM/ARMInstrInfo.cpp
diff -u llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.37 llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.38
--- llvm/lib/Target/ARM/ARMInstrInfo.cpp:1.37	Fri Jun 15 16:15:00 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.cpp	Mon Jun 18 20:25:30 2007
@@ -446,35 +446,6 @@
   return PIdx != -1 && MI->getOperand(PIdx).getImmedValue() != ARMCC::AL;
 }
 
-bool ARMInstrInfo::CanBeDuplicated(const MachineInstr *MI) const {
-  switch (MI->getOpcode()) {
-  default: return true;
-  // These have unique labels.
-  case ARM::PICADD:
-  case ARM::PICLD:
-  case ARM::PICLDZH:
-  case ARM::PICLDZB:
-  case ARM::PICLDH:
-  case ARM::PICLDB:
-  case ARM::PICLDSH:
-  case ARM::PICLDSB:
-  case ARM::PICSTR:
-  case ARM::PICSTRH:
-  case ARM::PICSTRB:
-  case ARM::LEApcrel:
-  case ARM::LEApcrelJT:
-  case ARM::tPICADD:
-  case ARM::tLEApcrel:
-  case ARM::tLEApcrelJT:
-  case ARM::CONSTPOOL_ENTRY:
-  // These embed jumptables.
-  case ARM::BR_JTr:
-  case ARM::BR_JTm:
-  case ARM::BR_JTadd:
-    return false;
-  }
-}
-
 bool ARMInstrInfo::PredicateInstruction(MachineInstr *MI,
                                 const std::vector<MachineOperand> &Pred) const {
   unsigned Opc = MI->getOpcode();


Index: llvm/lib/Target/ARM/ARMInstrInfo.h
diff -u llvm/lib/Target/ARM/ARMInstrInfo.h:1.14 llvm/lib/Target/ARM/ARMInstrInfo.h:1.15
--- llvm/lib/Target/ARM/ARMInstrInfo.h:1.14	Fri Jun 15 16:15:00 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.h	Mon Jun 18 20:25:30 2007
@@ -106,8 +106,6 @@
   // Predication support.
   virtual bool isPredicated(const MachineInstr *MI) const;
 
-  virtual bool CanBeDuplicated(const MachineInstr *MI) const;
-
   virtual
   bool PredicateInstruction(MachineInstr *MI,
                             const std::vector<MachineOperand> &Pred) const;


Index: llvm/lib/Target/ARM/ARMInstrInfo.td
diff -u llvm/lib/Target/ARM/ARMInstrInfo.td:1.110 llvm/lib/Target/ARM/ARMInstrInfo.td:1.111
--- llvm/lib/Target/ARM/ARMInstrInfo.td:1.110	Wed Jun  6 05:17:05 2007
+++ llvm/lib/Target/ARM/ARMInstrInfo.td	Mon Jun 18 20:25:30 2007
@@ -533,6 +533,7 @@
 /// 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
 /// size in bytes of this constant pool entry.
+let isNotDuplicable = 1 in
 def CONSTPOOL_ENTRY :
 PseudoInst<(ops cpinst_operand:$instid, cpinst_operand:$cpidx, i32imm:$size),
            "${instid:label} ${cpidx:cpentry}", []>;
@@ -552,6 +553,7 @@
            ".loc $file, $line, $col",
            [(dwarf_loc (i32 imm:$line), (i32 imm:$col), (i32 imm:$file))]>;
 
+let isNotDuplicable = 1 in {
 def PICADD : AXI1<(ops GPR:$dst, GPR:$a, pclabel:$cp, pred:$p),
                    "$cp:\n\tadd$p $dst, pc, $a",
                    [(set GPR:$dst, (ARMpic_add GPR:$a, imm:$cp))]>;
@@ -598,6 +600,7 @@
                "${addr:label}:\n\tstr${p}b $src, $addr",
                [(truncstorei8 GPR:$src, addrmodepc:$addr)]>;
 }
+}
 
 //===----------------------------------------------------------------------===//
 //  Control Flow Instructions.
@@ -637,6 +640,7 @@
     def B : AXI<(ops brtarget:$dst), "b $dst",
                 [(br bb:$dst)]>;
 
+  let isNotDuplicable = 1 in {
   def BR_JTr : JTI<(ops GPR:$dst, jtblock_operand:$jt, i32imm:$id),
                     "mov pc, $dst \n$jt",
                     [(ARMbrjt GPR:$dst, tjumptable:$jt, imm:$id)]>;
@@ -649,6 +653,7 @@
                        [(ARMbrjt (add GPR:$dst, GPR:$idx), tjumptable:$jt,
                          imm:$id)]>;
   }
+  }
 
   def Bcc : AXI<(ops brtarget:$dst, ccop:$cc), "b$cc $dst",
                  [(ARMbrcond bb:$dst, imm:$cc)]>;
@@ -1152,6 +1157,7 @@
                               !strconcat("${:private}PCRELL${:uid}:\n\t",
                                          "add$p $dst, pc, #PCRELV${:uid}")),
                    []>;
+
 //===----------------------------------------------------------------------===//
 // TLS Instructions
 //


Index: llvm/lib/Target/ARM/ARMInstrThumb.td
diff -u llvm/lib/Target/ARM/ARMInstrThumb.td:1.30 llvm/lib/Target/ARM/ARMInstrThumb.td:1.31
--- llvm/lib/Target/ARM/ARMInstrThumb.td:1.30	Fri Jun  8 04:13:23 2007
+++ llvm/lib/Target/ARM/ARMInstrThumb.td	Mon Jun 18 20:25:30 2007
@@ -170,6 +170,7 @@
            "@ tADJCALLSTACKDOWN $amt",
            [(ARMcallseq_start imm:$amt)]>, Imp<[SP],[SP]>, Requires<[IsThumb]>;
 
+let isNotDuplicable = 1 in
 def tPICADD : TIt<(ops GPR:$dst, GPR:$lhs, pclabel:$cp),
                   "$cp:\n\tadd $dst, pc",
                   [(set GPR:$dst, (ARMpic_add GPR:$lhs, imm:$cp))]>;






More information about the llvm-commits mailing list