From: Misha Brukman Date: Wed, 14 Jul 2004 18:26:31 +0000 (+0000) Subject: Make sure MTSPR instruction is inserted into the BasicBlock X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5f8cce13486dd9c5e7374c5e467750298791bac8;p=oota-llvm.git Make sure MTSPR instruction is inserted into the BasicBlock git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14822 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/PowerPC/PPC32ISelSimple.cpp b/lib/Target/PowerPC/PPC32ISelSimple.cpp index c986ca4afd3..10a19b55246 100644 --- a/lib/Target/PowerPC/PPC32ISelSimple.cpp +++ b/lib/Target/PowerPC/PPC32ISelSimple.cpp @@ -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); } diff --git a/lib/Target/PowerPC/PowerPCISelSimple.cpp b/lib/Target/PowerPC/PowerPCISelSimple.cpp index c986ca4afd3..10a19b55246 100644 --- a/lib/Target/PowerPC/PowerPCISelSimple.cpp +++ b/lib/Target/PowerPC/PowerPCISelSimple.cpp @@ -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); }