Index: lib/Target/ARM/ARMFastISel.cpp |
diff --git a/lib/Target/ARM/ARMFastISel.cpp b/lib/Target/ARM/ARMFastISel.cpp |
index 29462f7a8eb82e3cfda50486b6c224ba35bf60a4..83130dd788fd3f40c16f709724c6bc8d5cff62ed 100644 |
--- a/lib/Target/ARM/ARMFastISel.cpp |
+++ b/lib/Target/ARM/ARMFastISel.cpp |
@@ -492,6 +492,11 @@ unsigned ARMFastISel::ARMMaterializeFP(const ConstantFP *CFP, MVT VT) { |
// Require VFP2 for loading fp constants. |
if (!Subtarget->hasVFP2()) return false; |
+ // @LOCALMOD-START |
+ if (!Subtarget->useConstIslands()) |
+ return false; |
+ // @LOCALMOD-END |
+ |
// MachineConstantPool wants an explicit alignment. |
unsigned Align = DL.getPrefTypeAlignment(CFP->getType()); |
if (Align == 0) { |
@@ -553,6 +558,12 @@ unsigned ARMFastISel::ARMMaterializeInt(const Constant *C, MVT VT) { |
if (ResultReg) |
return ResultReg; |
+ // @LOCALMOD-START -- Can this just be an assert? (useMovt should be true |
+ // so the above code would have handled the constant). |
+ if (!Subtarget->useConstIslands()) |
+ return false; |
+ // @LOCALMOD-END |
+ |
// Load from constant pool. For now 32-bit only. |
if (VT != MVT::i32) |
return 0; |
@@ -615,6 +626,11 @@ unsigned ARMFastISel::ARMMaterializeGV(const GlobalValue *GV, MVT VT) { |
AddOptionalDefs(BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, |
TII.get(Opc), DestReg).addGlobalAddress(GV, 0, TF)); |
} else { |
+ // @LOCALMOD-BEGIN |
+ if (!Subtarget->useConstIslands()) |
+ return false; |
+ // @LOCALMOD-END |
+ |
// MachineConstantPool wants an explicit alignment. |
unsigned Align = DL.getPrefTypeAlignment(GV->getType()); |
if (Align == 0) { |