blob: 0f06b54e976d2d15063cee29fefd1769cf8f9dca [file] [log] [blame]
Quentin Colombet105cf2b2016-01-20 20:58:56 +00001//===-- llvm/CodeGen/GlobalISel/IRTranslator.cpp - IRTranslator --*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9/// \file
10/// This file implements the IRTranslator class.
11//===----------------------------------------------------------------------===//
12
13#include "llvm/CodeGen/GlobalISel/IRTranslator.h"
14
Quentin Colombetfd9d0a02016-02-11 19:59:41 +000015#include "llvm/ADT/SmallVector.h"
Quentin Colombetba2a0162016-02-16 19:26:02 +000016#include "llvm/CodeGen/GlobalISel/CallLowering.h"
Quentin Colombet2ecff3b2016-02-10 22:59:27 +000017#include "llvm/CodeGen/MachineFunction.h"
Tim Northoverbd505462016-07-22 16:59:52 +000018#include "llvm/CodeGen/MachineFrameInfo.h"
Quentin Colombet17c494b2016-02-11 17:51:31 +000019#include "llvm/CodeGen/MachineRegisterInfo.h"
20#include "llvm/IR/Constant.h"
Quentin Colombet2ecff3b2016-02-10 22:59:27 +000021#include "llvm/IR/Function.h"
Tim Northover5fb414d2016-07-29 22:32:36 +000022#include "llvm/IR/IntrinsicInst.h"
Quentin Colombet17c494b2016-02-11 17:51:31 +000023#include "llvm/IR/Type.h"
24#include "llvm/IR/Value.h"
Tim Northover5fb414d2016-07-29 22:32:36 +000025#include "llvm/Target/TargetIntrinsicInfo.h"
Quentin Colombet74d7d2f2016-02-11 18:53:28 +000026#include "llvm/Target/TargetLowering.h"
Quentin Colombet2ecff3b2016-02-10 22:59:27 +000027
28#define DEBUG_TYPE "irtranslator"
29
Quentin Colombet105cf2b2016-01-20 20:58:56 +000030using namespace llvm;
31
32char IRTranslator::ID = 0;
Quentin Colombet39293d32016-03-08 01:38:55 +000033INITIALIZE_PASS(IRTranslator, "irtranslator", "IRTranslator LLVM IR -> MI",
Tim Northover884b47e2016-07-26 03:29:18 +000034 false, false)
Quentin Colombet105cf2b2016-01-20 20:58:56 +000035
Quentin Colombeta7fae162016-02-11 17:53:23 +000036IRTranslator::IRTranslator() : MachineFunctionPass(ID), MRI(nullptr) {
Quentin Colombet39293d32016-03-08 01:38:55 +000037 initializeIRTranslatorPass(*PassRegistry::getPassRegistry());
Quentin Colombeta7fae162016-02-11 17:53:23 +000038}
39
Quentin Colombete225e252016-03-11 17:27:54 +000040unsigned IRTranslator::getOrCreateVReg(const Value &Val) {
41 unsigned &ValReg = ValToVReg[&Val];
Quentin Colombet17c494b2016-02-11 17:51:31 +000042 // Check if this is the first time we see Val.
Quentin Colombetccd77252016-02-11 21:48:32 +000043 if (!ValReg) {
Quentin Colombet17c494b2016-02-11 17:51:31 +000044 // Fill ValRegsSequence with the sequence of registers
45 // we need to concat together to produce the value.
Quentin Colombete225e252016-03-11 17:27:54 +000046 assert(Val.getType()->isSized() &&
Quentin Colombet17c494b2016-02-11 17:51:31 +000047 "Don't know how to create an empty vreg");
Quentin Colombete225e252016-03-11 17:27:54 +000048 assert(!Val.getType()->isAggregateType() && "Not yet implemented");
Tim Northoverbd505462016-07-22 16:59:52 +000049 unsigned Size = DL->getTypeSizeInBits(Val.getType());
Quentin Colombet17c494b2016-02-11 17:51:31 +000050 unsigned VReg = MRI->createGenericVirtualRegister(Size);
Quentin Colombetccd77252016-02-11 21:48:32 +000051 ValReg = VReg;
Tim Northover5ed648e2016-08-09 21:28:04 +000052
53 if (auto CV = dyn_cast<Constant>(&Val)) {
54 bool Success = translate(*CV, VReg);
55 if (!Success)
56 report_fatal_error("unable to translate constant");
57 }
Quentin Colombet17c494b2016-02-11 17:51:31 +000058 }
Quentin Colombetccd77252016-02-11 21:48:32 +000059 return ValReg;
Quentin Colombet17c494b2016-02-11 17:51:31 +000060}
61
Tim Northoverad2b7172016-07-26 20:23:26 +000062unsigned IRTranslator::getMemOpAlignment(const Instruction &I) {
63 unsigned Alignment = 0;
64 Type *ValTy = nullptr;
65 if (const StoreInst *SI = dyn_cast<StoreInst>(&I)) {
66 Alignment = SI->getAlignment();
67 ValTy = SI->getValueOperand()->getType();
68 } else if (const LoadInst *LI = dyn_cast<LoadInst>(&I)) {
69 Alignment = LI->getAlignment();
70 ValTy = LI->getType();
71 } else
72 llvm_unreachable("unhandled memory instruction");
73
74 return Alignment ? Alignment : DL->getABITypeAlignment(ValTy);
75}
76
Quentin Colombet53237a92016-03-11 17:27:43 +000077MachineBasicBlock &IRTranslator::getOrCreateBB(const BasicBlock &BB) {
78 MachineBasicBlock *&MBB = BBToMBB[&BB];
Quentin Colombet17c494b2016-02-11 17:51:31 +000079 if (!MBB) {
Quentin Colombeta7fae162016-02-11 17:53:23 +000080 MachineFunction &MF = MIRBuilder.getMF();
Quentin Colombet17c494b2016-02-11 17:51:31 +000081 MBB = MF.CreateMachineBasicBlock();
82 MF.push_back(MBB);
83 }
84 return *MBB;
85}
86
Tim Northover357f1be2016-08-10 23:02:41 +000087bool IRTranslator::translateBinaryOp(unsigned Opcode, const User &U) {
Tim Northover0d56e052016-07-29 18:11:21 +000088 // FIXME: handle signed/unsigned wrapping flags.
89
Quentin Colombet2ecff3b2016-02-10 22:59:27 +000090 // Get or create a virtual register for each value.
91 // Unless the value is a Constant => loadimm cst?
92 // or inline constant each time?
93 // Creation of a virtual register needs to have a size.
Tim Northover357f1be2016-08-10 23:02:41 +000094 unsigned Op0 = getOrCreateVReg(*U.getOperand(0));
95 unsigned Op1 = getOrCreateVReg(*U.getOperand(1));
96 unsigned Res = getOrCreateVReg(U);
97 MIRBuilder.buildInstr(Opcode, LLT{*U.getType()})
Tim Northovera51575f2016-07-29 17:43:52 +000098 .addDef(Res)
99 .addUse(Op0)
100 .addUse(Op1);
Quentin Colombet17c494b2016-02-11 17:51:31 +0000101 return true;
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000102}
103
Tim Northover357f1be2016-08-10 23:02:41 +0000104bool IRTranslator::translateRet(const User &U) {
105 const ReturnInst &RI = cast<ReturnInst>(U);
Tim Northover0d56e052016-07-29 18:11:21 +0000106 const Value *Ret = RI.getReturnValue();
Quentin Colombet74d7d2f2016-02-11 18:53:28 +0000107 // The target may mess up with the insertion point, but
108 // this is not important as a return is the last instruction
109 // of the block anyway.
Tom Stellardb72a65f2016-04-14 17:23:33 +0000110 return CLI->lowerReturn(MIRBuilder, Ret, !Ret ? 0 : getOrCreateVReg(*Ret));
Quentin Colombet74d7d2f2016-02-11 18:53:28 +0000111}
112
Tim Northover357f1be2016-08-10 23:02:41 +0000113bool IRTranslator::translateBr(const User &U) {
114 const BranchInst &BrInst = cast<BranchInst>(U);
Tim Northover69c2ba52016-07-29 17:58:00 +0000115 unsigned Succ = 0;
116 if (!BrInst.isUnconditional()) {
117 // We want a G_BRCOND to the true BB followed by an unconditional branch.
118 unsigned Tst = getOrCreateVReg(*BrInst.getCondition());
119 const BasicBlock &TrueTgt = *cast<BasicBlock>(BrInst.getSuccessor(Succ++));
120 MachineBasicBlock &TrueBB = getOrCreateBB(TrueTgt);
121 MIRBuilder.buildBrCond(LLT{*BrInst.getCondition()->getType()}, Tst, TrueBB);
Quentin Colombetdd4b1372016-03-11 17:28:03 +0000122 }
Tim Northover69c2ba52016-07-29 17:58:00 +0000123
124 const BasicBlock &BrTgt = *cast<BasicBlock>(BrInst.getSuccessor(Succ));
125 MachineBasicBlock &TgtBB = getOrCreateBB(BrTgt);
126 MIRBuilder.buildBr(TgtBB);
127
Quentin Colombetdd4b1372016-03-11 17:28:03 +0000128 // Link successors.
129 MachineBasicBlock &CurBB = MIRBuilder.getMBB();
130 for (const BasicBlock *Succ : BrInst.successors())
131 CurBB.addSuccessor(&getOrCreateBB(*Succ));
132 return true;
133}
134
Tim Northover357f1be2016-08-10 23:02:41 +0000135bool IRTranslator::translateLoad(const User &U) {
136 const LoadInst &LI = cast<LoadInst>(U);
Tim Northoverad2b7172016-07-26 20:23:26 +0000137 assert(LI.isSimple() && "only simple loads are supported at the moment");
138
139 MachineFunction &MF = MIRBuilder.getMF();
140 unsigned Res = getOrCreateVReg(LI);
141 unsigned Addr = getOrCreateVReg(*LI.getPointerOperand());
142 LLT VTy{*LI.getType()}, PTy{*LI.getPointerOperand()->getType()};
143
144 MIRBuilder.buildLoad(
145 VTy, PTy, Res, Addr,
146 *MF.getMachineMemOperand(MachinePointerInfo(LI.getPointerOperand()),
147 MachineMemOperand::MOLoad,
148 VTy.getSizeInBits() / 8, getMemOpAlignment(LI)));
149 return true;
150}
151
Tim Northover357f1be2016-08-10 23:02:41 +0000152bool IRTranslator::translateStore(const User &U) {
153 const StoreInst &SI = cast<StoreInst>(U);
Tim Northoverad2b7172016-07-26 20:23:26 +0000154 assert(SI.isSimple() && "only simple loads are supported at the moment");
155
156 MachineFunction &MF = MIRBuilder.getMF();
157 unsigned Val = getOrCreateVReg(*SI.getValueOperand());
158 unsigned Addr = getOrCreateVReg(*SI.getPointerOperand());
159 LLT VTy{*SI.getValueOperand()->getType()},
160 PTy{*SI.getPointerOperand()->getType()};
161
162 MIRBuilder.buildStore(
163 VTy, PTy, Val, Addr,
164 *MF.getMachineMemOperand(MachinePointerInfo(SI.getPointerOperand()),
165 MachineMemOperand::MOStore,
166 VTy.getSizeInBits() / 8, getMemOpAlignment(SI)));
167 return true;
168}
169
Tim Northover357f1be2016-08-10 23:02:41 +0000170bool IRTranslator::translateBitCast(const User &U) {
171 if (LLT{*U.getOperand(0)->getType()} == LLT{*U.getType()}) {
172 unsigned &Reg = ValToVReg[&U];
Tim Northover7552ef52016-08-10 16:51:14 +0000173 if (Reg)
Tim Northover357f1be2016-08-10 23:02:41 +0000174 MIRBuilder.buildCopy(Reg, getOrCreateVReg(*U.getOperand(0)));
Tim Northover7552ef52016-08-10 16:51:14 +0000175 else
Tim Northover357f1be2016-08-10 23:02:41 +0000176 Reg = getOrCreateVReg(*U.getOperand(0));
Tim Northover7c9eba92016-07-25 21:01:29 +0000177 return true;
178 }
Tim Northover357f1be2016-08-10 23:02:41 +0000179 return translateCast(TargetOpcode::G_BITCAST, U);
Tim Northover7c9eba92016-07-25 21:01:29 +0000180}
181
Tim Northover357f1be2016-08-10 23:02:41 +0000182bool IRTranslator::translateCast(unsigned Opcode, const User &U) {
183 unsigned Op = getOrCreateVReg(*U.getOperand(0));
184 unsigned Res = getOrCreateVReg(U);
185 MIRBuilder
186 .buildInstr(Opcode, {LLT{*U.getType()}, LLT{*U.getOperand(0)->getType()}})
Tim Northovera51575f2016-07-29 17:43:52 +0000187 .addDef(Res)
188 .addUse(Op);
Tim Northover7c9eba92016-07-25 21:01:29 +0000189 return true;
190}
191
Tim Northover357f1be2016-08-10 23:02:41 +0000192bool IRTranslator::translateCall(const User &U) {
193 const CallInst &CI = cast<CallInst>(U);
Tim Northover5fb414d2016-07-29 22:32:36 +0000194 auto TII = MIRBuilder.getMF().getTarget().getIntrinsicInfo();
Tim Northover406024a2016-08-10 21:44:01 +0000195 const Function *F = CI.getCalledFunction();
Tim Northover5fb414d2016-07-29 22:32:36 +0000196
Tim Northover406024a2016-08-10 21:44:01 +0000197 if (!F || !F->isIntrinsic()) {
198 // FIXME: handle multiple return values.
199 unsigned Res = CI.getType()->isVoidTy() ? 0 : getOrCreateVReg(CI);
200 SmallVector<unsigned, 8> Args;
201 for (auto &Arg: CI.arg_operands())
202 Args.push_back(getOrCreateVReg(*Arg));
203
204 return CLI->lowerCall(MIRBuilder, CI,
205 F ? 0 : getOrCreateVReg(*CI.getCalledValue()), Res,
206 Args);
207 }
208
209 Intrinsic::ID ID = F->getIntrinsicID();
210 if (TII && ID == Intrinsic::not_intrinsic)
211 ID = static_cast<Intrinsic::ID>(TII->getIntrinsicID(F));
212
213 assert(ID != Intrinsic::not_intrinsic && "unknown intrinsic");
Tim Northover5fb414d2016-07-29 22:32:36 +0000214
215 // Need types (starting with return) & args.
216 SmallVector<LLT, 4> Tys;
217 Tys.emplace_back(*CI.getType());
218 for (auto &Arg : CI.arg_operands())
219 Tys.emplace_back(*Arg->getType());
220
221 unsigned Res = CI.getType()->isVoidTy() ? 0 : getOrCreateVReg(CI);
222 MachineInstrBuilder MIB =
223 MIRBuilder.buildIntrinsic(Tys, ID, Res, !CI.doesNotAccessMemory());
224
225 for (auto &Arg : CI.arg_operands()) {
226 if (ConstantInt *CI = dyn_cast<ConstantInt>(Arg))
227 MIB.addImm(CI->getSExtValue());
228 else
229 MIB.addUse(getOrCreateVReg(*Arg));
230 }
231 return true;
232}
233
Tim Northoverbd505462016-07-22 16:59:52 +0000234bool IRTranslator::translateStaticAlloca(const AllocaInst &AI) {
235 assert(AI.isStaticAlloca() && "only handle static allocas now");
236 MachineFunction &MF = MIRBuilder.getMF();
237 unsigned ElementSize = DL->getTypeStoreSize(AI.getAllocatedType());
238 unsigned Size =
239 ElementSize * cast<ConstantInt>(AI.getArraySize())->getZExtValue();
240
Tim Northover8d2f52e2016-07-27 17:47:54 +0000241 // Always allocate at least one byte.
242 Size = std::max(Size, 1u);
243
Tim Northoverbd505462016-07-22 16:59:52 +0000244 unsigned Alignment = AI.getAlignment();
245 if (!Alignment)
246 Alignment = DL->getABITypeAlignment(AI.getAllocatedType());
247
248 unsigned Res = getOrCreateVReg(AI);
Matthias Braun93320392016-07-28 20:13:42 +0000249 int FI = MF.getFrameInfo().CreateStackObject(Size, Alignment, false, &AI);
Tim Northoverbd505462016-07-22 16:59:52 +0000250 MIRBuilder.buildFrameIndex(LLT::pointer(0), Res, FI);
251 return true;
252}
253
Tim Northover357f1be2016-08-10 23:02:41 +0000254bool IRTranslator::translatePHI(const User &U) {
255 const PHINode &PI = cast<PHINode>(U);
Tim Northover97d0cb32016-08-05 17:16:40 +0000256 MachineInstrBuilder MIB = MIRBuilder.buildInstr(TargetOpcode::PHI);
257 MIB.addDef(getOrCreateVReg(PI));
258
259 PendingPHIs.emplace_back(&PI, MIB.getInstr());
260 return true;
261}
262
263void IRTranslator::finishPendingPhis() {
264 for (std::pair<const PHINode *, MachineInstr *> &Phi : PendingPHIs) {
265 const PHINode *PI = Phi.first;
266 MachineInstrBuilder MIB(MIRBuilder.getMF(), Phi.second);
267
268 // All MachineBasicBlocks exist, add them to the PHI. We assume IRTranslator
269 // won't create extra control flow here, otherwise we need to find the
270 // dominating predecessor here (or perhaps force the weirder IRTranslators
271 // to provide a simple boundary).
272 for (unsigned i = 0; i < PI->getNumIncomingValues(); ++i) {
273 assert(BBToMBB[PI->getIncomingBlock(i)]->isSuccessor(MIB->getParent()) &&
274 "I appear to have misunderstood Machine PHIs");
275 MIB.addUse(getOrCreateVReg(*PI->getIncomingValue(i)));
276 MIB.addMBB(BBToMBB[PI->getIncomingBlock(i)]);
277 }
278 }
Tim Northover14e7f732016-08-05 17:50:36 +0000279
280 PendingPHIs.clear();
Tim Northover97d0cb32016-08-05 17:16:40 +0000281}
282
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000283bool IRTranslator::translate(const Instruction &Inst) {
Quentin Colombeta7fae162016-02-11 17:53:23 +0000284 MIRBuilder.setDebugLoc(Inst.getDebugLoc());
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000285 switch(Inst.getOpcode()) {
Tim Northover357f1be2016-08-10 23:02:41 +0000286#define HANDLE_INST(NUM, OPCODE, CLASS) \
287 case Instruction::OPCODE: return translate##OPCODE(Inst);
288#include "llvm/IR/Instruction.def"
Quentin Colombet74d7d2f2016-02-11 18:53:28 +0000289 default:
Tim Northover357f1be2016-08-10 23:02:41 +0000290 llvm_unreachable("unknown opcode");
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000291 }
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000292}
293
Tim Northover5ed648e2016-08-09 21:28:04 +0000294bool IRTranslator::translate(const Constant &C, unsigned Reg) {
Tim Northoverd403a3d2016-08-09 23:01:30 +0000295 if (auto CI = dyn_cast<ConstantInt>(&C))
Tim Northover5ed648e2016-08-09 21:28:04 +0000296 EntryBuilder.buildConstant(LLT{*CI->getType()}, Reg, CI->getZExtValue());
Tim Northoverd403a3d2016-08-09 23:01:30 +0000297 else if (isa<UndefValue>(C))
298 EntryBuilder.buildInstr(TargetOpcode::IMPLICIT_DEF).addDef(Reg);
Tim Northover357f1be2016-08-10 23:02:41 +0000299 else if (auto CE = dyn_cast<ConstantExpr>(&C)) {
300 switch(CE->getOpcode()) {
301#define HANDLE_INST(NUM, OPCODE, CLASS) \
302 case Instruction::OPCODE: return translate##OPCODE(*CE);
303#include "llvm/IR/Instruction.def"
304 default:
305 llvm_unreachable("unknown opcode");
306 }
307 } else
Tim Northoverd403a3d2016-08-09 23:01:30 +0000308 llvm_unreachable("unhandled constant kind");
Tim Northover5ed648e2016-08-09 21:28:04 +0000309
Tim Northoverd403a3d2016-08-09 23:01:30 +0000310 return true;
Tim Northover5ed648e2016-08-09 21:28:04 +0000311}
312
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000313
314void IRTranslator::finalize() {
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000315 // Release the memory used by the different maps we
316 // needed during the translation.
Quentin Colombetccd77252016-02-11 21:48:32 +0000317 ValToVReg.clear();
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000318 Constants.clear();
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000319}
320
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000321bool IRTranslator::runOnMachineFunction(MachineFunction &MF) {
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000322 const Function &F = *MF.getFunction();
Quentin Colombetfd9d0a02016-02-11 19:59:41 +0000323 if (F.empty())
324 return false;
Quentin Colombetba2a0162016-02-16 19:26:02 +0000325 CLI = MF.getSubtarget().getCallLowering();
Quentin Colombet000b5802016-03-11 17:27:51 +0000326 MIRBuilder.setMF(MF);
Tim Northover5ed648e2016-08-09 21:28:04 +0000327 EntryBuilder.setMF(MF);
Quentin Colombet17c494b2016-02-11 17:51:31 +0000328 MRI = &MF.getRegInfo();
Tim Northoverbd505462016-07-22 16:59:52 +0000329 DL = &F.getParent()->getDataLayout();
330
Tim Northover14e7f732016-08-05 17:50:36 +0000331 assert(PendingPHIs.empty() && "stale PHIs");
332
Quentin Colombetfd9d0a02016-02-11 19:59:41 +0000333 // Setup the arguments.
Quentin Colombet53237a92016-03-11 17:27:43 +0000334 MachineBasicBlock &MBB = getOrCreateBB(F.front());
Quentin Colombet91ebd712016-03-11 17:27:47 +0000335 MIRBuilder.setMBB(MBB);
Quentin Colombetfd9d0a02016-02-11 19:59:41 +0000336 SmallVector<unsigned, 8> VRegArgs;
337 for (const Argument &Arg: F.args())
Quentin Colombete225e252016-03-11 17:27:54 +0000338 VRegArgs.push_back(getOrCreateVReg(Arg));
Quentin Colombetba2a0162016-02-16 19:26:02 +0000339 bool Succeeded =
Tom Stellardb72a65f2016-04-14 17:23:33 +0000340 CLI->lowerFormalArguments(MIRBuilder, F.getArgumentList(), VRegArgs);
Quentin Colombetfd9d0a02016-02-11 19:59:41 +0000341 if (!Succeeded)
342 report_fatal_error("Unable to lower arguments");
343
Tim Northover5ed648e2016-08-09 21:28:04 +0000344 // Now that we've got the ABI handling code, it's safe to set a location for
345 // any Constants we find in the IR.
346 if (MBB.empty())
347 EntryBuilder.setMBB(MBB);
348 else
349 EntryBuilder.setInstr(MBB.back(), /* Before */ false);
350
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000351 for (const BasicBlock &BB: F) {
Quentin Colombet53237a92016-03-11 17:27:43 +0000352 MachineBasicBlock &MBB = getOrCreateBB(BB);
Quentin Colombet91ebd712016-03-11 17:27:47 +0000353 // Set the insertion point of all the following translations to
354 // the end of this basic block.
355 MIRBuilder.setMBB(MBB);
Quentin Colombet2ecff3b2016-02-10 22:59:27 +0000356 for (const Instruction &Inst: BB) {
357 bool Succeeded = translate(Inst);
358 if (!Succeeded) {
359 DEBUG(dbgs() << "Cannot translate: " << Inst << '\n');
360 report_fatal_error("Unable to translate instruction");
361 }
362 }
363 }
Tim Northover72eebfa2016-07-12 22:23:42 +0000364
Tim Northover97d0cb32016-08-05 17:16:40 +0000365 finishPendingPhis();
366
Tim Northover72eebfa2016-07-12 22:23:42 +0000367 // Now that the MachineFrameInfo has been configured, no further changes to
368 // the reserved registers are possible.
369 MRI->freezeReservedRegs(MF);
370
Quentin Colombet105cf2b2016-01-20 20:58:56 +0000371 return false;
372}