Revert both r121082 (which broke a bunch of constant pool stuff) and r125074 (which...
[oota-llvm.git] / lib / Target / ARM / ARMConstantIslandPass.cpp
index 84499b118ebabc1069c8fdc1570728c0de054ac5..934daba552308793c301f4754a00bc81e6638ae0 100644 (file)
@@ -368,6 +368,14 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &MF) {
   if (isThumb && !HasFarJump && AFI->isLRSpilledForFarJump())
     MadeChange |= UndoLRSpillRestore();
 
+  // Save the mapping between original and cloned constpool entries.
+  for (unsigned i = 0, e = CPEntries.size(); i != e; ++i) {
+    for (unsigned j = 0, je = CPEntries[i].size(); j != je; ++j) {
+      const CPEntry & CPE = CPEntries[i][j];
+      AFI->recordCPEClone(i, CPE.CPI);
+    }
+  }
+
   DEBUG(errs() << '\n'; dumpBBs());
 
   BBSizes.clear();
@@ -605,11 +613,7 @@ void ARMConstantIslands::InitialFunctionScan(MachineFunction &MF,
 
           case ARM::LDRi12:
           case ARM::LDRcp:
-          case ARM::t2LDRi12:
-          case ARM::t2LDRHi12:
-          case ARM::t2LDRBi12:
-          case ARM::t2LDRSHi12:
-          case ARM::t2LDRSBi12:
+          case ARM::t2LDRpci:
             Bits = 12;  // +-offset_12
             NegOk = true;
             break;