llvm.org GIT mirror llvm / e74c436
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304839 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Zelenko 3 years ago
14 changed file(s) with 344 addition(s) and 149 deletion(s). Raw diff Collapse all Expand all
3131 namespace llvm {
3232
3333 class LiveIntervals;
34 class MachineFunction;
3435 class MachineInstr;
36 class MachineRegisterInfo;
3537 class RegisterClassInfo;
3638
3739 struct RegisterMaskPair {
146148
147149 PressureChange PressureChanges[MaxPSets];
148150
149 typedef PressureChange* iterator;
151 using iterator = PressureChange *;
152
150153 iterator nonconst_begin() { return &PressureChanges[0]; }
151154 iterator nonconst_end() { return &PressureChanges[MaxPSets]; }
152155
153156 public:
154 typedef const PressureChange* const_iterator;
157 using const_iterator = const PressureChange *;
158
155159 const_iterator begin() const { return &PressureChanges[0]; }
156160 const_iterator end() const { return &PressureChanges[MaxPSets]; }
157161
268272 }
269273 };
270274
271 typedef SparseSet RegSet;
275 using RegSet = SparseSet;
272276 RegSet Regs;
273277 unsigned NumRegUnits;
274278
None //==- RegisterUsageInfo.h - Register Usage Informartion Storage -*- C++ -*-===//
0 //==- RegisterUsageInfo.h - Register Usage Informartion Storage --*- C++ -*-==//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1919 #define LLVM_CODEGEN_PHYSICALREGISTERUSAGEINFO_H
2020
2121 #include "llvm/ADT/DenseMap.h"
22 #include "llvm/CodeGen/MachineRegisterInfo.h"
23 #include "llvm/IR/Function.h"
24 #include "llvm/IR/Module.h"
2522 #include "llvm/Pass.h"
26 #include "llvm/Support/CommandLine.h"
27 #include "llvm/Support/raw_ostream.h"
23 #include
24 #include
2825
2926 namespace llvm {
27
28 class Function;
29 class TargetMachine;
3030
3131 class PhysicalRegisterUsageInfo : public ImmutablePass {
3232 virtual void anchor();
6969
7070 const TargetMachine *TM;
7171 };
72 }
7372
74 #endif
73 } // end namespace llvm
74
75 #endif // LLVM_CODEGEN_PHYSICALREGISTERUSAGEINFO_H
None //===-- llvm/CodeGen/SchedulerRegistry.h ------------------------*- C++ -*-===//
0 //===- llvm/CodeGen/SchedulerRegistry.h -------------------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1515 #define LLVM_CODEGEN_SCHEDULERREGISTRY_H
1616
1717 #include "llvm/CodeGen/MachinePassRegistry.h"
18 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Support/CodeGen.h"
1919
2020 namespace llvm {
2121
2525 ///
2626 //===----------------------------------------------------------------------===//
2727
28 class ScheduleDAGSDNodes;
2829 class SelectionDAGISel;
29 class ScheduleDAGSDNodes;
30 class SelectionDAG;
31 class MachineBasicBlock;
3230
3331 class RegisterScheduler : public MachinePassRegistryNode {
3432 public:
35 typedef ScheduleDAGSDNodes *(*FunctionPassCtor)(SelectionDAGISel*,
36 CodeGenOpt::Level);
33 using FunctionPassCtor = ScheduleDAGSDNodes *(*)(SelectionDAGISel*,
34 CodeGenOpt::Level);
3735
3836 static MachinePassRegistry Registry;
3937
4442
4543
4644 // Accessors.
47 //
4845 RegisterScheduler *getNext() const {
4946 return (RegisterScheduler *)MachinePassRegistryNode::getNext();
5047 }
48
5149 static RegisterScheduler *getList() {
5250 return (RegisterScheduler *)Registry.getList();
5351 }
52
5453 static void setListener(MachinePassRegistryListener *L) {
5554 Registry.setListener(L);
5655 }
102101
103102 } // end namespace llvm
104103
105 #endif
104 #endif // LLVM_CODEGEN_SCHEDULERREGISTRY_H
None //===-- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp --*- C++ -*--===//
0 //===- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp ----------------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "CodeViewDebug.h"
14 #include "llvm/ADT/APSInt.h"
15 #include "llvm/ADT/ArrayRef.h"
16 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/ADT/DenseSet.h"
18 #include "llvm/ADT/MapVector.h"
19 #include "llvm/ADT/None.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/SmallString.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/ADT/STLExtras.h"
24 #include "llvm/ADT/StringRef.h"
1425 #include "llvm/ADT/TinyPtrVector.h"
26 #include "llvm/ADT/Triple.h"
27 #include "llvm/ADT/Twine.h"
28 #include "llvm/CodeGen/AsmPrinter.h"
29 #include "llvm/CodeGen/LexicalScopes.h"
30 #include "llvm/CodeGen/MachineFunction.h"
31 #include "llvm/CodeGen/MachineInstr.h"
32 #include "llvm/CodeGen/MachineModuleInfo.h"
33 #include "llvm/CodeGen/MachineOperand.h"
34 #include "llvm/Config/llvm-config.h"
1535 #include "llvm/DebugInfo/CodeView/CVTypeVisitor.h"
1636 #include "llvm/DebugInfo/CodeView/CodeView.h"
1737 #include "llvm/DebugInfo/CodeView/DebugInlineeLinesSubsection.h"
1838 #include "llvm/DebugInfo/CodeView/Line.h"
1939 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
20 #include "llvm/DebugInfo/CodeView/TypeDatabase.h"
2140 #include "llvm/DebugInfo/CodeView/TypeDumpVisitor.h"
2241 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
2342 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
2443 #include "llvm/DebugInfo/CodeView/TypeTableCollection.h"
25 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
2644 #include "llvm/IR/Constants.h"
45 #include "llvm/IR/DataLayout.h"
46 #include "llvm/IR/DebugInfoMetadata.h"
47 #include "llvm/IR/DebugLoc.h"
48 #include "llvm/IR/Function.h"
49 #include "llvm/IR/GlobalValue.h"
50 #include "llvm/IR/GlobalVariable.h"
51 #include "llvm/IR/Metadata.h"
52 #include "llvm/IR/Module.h"
2753 #include "llvm/MC/MCAsmInfo.h"
28 #include "llvm/MC/MCExpr.h"
54 #include "llvm/MC/MCContext.h"
2955 #include "llvm/MC/MCSectionCOFF.h"
56 #include "llvm/MC/MCStreamer.h"
3057 #include "llvm/MC/MCSymbol.h"
31 #include "llvm/Support/BinaryByteStream.h"
32 #include "llvm/Support/BinaryStreamReader.h"
58 #include "llvm/Support/Casting.h"
3359 #include "llvm/Support/COFF.h"
60 #include "llvm/Support/Compiler.h"
61 #include "llvm/Support/Dwarf.h"
62 #include "llvm/Support/Endian.h"
63 #include "llvm/Support/Error.h"
64 #include "llvm/Support/ErrorHandling.h"
3465 #include "llvm/Support/ScopedPrinter.h"
66 #include "llvm/Support/SMLoc.h"
3567 #include "llvm/Target/TargetFrameLowering.h"
68 #include "llvm/Target/TargetLoweringObjectFile.h"
69 #include "llvm/Target/TargetMachine.h"
3670 #include "llvm/Target/TargetRegisterInfo.h"
3771 #include "llvm/Target/TargetSubtargetInfo.h"
72 #include
73 #include
74 #include
75 #include
76 #include
77 #include
78 #include
79 #include
80 #include
81 #include
3882
3983 using namespace llvm;
4084 using namespace llvm::codeview;
4185
4286 CodeViewDebug::CodeViewDebug(AsmPrinter *AP)
43 : DebugHandlerBase(AP), OS(*Asm->OutStreamer), Allocator(),
44 TypeTable(Allocator), CurFn(nullptr) {
87 : DebugHandlerBase(AP), OS(*Asm->OutStreamer), TypeTable(Allocator) {
4588 // If module doesn't have named metadata anchors or COFF debug section
4689 // is not available, skip any debug info related stuff.
4790 if (!MMI->getModule()->getNamedMetadata("llvm.dbg.cu") ||
177220 static std::string getQualifiedName(ArrayRef QualifiedNameComponents,
178221 StringRef TypeName) {
179222 std::string FullyQualifiedName;
180 for (StringRef QualifiedNameComponent : reverse(QualifiedNameComponents)) {
223 for (StringRef QualifiedNameComponent :
224 llvm::reverse(QualifiedNameComponents)) {
181225 FullyQualifiedName.append(QualifiedNameComponent);
182226 FullyQualifiedName.append("::");
183227 }
570614 }
571615 }
572616
573 } // anonymous namespace
617 } // end anonymous namespace
574618
575619 void CodeViewDebug::emitCompilerInformation() {
576620 MCContext &Context = MMI->getContext();
15801624 uint64_t BaseOffset;
15811625 };
15821626 // [MemberInfo]
1583 typedef std::vector MemberList;
1584
1585 typedef TinyPtrVector MethodsList;
1627 using MemberList = std::vector;
1628
1629 using MethodsList = TinyPtrVector;
15861630 // MethodName -> MethodsList
1587 typedef MapVector MethodsMap;
1631 using MethodsMap = MapVector;
15881632
15891633 /// Base classes.
15901634 std::vector Inheritance;
18491893 translateMethodOptionFlags(SP), VFTableOffset, Name));
18501894 MemberCount++;
18511895 }
1852 assert(Methods.size() > 0 && "Empty methods map entry");
1896 assert(!Methods.empty() && "Empty methods map entry");
18531897 if (Methods.size() == 1)
18541898 FLBR.writeMemberType(Methods[0]);
18551899 else {
None //===-- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h ----*- C++ -*--===//
0 //===- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h --------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1313 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
1414 #define LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
1515
16 #include "DbgValueHistoryCalculator.h"
1617 #include "DebugHandlerBase.h"
18 #include "llvm/ADT/ArrayRef.h"
1719 #include "llvm/ADT/DenseMap.h"
18 #include "llvm/ADT/StringMap.h"
19 #include "llvm/CodeGen/AsmPrinter.h"
20 #include "llvm/CodeGen/MachineFunction.h"
21 #include "llvm/CodeGen/MachineModuleInfo.h"
20 #include "llvm/ADT/DenseSet.h"
21 #include "llvm/ADT/MapVector.h"
22 #include "llvm/ADT/SetVector.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/DebugInfo/CodeView/CodeView.h"
2225 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
2326 #include "llvm/DebugInfo/CodeView/TypeTableBuilder.h"
24 #include "llvm/IR/DebugInfo.h"
2527 #include "llvm/IR/DebugLoc.h"
26 #include "llvm/MC/MCStreamer.h"
27 #include "llvm/Target/TargetLoweringObjectFile.h"
28 #include "llvm/Support/Allocator.h"
29 #include "llvm/Support/Compiler.h"
30 #include
31 #include
32 #include
33 #include
34 #include
35 #include
36 #include
2837
2938 namespace llvm {
3039
40 struct ClassInfo;
3141 class StringRef;
32 class LexicalScope;
33 struct ClassInfo;
42 class AsmPrinter;
43 class Function;
44 class GlobalVariable;
45 class MCSectionCOFF;
46 class MCStreamer;
47 class MCSymbol;
48 class MachineFunction;
3449
3550 /// \brief Collects and handles line tables information in a CodeView format.
3651 class LLVM_LIBRARY_VISIBILITY CodeViewDebug : public DebugHandlerBase {
3752 MCStreamer &OS;
38 llvm::BumpPtrAllocator Allocator;
53 BumpPtrAllocator Allocator;
3954 codeview::TypeTableBuilder TypeTable;
4055
4156 /// Represents the most general definition range.
109124 unsigned LastFileId = 0;
110125 bool HaveLineInfo = false;
111126 };
112 FunctionInfo *CurFn;
127 FunctionInfo *CurFn = nullptr;
113128
114129 /// The set of comdat .debug$S sections that we've seen so far. Each section
115130 /// must start with a magic version number that must only be emitted once.
175190 std::vector> LocalUDTs,
176191 GlobalUDTs;
177192
178 typedef std::map FileToFilepathMapTy;
193 using FileToFilepathMapTy = std::map;
179194 FileToFilepathMapTy FileToFilepathMap;
195
180196 StringRef getFullFilepath(const DIFile *S);
181197
182198 unsigned maybeRecordFile(const DIFile *F);
222238 void emitInlinedCallSite(const FunctionInfo &FI, const DILocation *InlinedAt,
223239 const InlineSite &Site);
224240
225 typedef DbgValueHistoryMap::InlinedVariable InlinedVariable;
241 using InlinedVariable = DbgValueHistoryMap::InlinedVariable;
226242
227243 void collectVariableInfo(const DISubprogram *SP);
228244
308324 public:
309325 CodeViewDebug(AsmPrinter *Asm);
310326
311 void setSymbolSize(const llvm::MCSymbol *, uint64_t) override {}
327 void setSymbolSize(const MCSymbol *, uint64_t) override {}
312328
313329 /// \brief Emit the COFF section that holds the line table information.
314330 void endModule() override;
316332 /// \brief Process beginning of an instruction.
317333 void beginInstruction(const MachineInstr *MI) override;
318334 };
319 } // End of namespace llvm
320
321 #endif
335
336 } // end namespace llvm
337
338 #endif // LLVM_LIB_CODEGEN_ASMPRINTER_CODEVIEWDEBUG_H
None //===-- BranchFolding.cpp - Fold machine code branch instructions ---------===//
0 //===- BranchFolding.cpp - Fold machine code branch instructions ----------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1717 //===----------------------------------------------------------------------===//
1818
1919 #include "BranchFolding.h"
20 #include "llvm/ADT/BitVector.h"
21 #include "llvm/ADT/SmallPtrSet.h"
22 #include "llvm/ADT/SmallSet.h"
23 #include "llvm/ADT/SmallVector.h"
24 #include "llvm/ADT/Statistic.h"
2025 #include "llvm/ADT/STLExtras.h"
21 #include "llvm/ADT/SmallSet.h"
22 #include "llvm/ADT/Statistic.h"
2326 #include "llvm/CodeGen/Analysis.h"
27 #include "llvm/CodeGen/MachineBasicBlock.h"
2428 #include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
2529 #include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
30 #include "llvm/CodeGen/MachineFunction.h"
2631 #include "llvm/CodeGen/MachineFunctionPass.h"
32 #include "llvm/CodeGen/MachineInstr.h"
2733 #include "llvm/CodeGen/MachineJumpTableInfo.h"
2834 #include "llvm/CodeGen/MachineLoopInfo.h"
29 #include "llvm/CodeGen/MachineMemOperand.h"
3035 #include "llvm/CodeGen/MachineModuleInfo.h"
36 #include "llvm/CodeGen/MachineOperand.h"
3137 #include "llvm/CodeGen/MachineRegisterInfo.h"
32 #include "llvm/CodeGen/Passes.h"
3338 #include "llvm/CodeGen/TargetPassConfig.h"
3439 #include "llvm/IR/DebugInfoMetadata.h"
40 #include "llvm/IR/DebugLoc.h"
3541 #include "llvm/IR/Function.h"
42 #include "llvm/MC/MCRegisterInfo.h"
43 #include "llvm/Pass.h"
44 #include "llvm/Support/BlockFrequency.h"
45 #include "llvm/Support/BranchProbability.h"
3646 #include "llvm/Support/CommandLine.h"
3747 #include "llvm/Support/Debug.h"
3848 #include "llvm/Support/ErrorHandling.h"
3949 #include "llvm/Support/raw_ostream.h"
4050 #include "llvm/Target/TargetInstrInfo.h"
51 #include "llvm/Target/TargetMachine.h"
4152 #include "llvm/Target/TargetRegisterInfo.h"
4253 #include "llvm/Target/TargetSubtargetInfo.h"
43 #include <algorithm>
54 #include <cassert>
55 #include
56 #include
57 #include
58 #include
59
4460 using namespace llvm;
4561
4662 #define DEBUG_TYPE "branch-folder"
6884 cl::init(3), cl::Hidden);
6985
7086 namespace {
87
7188 /// BranchFolderPass - Wrap branch folder in a machine function pass.
7289 class BranchFolderPass : public MachineFunctionPass {
7390 public:
7491 static char ID;
92
7593 explicit BranchFolderPass(): MachineFunctionPass(ID) {}
7694
7795 bool runOnMachineFunction(MachineFunction &MF) override;
83101 MachineFunctionPass::getAnalysisUsage(AU);
84102 }
85103 };
86 }
104
105 } // end anonymous namespace
87106
88107 char BranchFolderPass::ID = 0;
89108 char &llvm::BranchFolderPassID = BranchFolderPass::ID;
367386
368387 // Create the fall-through block.
369388 MachineFunction::iterator MBBI = CurMBB.getIterator();
370 MachineBasicBlock *NewMBB =MF.CreateMachineBasicBlock(BB);
389 MachineBasicBlock *NewMBB = MF.CreateMachineBasicBlock(BB);
371390 CurMBB.getParent()->insert(++MBBI, NewMBB);
372391
373392 // Move all the successors of this block to the specified block.
505524 MachineBasicBlock::iterator &I) {
506525 I = MBB->end();
507526 unsigned NumTerms = 0;
508 for (;;) {
527 while (true) {
509528 if (I == MBB->begin()) {
510529 I = MBB->end();
511530 break;
16001619 // block doesn't fall through into some other block, see if we can find a
16011620 // place to move this block where a fall-through will happen.
16021621 if (!PrevBB.canFallThrough()) {
1603
16041622 // Now we know that there was no fall-through into this block, check to
16051623 // see if it has a fall-through into its successor.
16061624 bool CurFallsThru = MBB->canFallThrough();
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "MILexer.h"
1314 #include "MIParser.h"
14
15 #include "MILexer.h"
15 #include "llvm/ADT/APInt.h"
16 #include "llvm/ADT/APSInt.h"
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/ADT/DenseMap.h"
19 #include "llvm/ADT/None.h"
20 #include "llvm/ADT/Optional.h"
21 #include "llvm/ADT/SmallVector.h"
1622 #include "llvm/ADT/StringMap.h"
1723 #include "llvm/ADT/StringSwitch.h"
24 #include "llvm/ADT/StringRef.h"
25 #include "llvm/ADT/Twine.h"
1826 #include "llvm/AsmParser/Parser.h"
1927 #include "llvm/AsmParser/SlotMapping.h"
2028 #include "llvm/CodeGen/MIRPrinter.h"
2533 #include "llvm/CodeGen/MachineInstrBuilder.h"
2634 #include "llvm/CodeGen/MachineMemOperand.h"
2735 #include "llvm/CodeGen/MachineModuleInfo.h"
36 #include "llvm/CodeGen/MachineOperand.h"
2837 #include "llvm/CodeGen/MachineRegisterInfo.h"
38 #include "llvm/IR/BasicBlock.h"
2939 #include "llvm/IR/Constants.h"
40 #include "llvm/IR/DataLayout.h"
41 #include "llvm/IR/DebugLoc.h"
42 #include "llvm/IR/Function.h"
43 #include "llvm/IR/InstrTypes.h"
3044 #include "llvm/IR/Instructions.h"
3145 #include "llvm/IR/Intrinsics.h"
46 #include "llvm/IR/Metadata.h"
3247 #include "llvm/IR/Module.h"
3348 #include "llvm/IR/ModuleSlotTracker.h"
49 #include "llvm/IR/Type.h"
50 #include "llvm/IR/Value.h"
3451 #include "llvm/IR/ValueSymbolTable.h"
52 #include "llvm/MC/LaneBitmask.h"
53 #include "llvm/MC/MCDwarf.h"
54 #include "llvm/MC/MCInstrDesc.h"
55 #include "llvm/MC/MCRegisterInfo.h"
56 #include "llvm/Support/AtomicOrdering.h"
57 #include "llvm/Support/BranchProbability.h"
58 #include "llvm/Support/Casting.h"
59 #include "llvm/Support/ErrorHandling.h"
60 #include "llvm/Support/LowLevelTypeImpl.h"
61 #include "llvm/Support/MemoryBuffer.h"
62 #include "llvm/Support/SMLoc.h"
3563 #include "llvm/Support/SourceMgr.h"
3664 #include "llvm/Support/raw_ostream.h"
3765 #include "llvm/Target/TargetInstrInfo.h"
3866 #include "llvm/Target/TargetIntrinsicInfo.h"
67 #include "llvm/Target/TargetMachine.h"
68 #include "llvm/Target/TargetRegisterInfo.h"
3969 #include "llvm/Target/TargetSubtargetInfo.h"
70 #include
71 #include
4072 #include
73 #include
74 #include
75 #include
76 #include
77 #include
4178
4279 using namespace llvm;
4380
20382075 // The token was already consumed, so use return here instead of break.
20392076 return false;
20402077 }
2041 case MIToken::kw_call_entry: {
2078 case MIToken::kw_call_entry:
20422079 lex();
20432080 switch (Token.kind()) {
20442081 case MIToken::GlobalValue:
20582095 "expected a global value or an external symbol after 'call-entry'");
20592096 }
20602097 break;
2061 }
20622098 default:
20632099 llvm_unreachable("The current token should be pseudo source value");
20642100 }
None //===- MIParser.h - Machine Instructions Parser ---------------------------===//
0 //===- MIParser.h - Machine Instructions Parser -----------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1414 #define LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
1515
1616 #include "llvm/ADT/DenseMap.h"
17 #include "llvm/ADT/SmallSet.h"
17 #include "llvm/ADT/StringMap.h"
18 #include "llvm/Support/Allocator.h"
1819
1920 namespace llvm {
2021
21 class StringRef;
22 class BasicBlock;
2322 class MachineBasicBlock;
2423 class MachineFunction;
25 class MachineInstr;
26 class MachineRegisterInfo;
2724 class MDNode;
2825 class RegisterBank;
2926 struct SlotMapping;
3027 class SMDiagnostic;
3128 class SourceMgr;
29 class StringRef;
3230 class TargetRegisterClass;
3331
3432 struct VRegInfo {
4442 unsigned PreferredReg = 0;
4543 };
4644
47 typedef StringMap Name2RegClassMap;
48 typedef StringMap Name2RegBankMap;
45 using Name2RegClassMap = StringMap;
46 using Name2RegBankMap = StringMap;
4947
5048 struct PerFunctionMIParsingState {
5149 BumpPtrAllocator Allocator;
121119
122120 } // end namespace llvm
123121
124 #endif
122 #endif // LLVM_LIB_CODEGEN_MIRPARSER_MIPARSER_H
1111 //
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/CodeGen/MIRPrinter.h"
15
14 #include "llvm/ADT/DenseMap.h"
15 #include "llvm/ADT/None.h"
16 #include "llvm/ADT/SmallBitVector.h"
17 #include "llvm/ADT/SmallPtrSet.h"
18 #include "llvm/ADT/SmallVector.h"
1619 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/ADT/SmallBitVector.h"
18 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/ADT/Twine.h"
1922 #include "llvm/CodeGen/GlobalISel/RegisterBank.h"
20 #include "llvm/CodeGen/MIRYamlMapping.h"
23 #include "llvm/CodeGen/MachineBasicBlock.h"
2124 #include "llvm/CodeGen/MachineConstantPool.h"
2225 #include "llvm/CodeGen/MachineFrameInfo.h"
2326 #include "llvm/CodeGen/MachineFunction.h"
27 #include "llvm/CodeGen/MachineInstr.h"
28 #include "llvm/CodeGen/MachineJumpTableInfo.h"
2429 #include "llvm/CodeGen/MachineMemOperand.h"
25 #include "llvm/CodeGen/MachineModuleInfo.h"
30 #include "llvm/CodeGen/MachineOperand.h"
2631 #include "llvm/CodeGen/MachineRegisterInfo.h"
32 #include "llvm/CodeGen/MIRPrinter.h"
33 #include "llvm/CodeGen/MIRYamlMapping.h"
34 #include "llvm/CodeGen/PseudoSourceValue.h"
2735 #include "llvm/IR/BasicBlock.h"
2836 #include "llvm/IR/Constants.h"
2937 #include "llvm/IR/DebugInfo.h"
30 #include "llvm/IR/IRPrintingPasses.h"
38 #include "llvm/IR/DebugLoc.h"
39 #include "llvm/IR/Function.h"
40 #include "llvm/IR/GlobalValue.h"
41 #include "llvm/IR/InstrTypes.h"
3142 #include "llvm/IR/Instructions.h"
3243 #include "llvm/IR/Intrinsics.h"
44 #include "llvm/IR/IRPrintingPasses.h"
3345 #include "llvm/IR/Module.h"
3446 #include "llvm/IR/ModuleSlotTracker.h"
47 #include "llvm/IR/Value.h"
48 #include "llvm/MC/LaneBitmask.h"
49 #include "llvm/MC/MCDwarf.h"
3550 #include "llvm/MC/MCSymbol.h"
51 #include "llvm/Support/AtomicOrdering.h"
52 #include "llvm/Support/BranchProbability.h"
53 #include "llvm/Support/Casting.h"
54 #include "llvm/Support/CommandLine.h"
55 #include "llvm/Support/ErrorHandling.h"
3656 #include "llvm/Support/Format.h"
37 #include "llvm/Support/MemoryBuffer.h"
38 #include "llvm/Support/Options.h"
57 #include "llvm/Support/LowLevelTypeImpl.h"
58 #include "llvm/Support/raw_ostream.h"
3959 #include "llvm/Support/YAMLTraits.h"
40 #include "llvm/Support/raw_ostream.h"
4160 #include "llvm/Target/TargetInstrInfo.h"
4261 #include "llvm/Target/TargetIntrinsicInfo.h"
62 #include "llvm/Target/TargetMachine.h"
63 #include "llvm/Target/TargetRegisterInfo.h"
4364 #include "llvm/Target/TargetSubtargetInfo.h"
65 #include
66 #include
67 #include
68 #include
69 #include
70 #include
71 #include
72 #include
4473
4574 using namespace llvm;
4675
147176 static void output(const Module &Mod, void *Ctxt, raw_ostream &OS) {
148177 Mod.print(OS, nullptr);
149178 }
179
150180 static StringRef input(StringRef Str, void *Ctxt, Module &Mod) {
151181 llvm_unreachable("LLVM Module is supposed to be parsed separately");
152182 return "";
517547 return false;
518548 return std::equal(MBB.succ_begin(), MBB.succ_end(), GuessedSuccs.begin());
519549 }
520
521550
522551 void MIPrinter::print(const MachineBasicBlock &MBB) {
523552 assert(MBB.getNumber() >= 0 && "Invalid MBB number");
910939 OS << "%const." << Op.getIndex();
911940 printOffset(Op.getOffset());
912941 break;
913 case MachineOperand::MO_TargetIndex: {
942 case MachineOperand::MO_TargetIndex:
914943 OS << "target-index(";
915944 if (const auto *Name = getTargetIndexName(
916945 *Op.getParent()->getParent()->getParent(), Op.getIndex()))
920949 OS << ')';
921950 printOffset(Op.getOffset());
922951 break;
923 }
924952 case MachineOperand::MO_JumpTableIndex:
925953 OS << "%jump-table." << Op.getIndex();
926954 break;
None //===-- RegAllocGreedy.cpp - greedy register allocator --------------------===//
0 //===- RegAllocGreedy.cpp - greedy register allocator ---------------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1818 #include "SpillPlacement.h"
1919 #include "Spiller.h"
2020 #include "SplitKit.h"
21 #include "llvm/ADT/ArrayRef.h"
22 #include "llvm/ADT/BitVector.h"
23 #include "llvm/ADT/DenseMap.h"
24 #include "llvm/ADT/IndexedMap.h"
25 #include "llvm/ADT/SetVector.h"
26 #include "llvm/ADT/SmallPtrSet.h"
27 #include "llvm/ADT/SmallSet.h"
28 #include "llvm/ADT/SmallVector.h"
2129 #include "llvm/ADT/Statistic.h"
30 #include "llvm/ADT/StringRef.h"
2231 #include "llvm/Analysis/AliasAnalysis.h"
32 #include "llvm/Analysis/OptimizationDiagnosticInfo.h"
2333 #include "llvm/CodeGen/CalcSpillWeights.h"
2434 #include "llvm/CodeGen/EdgeBundles.h"
35 #include "llvm/CodeGen/LiveInterval.h"
2536 #include "llvm/CodeGen/LiveIntervalAnalysis.h"
37 #include "llvm/CodeGen/LiveIntervalUnion.h"
2638 #include "llvm/CodeGen/LiveRangeEdit.h"
2739 #include "llvm/CodeGen/LiveRegMatrix.h"
2840 #include "llvm/CodeGen/LiveStackAnalysis.h"
41 #include "llvm/CodeGen/MachineBasicBlock.h"
2942 #include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
3043 #include "llvm/CodeGen/MachineDominators.h"
3144 #include "llvm/CodeGen/MachineFrameInfo.h"
45 #include "llvm/CodeGen/MachineFunction.h"
3246 #include "llvm/CodeGen/MachineFunctionPass.h"
47 #include "llvm/CodeGen/MachineInstr.h"
3348 #include "llvm/CodeGen/MachineLoopInfo.h"
49 #include "llvm/CodeGen/MachineOperand.h"
3450 #include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
3551 #include "llvm/CodeGen/MachineRegisterInfo.h"
36 #include "llvm/CodeGen/Passes.h"
3752 #include "llvm/CodeGen/RegAllocRegistry.h"
3853 #include "llvm/CodeGen/RegisterClassInfo.h"
54 #include "llvm/CodeGen/SlotIndexes.h"
3955 #include "llvm/CodeGen/VirtRegMap.h"
56 #include "llvm/IR/Function.h"
4057 #include "llvm/IR/LLVMContext.h"
41 #include "llvm/PassAnalysisSupport.h"
58 #include "llvm/MC/MCRegisterInfo.h"
59 #include "llvm/Pass.h"
60 #include "llvm/Support/BlockFrequency.h"
4261 #include "llvm/Support/BranchProbability.h"
4362 #include "llvm/Support/CommandLine.h"
4463 #include "llvm/Support/Debug.h"
45 #include "llvm/Support/ErrorHandling.h"
64 #include "llvm/Support/MathExtras.h"
4665 #include "llvm/Support/Timer.h"
4766 #include "llvm/Support/raw_ostream.h"
4867 #include "llvm/Target/TargetInstrInfo.h"
68 #include "llvm/Target/TargetMachine.h"
69 #include "llvm/Target/TargetRegisterInfo.h"
4970 #include "llvm/Target/TargetSubtargetInfo.h"
71 #include
72 #include
73 #include
74 #include
5075 #include
76 #include
77 #include
5178
5279 using namespace llvm;
5380
105132 createGreedyRegisterAllocator);
106133
107134 namespace {
135
108136 class RAGreedy : public MachineFunctionPass,
109137 public RegAllocBase,
110138 private LiveRangeEdit::Delegate {
111139 // Convenient shortcuts.
112 typedef std::priority_queue > PQueue;
113 typedef SmallPtrSet SmallLISet;
114 typedef SmallSet SmallVirtRegSet;
140 using PQueue = std::priority_queue>;
141 using SmallLISet = SmallPtrSet;
142 using SmallVirtRegSet = SmallSet;
115143
116144 // context
117145 MachineFunction *MF;
200228
201229 // RegInfo - Keep additional information about each live range.
202230 struct RegInfo {
203 LiveRangeStage Stage;
231 LiveRangeStage Stage = RS_New;
204232
205233 // Cascade - Eviction loop prevention. See canEvictInterference().
206 unsigned Cascade;
207
208 RegInfo() : Stage(RS_New), Cascade(0) {}
234 unsigned Cascade = 0;
235
236 RegInfo() = default;
209237 };
210238
211239 IndexedMap ExtraRegInfo;
231259
232260 /// Cost of evicting interference.
233261 struct EvictionCost {
234 unsigned BrokenHints; ///< Total number of broken hints.
235 float MaxWeight; ///< Maximum spill weight evicted.
236
237 EvictionCost(): BrokenHints(0), MaxWeight(0) {}
262 unsigned BrokenHints = 0; ///< Total number of broken hints.
263 float MaxWeight = 0; ///< Maximum spill weight evicted.
264
265 EvictionCost() = default;
238266
239267 bool isMax() const { return BrokenHints == ~0u; }
240268
412440 /// Its currently assigned register.
413441 /// In case of a physical register Reg == PhysReg.
414442 unsigned PhysReg;
443
415444 HintInfo(BlockFrequency Freq, unsigned Reg, unsigned PhysReg)
416445 : Freq(Freq), Reg(Reg), PhysReg(PhysReg) {}
417446 };
418 typedef SmallVector HintsInfo;
447 using HintsInfo = SmallVector;
448
419449 BlockFrequency getBrokenHintFreq(const HintsInfo &, unsigned);
420450 void collectHintInfo(unsigned, HintsInfo &);
421451
435465 }
436466 }
437467 };
468
438469 } // end anonymous namespace
439470
440471 char RAGreedy::ID = 0;
473504 // Hysteresis to use when comparing floats.
474505 // This helps stabilize decisions based on float comparisons.
475506 const float Hysteresis = (2007 / 2048.0f); // 0.97998046875
476
477507
478508 FunctionPass* llvm::createGreedyRegisterAllocator() {
479509 return new RAGreedy();
510540 MachineFunctionPass::getAnalysisUsage(AU);
511541 }
512542
513
514543 //===----------------------------------------------------------------------===//
515544 // LiveRangeEdit delegate methods
516545 //===----------------------------------------------------------------------===//
633662 return LI;
634663 }
635664
636
637665 //===----------------------------------------------------------------------===//
638666 // Direct Assignment
639667 //===----------------------------------------------------------------------===//
680708 unsigned CheapReg = tryEvict(VirtReg, Order, NewVRegs, Cost);
681709 return CheapReg ? CheapReg : PhysReg;
682710 }
683
684711
685712 //===----------------------------------------------------------------------===//
686713 // Interference eviction
953980 return BestPhys;
954981 }
955982
956
957983 //===----------------------------------------------------------------------===//
958984 // Region Splitting
959985 //===----------------------------------------------------------------------===//
10241050 return SpillPlacer->scanActiveBundles();
10251051 }
10261052
1027
10281053 /// addThroughConstraints - Add constraints and links to SpillPlacer from the
10291054 /// live-through blocks in Blocks.
10301055 void RAGreedy::addThroughConstraints(InterferenceCache::Cursor Intf,
10821107 unsigned Visited = 0;
10831108 #endif
10841109
1085 for (;;) {
1110 while (true) {
10861111 ArrayRef NewBundles = SpillPlacer->getRecentPositive();
10871112 // Find new through blocks in the periphery of PrefRegBundles.
10881113 for (int i = 0, e = NewBundles.size(); i != e; ++i) {
11961221 for (unsigned i = 0; i != UseBlocks.size(); ++i) {
11971222 const SplitAnalysis::BlockInfo &BI = UseBlocks[i];
11981223 SpillPlacement::BlockConstraint &BC = SplitConstraints[i];
1199 bool RegIn = LiveBundles[Bundles->getBundle(BC.Number, 0)];
1200 bool RegOut = LiveBundles[Bundles->getBundle(BC.Number, 1)];
1224 bool RegIn = LiveBundles[Bundles->getBundle(BC.Number, false)];
1225 bool RegOut = LiveBundles[Bundles->getBundle(BC.Number, true)];
12011226 unsigned Ins = 0;
12021227
12031228 if (BI.LiveIn)
12101235
12111236 for (unsigned i = 0, e = Cand.ActiveBlocks.size(); i != e; ++i) {
12121237 unsigned Number = Cand.ActiveBlocks[i];
1213 bool RegIn = LiveBundles[Bundles->getBundle(Number, 0)];
1214 bool RegOut = LiveBundles[Bundles->getBundle(Number, 1)];
1238 bool RegIn = LiveBundles[Bundles->getBundle(Number, false)];
1239 bool RegOut = LiveBundles[Bundles->getBundle(Number, true)];
12151240 if (!RegIn && !RegOut)
12161241 continue;
12171242 if (RegIn && RegOut) {
12631288 unsigned IntvIn = 0, IntvOut = 0;
12641289 SlotIndex IntfIn, IntfOut;
12651290 if (BI.LiveIn) {
1266 unsigned CandIn = BundleCand[Bundles->getBundle(Number, 0)];
1291 unsigned CandIn = BundleCand[Bundles->getBundle(Number, false)];
12671292 if (CandIn != NoCand) {
12681293 GlobalSplitCandidate &Cand = GlobalCand[CandIn];
12691294 IntvIn = Cand.IntvIdx;
12721297 }
12731298 }
12741299 if (BI.LiveOut) {
1275 unsigned CandOut = BundleCand[Bundles->getBundle(Number, 1)];
1300 unsigned CandOut = BundleCand[Bundles->getBundle(Number, true)];
12761301 if (CandOut != NoCand) {
12771302 GlobalSplitCandidate &Cand = GlobalCand[CandOut];
12781303 IntvOut = Cand.IntvIdx;
13121337 unsigned IntvIn = 0, IntvOut = 0;
13131338 SlotIndex IntfIn, IntfOut;
13141339
1315 unsigned CandIn = BundleCand[Bundles->getBundle(Number, 0)];
1340 unsigned CandIn = BundleCand[Bundles->getBundle(Number, false)];
13161341 if (CandIn != NoCand) {
13171342 GlobalSplitCandidate &Cand = GlobalCand[CandIn];
13181343 IntvIn = Cand.IntvIdx;
13201345 IntfIn = Cand.Intf.first();
13211346 }
13221347
1323 unsigned CandOut = BundleCand[Bundles->getBundle(Number, 1)];
1348 unsigned CandOut = BundleCand[Bundles->getBundle(Number, true)];
13241349 if (CandOut != NoCand) {
13251350 GlobalSplitCandidate &Cand = GlobalCand[CandOut];
13261351 IntvOut = Cand.IntvIdx;
15321557 return 0;
15331558 }
15341559
1535
15361560 //===----------------------------------------------------------------------===//
15371561 // Per-Block Splitting
15381562 //===----------------------------------------------------------------------===//
15781602 MF->verify(this, "After splitting live range around basic blocks");
15791603 return 0;
15801604 }
1581
15821605
15831606 //===----------------------------------------------------------------------===//
15841607 // Per-Instruction Splitting
16631686 return 0;
16641687 }
16651688
1666
16671689 //===----------------------------------------------------------------------===//
16681690 // Local Splitting
16691691 //===----------------------------------------------------------------------===//
1670
16711692
16721693 /// calcGapWeights - Compute the maximum spill weight that needs to be evicted
16731694 /// in order to use PhysReg between two entries in SA->UseSlots.
17391760 break;
17401761
17411762 for (; Gap != NumGaps; ++Gap) {
1742 GapWeight[Gap] = llvm::huge_valf;
1763 GapWeight[Gap] = huge_valf;
17431764 if (Uses[Gap+1].getBaseIndex() >= I->end)
17441765 break;
17451766 }
18451866 // Remove any gaps with regmask clobbers.
18461867 if (Matrix->checkRegMaskInterference(VirtReg, PhysReg))
18471868 for (unsigned i = 0, e = RegMaskGaps.size(); i != e; ++i)
1848 GapWeight[RegMaskGaps[i]] = llvm::huge_valf;
1869 GapWeight[RegMaskGaps[i]] = huge_valf;
18491870
18501871 // Try to find the best sequence of gaps to close.
18511872 // The new spill weight must be larger than any gap interference.
18571878 // It is the spill weight that needs to be evicted.
18581879 float MaxGap = GapWeight[0];
18591880
1860 for (;;) {
1881 while (true) {
18611882 // Live before/after split?
18621883 const bool LiveBefore = SplitBefore != 0 || BI.LiveIn;
18631884 const bool LiveAfter = SplitAfter != NumGaps || BI.LiveOut;
18801901 // Legally, without causing looping?
18811902 bool Legal = !ProgressRequired || NewGaps < NumGaps;
18821903
1883 if (Legal && MaxGap < llvm::huge_valf) {
1904 if (Legal && MaxGap < huge_valf) {
18841905 // Estimate the new spill weight. Each instruction reads or writes the
18851906 // register. Conservatively assume there are no read-modify-write
18861907 // instructions.
26792700
26802701 if (Reloads || FoldedReloads || Spills || FoldedSpills) {
26812702 using namespace ore;
2703
26822704 MachineOptimizationRemarkMissed R(DEBUG_TYPE, "LoopSpillReload",
26832705 L->getStartLoc(), L->getHeader());
26842706 if (Spills)
1111 ///
1212 //===----------------------------------------------------------------------===//
1313
14 #include "llvm/ADT/SmallVector.h"
1415 #include "llvm/CodeGen/RegisterUsageInfo.h"
1516 #include "llvm/CodeGen/MachineOperand.h"
17 #include "llvm/IR/Function.h"
1618 #include "llvm/IR/Module.h"
17 #include "llvm/Support/Debug.h"
19 #include "llvm/Pass.h"
20 #include "llvm/Support/CommandLine.h"
1821 #include "llvm/Support/raw_ostream.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetRegisterInfo.h"
24 #include "llvm/Target/TargetSubtargetInfo.h"
25 #include
26 #include
27 #include
28 #include
29 #include
1930
2031 using namespace llvm;
2132
6273 void PhysicalRegisterUsageInfo::print(raw_ostream &OS, const Module *M) const {
6374 const TargetRegisterInfo *TRI;
6475
65 typedef std::pair> FuncPtrRegMaskPair;
76 using FuncPtrRegMaskPair = std::pair>;
6677
6778 SmallVector FPRMPairVector;
6879
None //===----- TargetFrameLoweringImpl.cpp - Implement target frame interface --==//
0 //===- TargetFrameLoweringImpl.cpp - Implement target frame interface ------==//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1313 #include "llvm/ADT/BitVector.h"
1414 #include "llvm/CodeGen/MachineFrameInfo.h"
1515 #include "llvm/CodeGen/MachineFunction.h"
16 #include "llvm/CodeGen/MachineModuleInfo.h"
1716 #include "llvm/CodeGen/MachineRegisterInfo.h"
18 #include "llvm/CodeGen/TargetPassConfig.h"
17 #include "llvm/IR/Attributes.h"
1918 #include "llvm/IR/CallingConv.h"
2019 #include "llvm/IR/Function.h"
20 #include "llvm/MC/MCRegisterInfo.h"
21 #include "llvm/Support/Compiler.h"
2122 #include "llvm/Target/TargetFrameLowering.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetOptions.h"
2225 #include "llvm/Target/TargetRegisterInfo.h"
2326 #include "llvm/Target/TargetSubtargetInfo.h"
24 #include
27
2528 using namespace llvm;
2629
27 TargetFrameLowering::~TargetFrameLowering() {
28 }
30 TargetFrameLowering::~TargetFrameLowering() = default;
2931
3032 /// The default implementation just looks at attribute "no-frame-pointer-elim".
3133 bool TargetFrameLowering::noFramePointerElim(const MachineFunction &MF) const {
None //===-- XRayInstrumentation.cpp - Adds XRay instrumentation to functions. -===//
0 //===- XRayInstrumentation.cpp - Adds XRay instrumentation to functions. --===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1313 //
1414 //===---------------------------------------------------------------------===//
1515
16 #include "llvm/CodeGen/Analysis.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/STLExtras.h"
18 #include "llvm/ADT/Triple.h"
19 #include "llvm/CodeGen/MachineBasicBlock.h"
1720 #include "llvm/CodeGen/MachineDominators.h"
1821 #include "llvm/CodeGen/MachineFunction.h"
1922 #include "llvm/CodeGen/MachineFunctionPass.h"
2023 #include "llvm/CodeGen/MachineInstrBuilder.h"
2124 #include "llvm/CodeGen/MachineLoopInfo.h"
22 #include "llvm/CodeGen/Passes.h"
23 #include "llvm/Support/TargetRegistry.h"
25 #include "llvm/IR/Attributes.h"
26 #include "llvm/IR/Function.h"
27 #include "llvm/Pass.h"
2428 #include "llvm/Target/TargetInstrInfo.h"
29 #include "llvm/Target/TargetMachine.h"
2530 #include "llvm/Target/TargetSubtargetInfo.h"
2631
2732 using namespace llvm;
2833
2934 namespace {
35
3036 struct XRayInstrumentation : public MachineFunctionPass {
3137 static char ID;
3238
6571 void prependRetWithPatchableExit(MachineFunction &MF,
6672 const TargetInstrInfo *TII);
6773 };
68 } // anonymous namespace
74
75 } // end anonymous namespace
6976
7077 void XRayInstrumentation::replaceRetWithPatchableRet(
7178 MachineFunction &MF, const TargetInstrInfo *TII) {
143150
144151 // We look for the first non-empty MachineBasicBlock, so that we can insert
145152 // the function instrumentation in the appropriate place.
146 auto MBI =
147 find_if(MF, [&](const MachineBasicBlock &MBB) { return !MBB.empty(); });
153 auto MBI = llvm::find_if(
154 MF, [&](const MachineBasicBlock &MBB) { return !MBB.empty(); });
148155 if (MBI == MF.end())
149156 return false; // The function is empty.
150157
None //===-- Thumb2InstrInfo.cpp - Thumb-2 Instruction Information -------------===//
0 //===- Thumb2InstrInfo.cpp - Thumb-2 Instruction Information --------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1010 //
1111 //===----------------------------------------------------------------------===//
1212
13 #include "Thumb2InstrInfo.h"
14 #include "ARMConstantPoolValue.h"
1513 #include "ARMMachineFunctionInfo.h"
1614 #include "MCTargetDesc/ARMAddressingModes.h"
15 #include "Thumb2InstrInfo.h"
16 #include "llvm/CodeGen/MachineBasicBlock.h"
1717 #include "llvm/CodeGen/MachineFrameInfo.h"
18 #include "llvm/CodeGen/MachineFunction.h"
19 #include "llvm/CodeGen/MachineInstr.h"
1820 #include "llvm/CodeGen/MachineInstrBuilder.h"
1921 #include "llvm/CodeGen/MachineMemOperand.h"
22 #include "llvm/CodeGen/MachineOperand.h"
2023 #include "llvm/CodeGen/MachineRegisterInfo.h"
24 #include "llvm/IR/DebugLoc.h"
2125 #include "llvm/MC/MCInst.h"
26 #include "llvm/MC/MCInstrDesc.h"
2227 #include "llvm/Support/CommandLine.h"
28 #include "llvm/Support/ErrorHandling.h"
29 #include "llvm/Support/MathExtras.h"
30 #include "llvm/Target/TargetMachine.h"
31 #include "llvm/Target/TargetRegisterInfo.h"
32 #include
2333
2434 using namespace llvm;
2535
2939 cl::init(false));
3040
3141 Thumb2InstrInfo::Thumb2InstrInfo(const ARMSubtarget &STI)
32 : ARMBaseInstrInfo(STI), RI() {}
42 : ARMBaseInstrInfo(STI) {}
3343
3444 /// Return the noop instruction to use for a noop.
3545 void Thumb2InstrInfo::getNoop(MCInst &NopInst) const {
538548 // Add cc_out operand if the original instruction did not have one.
539549 if (!HasCCOut)
540550 MI.addOperand(MachineOperand::CreateReg(0, false));
541
542551 } else {
543
544552 // AddrMode4 and AddrMode6 cannot handle any offset.
545553 if (AddrMode == ARMII::AddrMode4 || AddrMode == ARMII::AddrMode6)
546554 return false;