Make sure MTSPR instruction is inserted into the BasicBlock
authorMisha Brukman <brukman+llvm@gmail.com>
Wed, 14 Jul 2004 18:26:31 +0000 (18:26 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Wed, 14 Jul 2004 18:26:31 +0000 (18:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14822 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPC32ISelSimple.cpp
lib/Target/PowerPC/PowerPCISelSimple.cpp

index c986ca4afd3ab12a48cd8928d84cd501ed65bfd7..10a19b55246c33605f283e3d1954486acc10e24c 100644 (file)
@@ -1437,7 +1437,7 @@ void ISel::visitCallInst(CallInst &CI) {
     TheCall = BuildMI(PPC32::CALLpcrel, 1).addGlobalAddress(F, true);
   } else {  // Emit an indirect call through the CTR
     unsigned Reg = getReg(CI.getCalledValue());
-    BuildMI(PPC32::MTSPR, 2).addZImm(9).addReg(Reg);
+    BuildMI(BB, PPC32::MTSPR, 2).addZImm(9).addReg(Reg);
     TheCall = BuildMI(PPC32::CALLindirect, 1).addZImm(20).addZImm(0);
   }
 
index c986ca4afd3ab12a48cd8928d84cd501ed65bfd7..10a19b55246c33605f283e3d1954486acc10e24c 100644 (file)
@@ -1437,7 +1437,7 @@ void ISel::visitCallInst(CallInst &CI) {
     TheCall = BuildMI(PPC32::CALLpcrel, 1).addGlobalAddress(F, true);
   } else {  // Emit an indirect call through the CTR
     unsigned Reg = getReg(CI.getCalledValue());
-    BuildMI(PPC32::MTSPR, 2).addZImm(9).addReg(Reg);
+    BuildMI(BB, PPC32::MTSPR, 2).addZImm(9).addReg(Reg);
     TheCall = BuildMI(PPC32::CALLindirect, 1).addZImm(20).addZImm(0);
   }