diff options
Diffstat (limited to 'llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h')
-rw-r--r-- | llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h index fd3dc743000b..59d2540dd14e 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h @@ -313,6 +313,14 @@ enum { /// - RendererFnID - Custom renderer function to call GIR_CustomRenderer, + /// Render operands to the specified instruction using a custom function, + /// reading from a specific operand. + /// - InsnID - Instruction ID to modify + /// - OldInsnID - Instruction ID to get the matched operand from + /// - OpIdx - Operand index in OldInsnID the render function should read from.. + /// - RendererFnID - Custom renderer function to call + GIR_CustomOperandRenderer, + /// Render a G_CONSTANT operator as a sign-extended immediate. /// - NewInsnID - Instruction ID to modify /// - OldInsnID - Instruction ID to copy from @@ -390,6 +398,10 @@ public: GISelKnownBits *KnownBits = nullptr; MachineFunction *MF = nullptr; + virtual void setupGeneratedPerFunctionState(MachineFunction &MF) { + llvm_unreachable("TableGen should have emitted implementation"); + } + /// Setup per-MF selector state. virtual void setupMF(MachineFunction &mf, GISelKnownBits &KB, @@ -397,6 +409,7 @@ public: CoverageInfo = &covinfo; KnownBits = &KB; MF = &mf; + setupGeneratedPerFunctionState(mf); } protected: @@ -487,7 +500,7 @@ protected: bool isOperandImmEqual(const MachineOperand &MO, int64_t Value, const MachineRegisterInfo &MRI) const; - /// Return true if the specified operand is a G_GEP with a G_CONSTANT on the + /// Return true if the specified operand is a G_PTR_ADD with a G_CONSTANT on the /// right-hand side. GlobalISel's separation of pointer and integer types /// means that we don't need to worry about G_OR with equivalent semantics. bool isBaseWithConstantOffset(const MachineOperand &Root, |