blob: 2f0f4297ef5c5c5b2ba3498e37be8705fa2e14d8 [file] [log] [blame]
Jim Laskey5a1df972007-01-26 21:38:26 +00001//===-- llvm/CodeGen/MachineModuleInfo.cpp ----------------------*- C++ -*-===//
Jim Laskey44317392006-01-04 13:36:38 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey44317392006-01-04 13:36:38 +00007//
8//===----------------------------------------------------------------------===//
Jim Laskey44317392006-01-04 13:36:38 +00009
Jim Laskey5a1df972007-01-26 21:38:26 +000010#include "llvm/CodeGen/MachineModuleInfo.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000011#include "llvm/ADT/PointerUnion.h"
Ahmed Bougacha456dce82016-11-16 22:24:56 +000012#include "llvm/ADT/PostOrderIterator.h"
Reid Klecknerc20276d2015-11-17 21:10:25 +000013#include "llvm/ADT/TinyPtrVector.h"
David Majnemer70497c62015-12-02 23:06:39 +000014#include "llvm/Analysis/EHPersonalities.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000015#include "llvm/Analysis/ValueTracking.h"
16#include "llvm/CodeGen/MachineFunction.h"
Matthias Braun733fe362016-08-24 01:52:46 +000017#include "llvm/CodeGen/MachineFunctionInitializer.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000018#include "llvm/CodeGen/MachineFunctionPass.h"
19#include "llvm/CodeGen/Passes.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000020#include "llvm/IR/Constants.h"
21#include "llvm/IR/DerivedTypes.h"
22#include "llvm/IR/GlobalVariable.h"
Ahmed Bougacha456dce82016-11-16 22:24:56 +000023#include "llvm/IR/Instructions.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000024#include "llvm/IR/Module.h"
Evan Cheng76792992011-07-20 05:58:47 +000025#include "llvm/MC/MCObjectFileInfo.h"
Chris Lattner34adc8d2010-03-14 01:41:15 +000026#include "llvm/MC/MCSymbol.h"
Jim Laskey0bbdc552006-01-26 20:21:46 +000027#include "llvm/Support/Dwarf.h"
Torok Edwin56d06592009-07-11 20:10:48 +000028#include "llvm/Support/ErrorHandling.h"
Matthias Braunc3b2e802016-08-24 00:42:05 +000029#include "llvm/Target/TargetLoweringObjectFile.h"
30#include "llvm/Target/TargetMachine.h"
Jim Laskey44317392006-01-04 13:36:38 +000031using namespace llvm;
Jim Laskey4e71db12006-03-01 20:39:36 +000032using namespace llvm::dwarf;
Jim Laskey44317392006-01-04 13:36:38 +000033
Micah Villmowcdfe20b2012-10-08 16:38:25 +000034// Handle the Pass registration stuff necessary to use DataLayout's.
Matthias Braunc3b2e802016-08-24 00:42:05 +000035INITIALIZE_TM_PASS(MachineModuleInfo, "machinemoduleinfo",
36 "Machine Module Information", false, false)
Devang Patel8c78a0b2007-05-03 01:11:54 +000037char MachineModuleInfo::ID = 0;
Jim Laskeyb9966022006-01-17 17:31:53 +000038
Chris Lattnerf2471ec2009-09-15 22:44:26 +000039// Out of line virtual method.
40MachineModuleInfoImpl::~MachineModuleInfoImpl() {}
41
Chris Lattner347a0eb2010-03-15 19:09:43 +000042namespace llvm {
David Blaikie774b5842015-08-03 22:30:24 +000043class MMIAddrLabelMapCallbackPtr final : CallbackVH {
Chris Lattner347a0eb2010-03-15 19:09:43 +000044 MMIAddrLabelMap *Map;
45public:
Craig Topperc0196b12014-04-14 00:51:57 +000046 MMIAddrLabelMapCallbackPtr() : Map(nullptr) {}
47 MMIAddrLabelMapCallbackPtr(Value *V) : CallbackVH(V), Map(nullptr) {}
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000048
Chris Lattnerb1c4f622010-03-22 23:15:57 +000049 void setPtr(BasicBlock *BB) {
50 ValueHandleBase::operator=(BB);
51 }
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000052
Chris Lattner347a0eb2010-03-15 19:09:43 +000053 void setMap(MMIAddrLabelMap *map) { Map = map; }
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000054
Craig Topper4584cd52014-03-07 09:26:03 +000055 void deleted() override;
56 void allUsesReplacedWith(Value *V2) override;
Chris Lattner347a0eb2010-03-15 19:09:43 +000057};
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000058
Chris Lattner347a0eb2010-03-15 19:09:43 +000059class MMIAddrLabelMap {
60 MCContext &Context;
61 struct AddrLabelSymEntry {
Ahmed Bougacha2b4c1272016-11-16 22:24:53 +000062 /// The symbols for the label.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +000063 TinyPtrVector<MCSymbol *> Symbols;
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000064
Chris Lattner561334a2010-03-15 20:39:00 +000065 Function *Fn; // The containing function of the BasicBlock.
66 unsigned Index; // The index in BBCallbacks for the BasicBlock.
Chris Lattner347a0eb2010-03-15 19:09:43 +000067 };
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000068
Chris Lattner347a0eb2010-03-15 19:09:43 +000069 DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry> AddrLabelSymbols;
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000070
Ahmed Bougacha2b4c1272016-11-16 22:24:53 +000071 /// Callbacks for the BasicBlock's that we have entries for. We use this so
72 /// we get notified if a block is deleted or RAUWd.
Chris Lattner347a0eb2010-03-15 19:09:43 +000073 std::vector<MMIAddrLabelMapCallbackPtr> BBCallbacks;
Chris Lattner561334a2010-03-15 20:39:00 +000074
Ahmed Bougacha2b4c1272016-11-16 22:24:53 +000075 /// This is a per-function list of symbols whose corresponding BasicBlock got
76 /// deleted. These symbols need to be emitted at some point in the file, so
77 /// AsmPrinter emits them after the function body.
Chris Lattner561334a2010-03-15 20:39:00 +000078 DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> >
79 DeletedAddrLabelsNeedingEmission;
Chris Lattner347a0eb2010-03-15 19:09:43 +000080public:
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000081
Chris Lattner347a0eb2010-03-15 19:09:43 +000082 MMIAddrLabelMap(MCContext &context) : Context(context) {}
Chris Lattner561334a2010-03-15 20:39:00 +000083 ~MMIAddrLabelMap() {
84 assert(DeletedAddrLabelsNeedingEmission.empty() &&
85 "Some labels for deleted blocks never got emitted");
86 }
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000087
Benjamin Kramer6fe4e792015-06-29 20:21:55 +000088 ArrayRef<MCSymbol *> getAddrLabelSymbolToEmit(BasicBlock *BB);
Chris Lattnerdb035a02010-03-16 00:29:39 +000089
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +000090 void takeDeletedSymbolsForFunction(Function *F,
Chris Lattner561334a2010-03-15 20:39:00 +000091 std::vector<MCSymbol*> &Result);
92
Chris Lattner347a0eb2010-03-15 19:09:43 +000093 void UpdateForDeletedBlock(BasicBlock *BB);
94 void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New);
95};
Alexander Kornienkof00654e2015-06-23 09:49:53 +000096}
Chris Lattner347a0eb2010-03-15 19:09:43 +000097
Benjamin Kramer6fe4e792015-06-29 20:21:55 +000098ArrayRef<MCSymbol *> MMIAddrLabelMap::getAddrLabelSymbolToEmit(BasicBlock *BB) {
Chris Lattner347a0eb2010-03-15 19:09:43 +000099 assert(BB->hasAddressTaken() &&
100 "Shouldn't get label for block without address taken");
101 AddrLabelSymEntry &Entry = AddrLabelSymbols[BB];
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +0000102
Chris Lattner347a0eb2010-03-15 19:09:43 +0000103 // If we already had an entry for this block, just return it.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000104 if (!Entry.Symbols.empty()) {
Chris Lattner561334a2010-03-15 20:39:00 +0000105 assert(BB->getParent() == Entry.Fn && "Parent changed");
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000106 return Entry.Symbols;
Chris Lattner561334a2010-03-15 20:39:00 +0000107 }
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +0000108
Chris Lattner347a0eb2010-03-15 19:09:43 +0000109 // Otherwise, this is a new entry, create a new symbol for it and add an
110 // entry to BBCallbacks so we can be notified if the BB is deleted or RAUWd.
Benjamin Kramerf5e2fc42015-05-29 19:43:39 +0000111 BBCallbacks.emplace_back(BB);
Chris Lattner347a0eb2010-03-15 19:09:43 +0000112 BBCallbacks.back().setMap(this);
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000113 Entry.Index = BBCallbacks.size() - 1;
Chris Lattner561334a2010-03-15 20:39:00 +0000114 Entry.Fn = BB->getParent();
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000115 Entry.Symbols.push_back(Context.createTempSymbol());
116 return Entry.Symbols;
Chris Lattner347a0eb2010-03-15 19:09:43 +0000117}
118
Ahmed Bougacha2b4c1272016-11-16 22:24:53 +0000119/// If we have any deleted symbols for F, return them.
Chris Lattner561334a2010-03-15 20:39:00 +0000120void MMIAddrLabelMap::
121takeDeletedSymbolsForFunction(Function *F, std::vector<MCSymbol*> &Result) {
122 DenseMap<AssertingVH<Function>, std::vector<MCSymbol*> >::iterator I =
123 DeletedAddrLabelsNeedingEmission.find(F);
124
125 // If there are no entries for the function, just return.
126 if (I == DeletedAddrLabelsNeedingEmission.end()) return;
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +0000127
Chris Lattner561334a2010-03-15 20:39:00 +0000128 // Otherwise, take the list.
129 std::swap(Result, I->second);
130 DeletedAddrLabelsNeedingEmission.erase(I);
131}
132
133
Chris Lattner347a0eb2010-03-15 19:09:43 +0000134void MMIAddrLabelMap::UpdateForDeletedBlock(BasicBlock *BB) {
135 // If the block got deleted, there is no need for the symbol. If the symbol
136 // was already emitted, we can just forget about it, otherwise we need to
137 // queue it up for later emission when the function is output.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000138 AddrLabelSymEntry Entry = std::move(AddrLabelSymbols[BB]);
Chris Lattner347a0eb2010-03-15 19:09:43 +0000139 AddrLabelSymbols.erase(BB);
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000140 assert(!Entry.Symbols.empty() && "Didn't have a symbol, why a callback?");
Craig Topperc0196b12014-04-14 00:51:57 +0000141 BBCallbacks[Entry.Index] = nullptr; // Clear the callback.
Chris Lattner347a0eb2010-03-15 19:09:43 +0000142
Craig Topperc0196b12014-04-14 00:51:57 +0000143 assert((BB->getParent() == nullptr || BB->getParent() == Entry.Fn) &&
Chris Lattner561334a2010-03-15 20:39:00 +0000144 "Block/parent mismatch");
Chris Lattnerdb035a02010-03-16 00:29:39 +0000145
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000146 for (MCSymbol *Sym : Entry.Symbols) {
Chris Lattnerdb035a02010-03-16 00:29:39 +0000147 if (Sym->isDefined())
148 return;
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +0000149
Chris Lattnerdb035a02010-03-16 00:29:39 +0000150 // If the block is not yet defined, we need to emit it at the end of the
151 // function. Add the symbol to the DeletedAddrLabelsNeedingEmission list
152 // for the containing Function. Since the block is being deleted, its
153 // parent may already be removed, we have to get the function from 'Entry'.
154 DeletedAddrLabelsNeedingEmission[Entry.Fn].push_back(Sym);
Chris Lattnerdb035a02010-03-16 00:29:39 +0000155 }
Chris Lattner347a0eb2010-03-15 19:09:43 +0000156}
157
158void MMIAddrLabelMap::UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New) {
159 // Get the entry for the RAUW'd block and remove it from our map.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000160 AddrLabelSymEntry OldEntry = std::move(AddrLabelSymbols[Old]);
Chris Lattner347a0eb2010-03-15 19:09:43 +0000161 AddrLabelSymbols.erase(Old);
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000162 assert(!OldEntry.Symbols.empty() && "Didn't have a symbol, why a callback?");
Chris Lattnerdb035a02010-03-16 00:29:39 +0000163
164 AddrLabelSymEntry &NewEntry = AddrLabelSymbols[New];
165
Chris Lattner347a0eb2010-03-15 19:09:43 +0000166 // If New is not address taken, just move our symbol over to it.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000167 if (NewEntry.Symbols.empty()) {
Chris Lattnerb1c4f622010-03-22 23:15:57 +0000168 BBCallbacks[OldEntry.Index].setPtr(New); // Update the callback.
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000169 NewEntry = std::move(OldEntry); // Set New's entry.
Chris Lattnerdb035a02010-03-16 00:29:39 +0000170 return;
Chris Lattner347a0eb2010-03-15 19:09:43 +0000171 }
Chris Lattnerdb035a02010-03-16 00:29:39 +0000172
Craig Topperc0196b12014-04-14 00:51:57 +0000173 BBCallbacks[OldEntry.Index] = nullptr; // Update the callback.
Chris Lattnerdb035a02010-03-16 00:29:39 +0000174
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000175 // Otherwise, we need to add the old symbols to the new block's set.
176 NewEntry.Symbols.insert(NewEntry.Symbols.end(), OldEntry.Symbols.begin(),
177 OldEntry.Symbols.end());
Chris Lattner347a0eb2010-03-15 19:09:43 +0000178}
179
180
181void MMIAddrLabelMapCallbackPtr::deleted() {
182 Map->UpdateForDeletedBlock(cast<BasicBlock>(getValPtr()));
183}
184
185void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) {
186 Map->UpdateForRAUWBlock(cast<BasicBlock>(getValPtr()), cast<BasicBlock>(V2));
187}
188
189
Jim Laskey0bbdc552006-01-26 20:21:46 +0000190//===----------------------------------------------------------------------===//
Eric Christopherc2645712009-08-26 21:27:09 +0000191
Matthias Braunc3b2e802016-08-24 00:42:05 +0000192MachineModuleInfo::MachineModuleInfo(const TargetMachine *TM)
Matthias Braun733fe362016-08-24 01:52:46 +0000193 : ImmutablePass(ID), TM(*TM),
194 Context(TM->getMCAsmInfo(), TM->getMCRegisterInfo(),
195 TM->getObjFileLowering(), nullptr, false) {
Owen Anderson6c18d1a2010-10-19 17:21:58 +0000196 initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry());
Anton Korobeynikovbbaf5542007-05-13 15:42:26 +0000197}
Jim Laskey0bbdc552006-01-26 20:21:46 +0000198
Chris Lattnerf2471ec2009-09-15 22:44:26 +0000199MachineModuleInfo::~MachineModuleInfo() {
Pedro Artigas41b98842012-12-05 17:12:22 +0000200}
Michael J. Spencerd3ea25e2010-10-16 08:25:21 +0000201
Pedro Artigas41b98842012-12-05 17:12:22 +0000202bool MachineModuleInfo::doInitialization(Module &M) {
Pedro Artigase84b13f2012-12-06 22:12:44 +0000203
Craig Topperc0196b12014-04-14 00:51:57 +0000204 ObjFileMMI = nullptr;
Pedro Artigas41b98842012-12-05 17:12:22 +0000205 CurCallSite = 0;
Peter Collingbourne7ef497b2014-12-30 20:05:19 +0000206 DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false;
Craig Topperc0196b12014-04-14 00:51:57 +0000207 AddrLabelSymbols = nullptr;
Matthias Braun733fe362016-08-24 01:52:46 +0000208 TheModule = &M;
Pedro Artigas41b98842012-12-05 17:12:22 +0000209
210 return false;
211}
212
213bool MachineModuleInfo::doFinalization(Module &M) {
214
215 Personalities.clear();
216
Chris Lattner347a0eb2010-03-15 19:09:43 +0000217 delete AddrLabelSymbols;
Craig Topperc0196b12014-04-14 00:51:57 +0000218 AddrLabelSymbols = nullptr;
Pedro Artigas41b98842012-12-05 17:12:22 +0000219
Pedro Artigas7212ee42012-12-12 22:59:46 +0000220 Context.reset();
Pedro Artigase84b13f2012-12-06 22:12:44 +0000221
Pedro Artigas33832252013-01-04 18:04:42 +0000222 delete ObjFileMMI;
Craig Topperc0196b12014-04-14 00:51:57 +0000223 ObjFileMMI = nullptr;
Pedro Artigas33832252013-01-04 18:04:42 +0000224
Pedro Artigas41b98842012-12-05 17:12:22 +0000225 return false;
Jim Laskey0bbdc552006-01-26 20:21:46 +0000226}
227
Chris Lattner347a0eb2010-03-15 19:09:43 +0000228//===- Address of Block Management ----------------------------------------===//
229
Benjamin Kramer6fe4e792015-06-29 20:21:55 +0000230ArrayRef<MCSymbol *>
231MachineModuleInfo::getAddrLabelSymbolToEmit(const BasicBlock *BB) {
Chris Lattnerdb035a02010-03-16 00:29:39 +0000232 // Lazily create AddrLabelSymbols.
Craig Topperc0196b12014-04-14 00:51:57 +0000233 if (!AddrLabelSymbols)
Chris Lattnerdb035a02010-03-16 00:29:39 +0000234 AddrLabelSymbols = new MMIAddrLabelMap(Context);
235 return AddrLabelSymbols->getAddrLabelSymbolToEmit(const_cast<BasicBlock*>(BB));
236}
237
Chris Lattner561334a2010-03-15 20:39:00 +0000238void MachineModuleInfo::
239takeDeletedSymbolsForFunction(const Function *F,
240 std::vector<MCSymbol*> &Result) {
241 // If no blocks have had their addresses taken, we're done.
Craig Topperc0196b12014-04-14 00:51:57 +0000242 if (!AddrLabelSymbols) return;
Chris Lattner561334a2010-03-15 20:39:00 +0000243 return AddrLabelSymbols->
244 takeDeletedSymbolsForFunction(const_cast<Function*>(F), Result);
245}
Chris Lattner9efbbcb2010-03-14 17:53:23 +0000246
Matthias Braund0ee66c2016-12-01 19:32:15 +0000247/// \name Exception Handling
248/// \{
Jim Laskey88dd2fd2007-02-21 22:38:31 +0000249
Keno Fischeraff703a2015-07-14 19:22:51 +0000250void MachineModuleInfo::addPersonality(const Function *Personality) {
Bill Wendling2e5068942008-07-03 22:53:42 +0000251 for (unsigned i = 0; i < Personalities.size(); ++i)
Anton Korobeynikovbbaf5542007-05-13 15:42:26 +0000252 if (Personalities[i] == Personality)
253 return;
Reid Klecknere00faf82015-08-31 20:02:16 +0000254 Personalities.push_back(Personality);
Jim Laskey88dd2fd2007-02-21 22:38:31 +0000255}
256
Matthias Braund0ee66c2016-12-01 19:32:15 +0000257/// \}
Matthias Braun733fe362016-08-24 01:52:46 +0000258
259MachineFunction &MachineModuleInfo::getMachineFunction(const Function &F) {
260 // Shortcut for the common case where a sequence of MachineFunctionPasses
261 // all query for the same Function.
262 if (LastRequest == &F)
263 return *LastResult;
264
265 auto I = MachineFunctions.insert(
266 std::make_pair(&F, std::unique_ptr<MachineFunction>()));
267 MachineFunction *MF;
268 if (I.second) {
269 // No pre-existing machine function, create a new one.
270 MF = new MachineFunction(&F, TM, NextFnNum++, *this);
271 // Update the set entry.
272 I.first->second.reset(MF);
273
274 if (MFInitializer)
275 if (MFInitializer->initializeMachineFunction(*MF))
276 report_fatal_error("Unable to initialize machine function");
277 } else {
278 MF = I.first->second.get();
279 }
280
281 LastRequest = &F;
282 LastResult = MF;
283 return *MF;
284}
285
286void MachineModuleInfo::deleteMachineFunctionFor(Function &F) {
287 MachineFunctions.erase(&F);
288 LastRequest = nullptr;
289 LastResult = nullptr;
290}
291
292namespace {
293/// This pass frees the MachineFunction object associated with a Function.
294class FreeMachineFunction : public FunctionPass {
295public:
296 static char ID;
297 FreeMachineFunction() : FunctionPass(ID) {}
298
299 void getAnalysisUsage(AnalysisUsage &AU) const override {
300 AU.addRequired<MachineModuleInfo>();
301 AU.addPreserved<MachineModuleInfo>();
302 }
303
304 bool runOnFunction(Function &F) override {
305 MachineModuleInfo &MMI = getAnalysis<MachineModuleInfo>();
306 MMI.deleteMachineFunctionFor(F);
307 return true;
308 }
Yaron Keren75fadfc2017-03-07 20:59:08 +0000309
310 StringRef getPassName() const override {
311 return "Free MachineFunction";
312 }
Matthias Braun733fe362016-08-24 01:52:46 +0000313};
314char FreeMachineFunction::ID;
315} // end anonymous namespace
316
317namespace llvm {
318FunctionPass *createFreeMachineFunctionPass() {
319 return new FreeMachineFunction();
320}
321} // end namespace llvm
Ahmed Bougacha456dce82016-11-16 22:24:56 +0000322
323//===- MMI building helpers -----------------------------------------------===//
324
Ahmed Bougachabd6ce9a2016-11-16 22:25:03 +0000325void llvm::computeUsesVAFloatArgument(const CallInst &I,
326 MachineModuleInfo &MMI) {
Ahmed Bougacha456dce82016-11-16 22:24:56 +0000327 FunctionType *FT =
328 cast<FunctionType>(I.getCalledValue()->getType()->getContainedType(0));
Ahmed Bougachabd6ce9a2016-11-16 22:25:03 +0000329 if (FT->isVarArg() && !MMI.usesVAFloatArgument()) {
Ahmed Bougacha456dce82016-11-16 22:24:56 +0000330 for (unsigned i = 0, e = I.getNumArgOperands(); i != e; ++i) {
331 Type *T = I.getArgOperand(i)->getType();
332 for (auto i : post_order(T)) {
333 if (i->isFloatingPointTy()) {
Ahmed Bougachabd6ce9a2016-11-16 22:25:03 +0000334 MMI.setUsesVAFloatArgument(true);
Ahmed Bougacha456dce82016-11-16 22:24:56 +0000335 return;
336 }
337 }
338 }
339 }
340}