File tree Expand file tree Collapse file tree 6 files changed +552
-0
lines changed
utils/gn/secondary/llvm/lib/CodeGen/GlobalISel Expand file tree Collapse file tree 6 files changed +552
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifndef LLVM_CODEGEN_GLOBALISEL_INFERTYPEINFOPASS_H
2+ #define LLVM_CODEGEN_GLOBALISEL_INFERTYPEINFOPASS_H
3+
4+ #include " llvm/Analysis/AliasAnalysis.h"
5+ #include " llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
6+ #include " llvm/CodeGen/MachineFunction.h"
7+ #include " llvm/CodeGen/MachineFunctionPass.h"
8+
9+ namespace llvm {
10+
11+ class InferTypeInfo : public MachineFunctionPass {
12+ public:
13+ static char ID;
14+
15+ private:
16+ MachineRegisterInfo *MRI = nullptr ;
17+ MachineFunction *MF = nullptr ;
18+
19+ MachineIRBuilder Builder;
20+
21+ // / Initialize the field members using \p MF.
22+ void init (MachineFunction &MF);
23+
24+ public:
25+ InferTypeInfo () : MachineFunctionPass(ID) {}
26+
27+ void getAnalysisUsage (AnalysisUsage &AU) const override ;
28+
29+ bool runOnMachineFunction (MachineFunction &MF) override ;
30+
31+ private:
32+ bool inferTypeInfo (MachineFunction &MF);
33+
34+ bool shouldBeFP (MachineOperand &Op, unsigned Depth) const ;
35+
36+ void updateDef (Register Reg);
37+
38+ void updateUse (MachineOperand &Op, bool FP);
39+ };
40+
41+ } // end namespace llvm
42+
43+ #endif // LLVM_CODEGEN_GLOBALISEL_INFERTYPEINFOPASS_H
Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ void initializeHardwareLoopsLegacyPass(PassRegistry &);
130130void initializeMIRProfileLoaderPassPass (PassRegistry &);
131131void initializeIRSimilarityIdentifierWrapperPassPass (PassRegistry &);
132132void initializeIRTranslatorPass (PassRegistry &);
133+ void initializeInferTypeInfoPass (PassRegistry &);
133134void initializeIVUsersWrapperPassPass (PassRegistry &);
134135void initializeIfConverterPass (PassRegistry &);
135136void initializeImmutableModuleSummaryIndexWrapperPassPass (PassRegistry &);
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ add_llvm_component_library(LLVMGlobalISel
1313 GIMatchTableExecutor.cpp
1414 GISelChangeObserver.cpp
1515 IRTranslator.cpp
16+ InferTypeInfoPass.cpp
1617 InlineAsmLowering.cpp
1718 InstructionSelect.cpp
1819 InstructionSelector.cpp
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ using namespace llvm;
1616
1717void llvm::initializeGlobalISel (PassRegistry &Registry) {
1818 initializeIRTranslatorPass (Registry);
19+ initializeInferTypeInfoPass (Registry);
1920 initializeLegalizerPass (Registry);
2021 initializeLoadStoreOptPass (Registry);
2122 initializeLocalizerPass (Registry);
You can’t perform that action at this time.
0 commit comments