Need to scan the function for branches even if there aren't any constants.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 26 Jan 2007 01:04:44 +0000 (01:04 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 26 Jan 2007 01:04:44 +0000 (01:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33515 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index db30428d96ec2400bf521231c302289c22f96c94..62e47172e26121d7362717d0f6e40b81ee61706c 100644 (file)
@@ -122,9 +122,7 @@ FunctionPass *llvm::createARMConstantIslandPass() {
 }
 
 bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) {
-  // If there are no constants, there is nothing to do.
   MachineConstantPool &MCP = *Fn.getConstantPool();
-  if (MCP.isEmpty()) return false;
   
   TII = Fn.getTarget().getInstrInfo();
   TAI = Fn.getTarget().getTargetAsmInfo();
@@ -136,7 +134,8 @@ bool ARMConstantIslands::runOnMachineFunction(MachineFunction &Fn) {
   // Perform the initial placement of the constant pool entries.  To start with,
   // we put them all at the end of the function.
   std::vector<MachineInstr*> CPEMIs;
-  DoInitialPlacement(Fn, CPEMIs);
+  if (!MCP.isEmpty())
+    DoInitialPlacement(Fn, CPEMIs);
   
   /// The next UID to take is the first unused one.
   NextUID = CPEMIs.size();