Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:28

0001 //===- FastISel.h - Definition of the FastISel class ------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 ///
0009 /// \file
0010 /// This file defines the FastISel class.
0011 ///
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_CODEGEN_FASTISEL_H
0015 #define LLVM_CODEGEN_FASTISEL_H
0016 
0017 #include "llvm/ADT/DenseMap.h"
0018 #include "llvm/ADT/SmallVector.h"
0019 #include "llvm/ADT/StringRef.h"
0020 #include "llvm/CodeGen/MachineBasicBlock.h"
0021 #include "llvm/CodeGen/MachineInstrBuilder.h"
0022 #include "llvm/CodeGen/TargetLowering.h"
0023 #include "llvm/CodeGenTypes/MachineValueType.h"
0024 #include "llvm/IR/Attributes.h"
0025 #include "llvm/IR/CallingConv.h"
0026 #include "llvm/IR/DebugLoc.h"
0027 #include "llvm/IR/DerivedTypes.h"
0028 #include "llvm/IR/InstrTypes.h"
0029 #include <cstdint>
0030 #include <utility>
0031 
0032 namespace llvm {
0033 
0034 class AllocaInst;
0035 class Instruction;
0036 class IntrinsicInst;
0037 class BasicBlock;
0038 class CallInst;
0039 class Constant;
0040 class ConstantFP;
0041 class DataLayout;
0042 class FunctionLoweringInfo;
0043 class LoadInst;
0044 class MachineConstantPool;
0045 class MachineFrameInfo;
0046 class MachineFunction;
0047 class MachineInstr;
0048 class MachineMemOperand;
0049 class MachineOperand;
0050 class MachineRegisterInfo;
0051 class MCContext;
0052 class MCInstrDesc;
0053 class MCSymbol;
0054 class TargetInstrInfo;
0055 class TargetLibraryInfo;
0056 class TargetMachine;
0057 class TargetRegisterClass;
0058 class TargetRegisterInfo;
0059 class Type;
0060 class User;
0061 class Value;
0062 
0063 /// This is a fast-path instruction selection class that generates poor
0064 /// code and doesn't support illegal types or non-trivial lowering, but runs
0065 /// quickly.
0066 class FastISel {
0067 public:
0068   using ArgListEntry = TargetLoweringBase::ArgListEntry;
0069   using ArgListTy = TargetLoweringBase::ArgListTy;
0070   struct CallLoweringInfo {
0071     Type *RetTy = nullptr;
0072     bool RetSExt : 1;
0073     bool RetZExt : 1;
0074     bool IsVarArg : 1;
0075     bool IsInReg : 1;
0076     bool DoesNotReturn : 1;
0077     bool IsReturnValueUsed : 1;
0078     bool IsPatchPoint : 1;
0079 
0080     // IsTailCall Should be modified by implementations of FastLowerCall
0081     // that perform tail call conversions.
0082     bool IsTailCall = false;
0083 
0084     unsigned NumFixedArgs = -1;
0085     CallingConv::ID CallConv = CallingConv::C;
0086     const Value *Callee = nullptr;
0087     MCSymbol *Symbol = nullptr;
0088     ArgListTy Args;
0089     const CallBase *CB = nullptr;
0090     MachineInstr *Call = nullptr;
0091     Register ResultReg;
0092     unsigned NumResultRegs = 0;
0093 
0094     SmallVector<Value *, 16> OutVals;
0095     SmallVector<ISD::ArgFlagsTy, 16> OutFlags;
0096     SmallVector<Register, 16> OutRegs;
0097     SmallVector<ISD::InputArg, 4> Ins;
0098     SmallVector<Register, 4> InRegs;
0099 
0100     CallLoweringInfo()
0101         : RetSExt(false), RetZExt(false), IsVarArg(false), IsInReg(false),
0102           DoesNotReturn(false), IsReturnValueUsed(true), IsPatchPoint(false) {}
0103 
0104     CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
0105                                 const Value *Target, ArgListTy &&ArgsList,
0106                                 const CallBase &Call) {
0107       RetTy = ResultTy;
0108       Callee = Target;
0109 
0110       IsInReg = Call.hasRetAttr(Attribute::InReg);
0111       DoesNotReturn = Call.doesNotReturn();
0112       IsVarArg = FuncTy->isVarArg();
0113       IsReturnValueUsed = !Call.use_empty();
0114       RetSExt = Call.hasRetAttr(Attribute::SExt);
0115       RetZExt = Call.hasRetAttr(Attribute::ZExt);
0116 
0117       CallConv = Call.getCallingConv();
0118       Args = std::move(ArgsList);
0119       NumFixedArgs = FuncTy->getNumParams();
0120 
0121       CB = &Call;
0122 
0123       return *this;
0124     }
0125 
0126     CallLoweringInfo &setCallee(Type *ResultTy, FunctionType *FuncTy,
0127                                 MCSymbol *Target, ArgListTy &&ArgsList,
0128                                 const CallBase &Call,
0129                                 unsigned FixedArgs = ~0U) {
0130       RetTy = ResultTy;
0131       Callee = Call.getCalledOperand();
0132       Symbol = Target;
0133 
0134       IsInReg = Call.hasRetAttr(Attribute::InReg);
0135       DoesNotReturn = Call.doesNotReturn();
0136       IsVarArg = FuncTy->isVarArg();
0137       IsReturnValueUsed = !Call.use_empty();
0138       RetSExt = Call.hasRetAttr(Attribute::SExt);
0139       RetZExt = Call.hasRetAttr(Attribute::ZExt);
0140 
0141       CallConv = Call.getCallingConv();
0142       Args = std::move(ArgsList);
0143       NumFixedArgs = (FixedArgs == ~0U) ? FuncTy->getNumParams() : FixedArgs;
0144 
0145       CB = &Call;
0146 
0147       return *this;
0148     }
0149 
0150     CallLoweringInfo &setCallee(CallingConv::ID CC, Type *ResultTy,
0151                                 const Value *Target, ArgListTy &&ArgsList,
0152                                 unsigned FixedArgs = ~0U) {
0153       RetTy = ResultTy;
0154       Callee = Target;
0155       CallConv = CC;
0156       Args = std::move(ArgsList);
0157       NumFixedArgs = (FixedArgs == ~0U) ? Args.size() : FixedArgs;
0158       return *this;
0159     }
0160 
0161     CallLoweringInfo &setCallee(const DataLayout &DL, MCContext &Ctx,
0162                                 CallingConv::ID CC, Type *ResultTy,
0163                                 StringRef Target, ArgListTy &&ArgsList,
0164                                 unsigned FixedArgs = ~0U);
0165 
0166     CallLoweringInfo &setCallee(CallingConv::ID CC, Type *ResultTy,
0167                                 MCSymbol *Target, ArgListTy &&ArgsList,
0168                                 unsigned FixedArgs = ~0U) {
0169       RetTy = ResultTy;
0170       Symbol = Target;
0171       CallConv = CC;
0172       Args = std::move(ArgsList);
0173       NumFixedArgs = (FixedArgs == ~0U) ? Args.size() : FixedArgs;
0174       return *this;
0175     }
0176 
0177     CallLoweringInfo &setTailCall(bool Value = true) {
0178       IsTailCall = Value;
0179       return *this;
0180     }
0181 
0182     CallLoweringInfo &setIsPatchPoint(bool Value = true) {
0183       IsPatchPoint = Value;
0184       return *this;
0185     }
0186 
0187     ArgListTy &getArgs() { return Args; }
0188 
0189     void clearOuts() {
0190       OutVals.clear();
0191       OutFlags.clear();
0192       OutRegs.clear();
0193     }
0194 
0195     void clearIns() {
0196       Ins.clear();
0197       InRegs.clear();
0198     }
0199   };
0200 
0201 protected:
0202   DenseMap<const Value *, Register> LocalValueMap;
0203   FunctionLoweringInfo &FuncInfo;
0204   MachineFunction *MF;
0205   MachineRegisterInfo &MRI;
0206   MachineFrameInfo &MFI;
0207   MachineConstantPool &MCP;
0208   MIMetadata MIMD;
0209   const TargetMachine &TM;
0210   const DataLayout &DL;
0211   const TargetInstrInfo &TII;
0212   const TargetLowering &TLI;
0213   const TargetRegisterInfo &TRI;
0214   const TargetLibraryInfo *LibInfo;
0215   bool SkipTargetIndependentISel;
0216 
0217   /// The position of the last instruction for materializing constants
0218   /// for use in the current block. It resets to EmitStartPt when it makes sense
0219   /// (for example, it's usually profitable to avoid function calls between the
0220   /// definition and the use)
0221   MachineInstr *LastLocalValue = nullptr;
0222 
0223   /// The top most instruction in the current block that is allowed for
0224   /// emitting local variables. LastLocalValue resets to EmitStartPt when it
0225   /// makes sense (for example, on function calls)
0226   MachineInstr *EmitStartPt = nullptr;
0227 
0228 public:
0229   virtual ~FastISel();
0230 
0231   /// Return the position of the last instruction emitted for
0232   /// materializing constants for use in the current block.
0233   MachineInstr *getLastLocalValue() { return LastLocalValue; }
0234 
0235   /// Update the position of the last instruction emitted for
0236   /// materializing constants for use in the current block.
0237   void setLastLocalValue(MachineInstr *I) {
0238     EmitStartPt = I;
0239     LastLocalValue = I;
0240   }
0241 
0242   /// Set the current block to which generated machine instructions will
0243   /// be appended.
0244   void startNewBlock();
0245 
0246   /// Flush the local value map.
0247   void finishBasicBlock();
0248 
0249   /// Return current debug location information.
0250   DebugLoc getCurDebugLoc() const { return MIMD.getDL(); }
0251 
0252   /// Do "fast" instruction selection for function arguments and append
0253   /// the machine instructions to the current block. Returns true when
0254   /// successful.
0255   bool lowerArguments();
0256 
0257   /// Do "fast" instruction selection for the given LLVM IR instruction
0258   /// and append the generated machine instructions to the current block.
0259   /// Returns true if selection was successful.
0260   bool selectInstruction(const Instruction *I);
0261 
0262   /// Do "fast" instruction selection for the given LLVM IR operator
0263   /// (Instruction or ConstantExpr), and append generated machine instructions
0264   /// to the current block. Return true if selection was successful.
0265   bool selectOperator(const User *I, unsigned Opcode);
0266 
0267   /// Create a virtual register and arrange for it to be assigned the
0268   /// value for the given LLVM value.
0269   Register getRegForValue(const Value *V);
0270 
0271   /// Look up the value to see if its value is already cached in a
0272   /// register. It may be defined by instructions across blocks or defined
0273   /// locally.
0274   Register lookUpRegForValue(const Value *V);
0275 
0276   /// This is a wrapper around getRegForValue that also takes care of
0277   /// truncating or sign-extending the given getelementptr index value.
0278   Register getRegForGEPIndex(MVT PtrVT, const Value *Idx);
0279 
0280   /// We're checking to see if we can fold \p LI into \p FoldInst. Note
0281   /// that we could have a sequence where multiple LLVM IR instructions are
0282   /// folded into the same machineinstr.  For example we could have:
0283   ///
0284   ///   A: x = load i32 *P
0285   ///   B: y = icmp A, 42
0286   ///   C: br y, ...
0287   ///
0288   /// In this scenario, \p LI is "A", and \p FoldInst is "C".  We know about "B"
0289   /// (and any other folded instructions) because it is between A and C.
0290   ///
0291   /// If we succeed folding, return true.
0292   bool tryToFoldLoad(const LoadInst *LI, const Instruction *FoldInst);
0293 
0294   /// The specified machine instr operand is a vreg, and that vreg is
0295   /// being provided by the specified load instruction.  If possible, try to
0296   /// fold the load as an operand to the instruction, returning true if
0297   /// possible.
0298   ///
0299   /// This method should be implemented by targets.
0300   virtual bool tryToFoldLoadIntoMI(MachineInstr * /*MI*/, unsigned /*OpNo*/,
0301                                    const LoadInst * /*LI*/) {
0302     return false;
0303   }
0304 
0305   /// Reset InsertPt to prepare for inserting instructions into the
0306   /// current block.
0307   void recomputeInsertPt();
0308 
0309   /// Remove all dead instructions between the I and E.
0310   void removeDeadCode(MachineBasicBlock::iterator I,
0311                       MachineBasicBlock::iterator E);
0312 
0313   using SavePoint = MachineBasicBlock::iterator;
0314 
0315   /// Prepare InsertPt to begin inserting instructions into the local
0316   /// value area and return the old insert position.
0317   SavePoint enterLocalValueArea();
0318 
0319   /// Reset InsertPt to the given old insert position.
0320   void leaveLocalValueArea(SavePoint Old);
0321 
0322   /// Target-independent lowering of non-instruction debug info associated with
0323   /// this instruction.
0324   void handleDbgInfo(const Instruction *II);
0325 
0326 protected:
0327   explicit FastISel(FunctionLoweringInfo &FuncInfo,
0328                     const TargetLibraryInfo *LibInfo,
0329                     bool SkipTargetIndependentISel = false);
0330 
0331   /// This method is called by target-independent code when the normal
0332   /// FastISel process fails to select an instruction. This gives targets a
0333   /// chance to emit code for anything that doesn't fit into FastISel's
0334   /// framework. It returns true if it was successful.
0335   virtual bool fastSelectInstruction(const Instruction *I) = 0;
0336 
0337   /// This method is called by target-independent code to do target-
0338   /// specific argument lowering. It returns true if it was successful.
0339   virtual bool fastLowerArguments();
0340 
0341   /// This method is called by target-independent code to do target-
0342   /// specific call lowering. It returns true if it was successful.
0343   virtual bool fastLowerCall(CallLoweringInfo &CLI);
0344 
0345   /// This method is called by target-independent code to do target-
0346   /// specific intrinsic lowering. It returns true if it was successful.
0347   virtual bool fastLowerIntrinsicCall(const IntrinsicInst *II);
0348 
0349   /// This method is called by target-independent code to request that an
0350   /// instruction with the given type and opcode be emitted.
0351   virtual unsigned fastEmit_(MVT VT, MVT RetVT, unsigned Opcode);
0352 
0353   /// This method is called by target-independent code to request that an
0354   /// instruction with the given type, opcode, and register operand be emitted.
0355   virtual unsigned fastEmit_r(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0);
0356 
0357   /// This method is called by target-independent code to request that an
0358   /// instruction with the given type, opcode, and register operands be emitted.
0359   virtual unsigned fastEmit_rr(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0,
0360                                unsigned Op1);
0361 
0362   /// This method is called by target-independent code to request that an
0363   /// instruction with the given type, opcode, and register and immediate
0364   /// operands be emitted.
0365   virtual unsigned fastEmit_ri(MVT VT, MVT RetVT, unsigned Opcode, unsigned Op0,
0366                                uint64_t Imm);
0367 
0368   /// This method is a wrapper of fastEmit_ri.
0369   ///
0370   /// It first tries to emit an instruction with an immediate operand using
0371   /// fastEmit_ri.  If that fails, it materializes the immediate into a register
0372   /// and try fastEmit_rr instead.
0373   Register fastEmit_ri_(MVT VT, unsigned Opcode, unsigned Op0, uint64_t Imm,
0374                         MVT ImmType);
0375 
0376   /// This method is called by target-independent code to request that an
0377   /// instruction with the given type, opcode, and immediate operand be emitted.
0378   virtual unsigned fastEmit_i(MVT VT, MVT RetVT, unsigned Opcode, uint64_t Imm);
0379 
0380   /// This method is called by target-independent code to request that an
0381   /// instruction with the given type, opcode, and floating-point immediate
0382   /// operand be emitted.
0383   virtual unsigned fastEmit_f(MVT VT, MVT RetVT, unsigned Opcode,
0384                               const ConstantFP *FPImm);
0385 
0386   /// Emit a MachineInstr with no operands and a result register in the
0387   /// given register class.
0388   Register fastEmitInst_(unsigned MachineInstOpcode,
0389                          const TargetRegisterClass *RC);
0390 
0391   /// Emit a MachineInstr with one register operand and a result register
0392   /// in the given register class.
0393   Register fastEmitInst_r(unsigned MachineInstOpcode,
0394                           const TargetRegisterClass *RC, unsigned Op0);
0395 
0396   /// Emit a MachineInstr with two register operands and a result
0397   /// register in the given register class.
0398   Register fastEmitInst_rr(unsigned MachineInstOpcode,
0399                            const TargetRegisterClass *RC, unsigned Op0,
0400                            unsigned Op1);
0401 
0402   /// Emit a MachineInstr with three register operands and a result
0403   /// register in the given register class.
0404   Register fastEmitInst_rrr(unsigned MachineInstOpcode,
0405                             const TargetRegisterClass *RC, unsigned Op0,
0406                             unsigned Op1, unsigned Op2);
0407 
0408   /// Emit a MachineInstr with a register operand, an immediate, and a
0409   /// result register in the given register class.
0410   Register fastEmitInst_ri(unsigned MachineInstOpcode,
0411                            const TargetRegisterClass *RC, unsigned Op0,
0412                            uint64_t Imm);
0413 
0414   /// Emit a MachineInstr with one register operand and two immediate
0415   /// operands.
0416   Register fastEmitInst_rii(unsigned MachineInstOpcode,
0417                             const TargetRegisterClass *RC, unsigned Op0,
0418                             uint64_t Imm1, uint64_t Imm2);
0419 
0420   /// Emit a MachineInstr with a floating point immediate, and a result
0421   /// register in the given register class.
0422   Register fastEmitInst_f(unsigned MachineInstOpcode,
0423                           const TargetRegisterClass *RC,
0424                           const ConstantFP *FPImm);
0425 
0426   /// Emit a MachineInstr with two register operands, an immediate, and a
0427   /// result register in the given register class.
0428   Register fastEmitInst_rri(unsigned MachineInstOpcode,
0429                             const TargetRegisterClass *RC, unsigned Op0,
0430                             unsigned Op1, uint64_t Imm);
0431 
0432   /// Emit a MachineInstr with a single immediate operand, and a result
0433   /// register in the given register class.
0434   Register fastEmitInst_i(unsigned MachineInstOpcode,
0435                           const TargetRegisterClass *RC, uint64_t Imm);
0436 
0437   /// Emit a MachineInstr for an extract_subreg from a specified index of
0438   /// a superregister to a specified type.
0439   Register fastEmitInst_extractsubreg(MVT RetVT, unsigned Op0, uint32_t Idx);
0440 
0441   /// Emit MachineInstrs to compute the value of Op with all but the
0442   /// least significant bit set to zero.
0443   Register fastEmitZExtFromI1(MVT VT, unsigned Op0);
0444 
0445   /// Emit an unconditional branch to the given block, unless it is the
0446   /// immediate (fall-through) successor, and update the CFG.
0447   void fastEmitBranch(MachineBasicBlock *MSucc, const DebugLoc &DbgLoc);
0448 
0449   /// Emit an unconditional branch to \p FalseMBB, obtains the branch weight
0450   /// and adds TrueMBB and FalseMBB to the successor list.
0451   void finishCondBranch(const BasicBlock *BranchBB, MachineBasicBlock *TrueMBB,
0452                         MachineBasicBlock *FalseMBB);
0453 
0454   /// Update the value map to include the new mapping for this
0455   /// instruction, or insert an extra copy to get the result in a previous
0456   /// determined register.
0457   ///
0458   /// NOTE: This is only necessary because we might select a block that uses a
0459   /// value before we select the block that defines the value. It might be
0460   /// possible to fix this by selecting blocks in reverse postorder.
0461   void updateValueMap(const Value *I, Register Reg, unsigned NumRegs = 1);
0462 
0463   Register createResultReg(const TargetRegisterClass *RC);
0464 
0465   /// Try to constrain Op so that it is usable by argument OpNum of the
0466   /// provided MCInstrDesc. If this fails, create a new virtual register in the
0467   /// correct class and COPY the value there.
0468   Register constrainOperandRegClass(const MCInstrDesc &II, Register Op,
0469                                     unsigned OpNum);
0470 
0471   /// Emit a constant in a register using target-specific logic, such as
0472   /// constant pool loads.
0473   virtual unsigned fastMaterializeConstant(const Constant *C) { return 0; }
0474 
0475   /// Emit an alloca address in a register using target-specific logic.
0476   virtual unsigned fastMaterializeAlloca(const AllocaInst *C) { return 0; }
0477 
0478   /// Emit the floating-point constant +0.0 in a register using target-
0479   /// specific logic.
0480   virtual unsigned fastMaterializeFloatZero(const ConstantFP *CF) {
0481     return 0;
0482   }
0483 
0484   /// Check if \c Add is an add that can be safely folded into \c GEP.
0485   ///
0486   /// \c Add can be folded into \c GEP if:
0487   /// - \c Add is an add,
0488   /// - \c Add's size matches \c GEP's,
0489   /// - \c Add is in the same basic block as \c GEP, and
0490   /// - \c Add has a constant operand.
0491   bool canFoldAddIntoGEP(const User *GEP, const Value *Add);
0492 
0493   /// Create a machine mem operand from the given instruction.
0494   MachineMemOperand *createMachineMemOperandFor(const Instruction *I) const;
0495 
0496   CmpInst::Predicate optimizeCmpPredicate(const CmpInst *CI) const;
0497 
0498   bool lowerCallTo(const CallInst *CI, MCSymbol *Symbol, unsigned NumArgs);
0499   bool lowerCallTo(const CallInst *CI, const char *SymName,
0500                    unsigned NumArgs);
0501   bool lowerCallTo(CallLoweringInfo &CLI);
0502 
0503   bool lowerCall(const CallInst *I);
0504   /// Select and emit code for a binary operator instruction, which has
0505   /// an opcode which directly corresponds to the given ISD opcode.
0506   bool selectBinaryOp(const User *I, unsigned ISDOpcode);
0507   bool selectFNeg(const User *I, const Value *In);
0508   bool selectGetElementPtr(const User *I);
0509   bool selectStackmap(const CallInst *I);
0510   bool selectPatchpoint(const CallInst *I);
0511   bool selectCall(const User *I);
0512   bool selectIntrinsicCall(const IntrinsicInst *II);
0513   bool selectBitCast(const User *I);
0514   bool selectFreeze(const User *I);
0515   bool selectCast(const User *I, unsigned Opcode);
0516   bool selectExtractValue(const User *U);
0517   bool selectXRayCustomEvent(const CallInst *II);
0518   bool selectXRayTypedEvent(const CallInst *II);
0519 
0520   bool shouldOptForSize(const MachineFunction *MF) const {
0521     // TODO: Implement PGSO.
0522     return MF->getFunction().hasOptSize();
0523   }
0524 
0525   /// Target-independent lowering of debug information. Returns false if the
0526   /// debug information couldn't be lowered and was instead discarded.
0527   virtual bool lowerDbgValue(const Value *V, DIExpression *Expr,
0528                              DILocalVariable *Var, const DebugLoc &DL);
0529 
0530   /// Target-independent lowering of debug information. Returns false if the
0531   /// debug information couldn't be lowered and was instead discarded.
0532   virtual bool lowerDbgDeclare(const Value *V, DIExpression *Expr,
0533                                DILocalVariable *Var, const DebugLoc &DL);
0534 
0535 private:
0536   /// Handle PHI nodes in successor blocks.
0537   ///
0538   /// Emit code to ensure constants are copied into registers when needed.
0539   /// Remember the virtual registers that need to be added to the Machine PHI
0540   /// nodes as input.  We cannot just directly add them, because expansion might
0541   /// result in multiple MBB's for one BB.  As such, the start of the BB might
0542   /// correspond to a different MBB than the end.
0543   bool handlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
0544 
0545   /// Helper for materializeRegForValue to materialize a constant in a
0546   /// target-independent way.
0547   Register materializeConstant(const Value *V, MVT VT);
0548 
0549   /// Helper for getRegForVale. This function is called when the value
0550   /// isn't already available in a register and must be materialized with new
0551   /// instructions.
0552   Register materializeRegForValue(const Value *V, MVT VT);
0553 
0554   /// Clears LocalValueMap and moves the area for the new local variables
0555   /// to the beginning of the block. It helps to avoid spilling cached variables
0556   /// across heavy instructions like calls.
0557   void flushLocalValueMap();
0558 
0559   /// Removes dead local value instructions after SavedLastLocalvalue.
0560   void removeDeadLocalValueCode(MachineInstr *SavedLastLocalValue);
0561 
0562   /// Insertion point before trying to select the current instruction.
0563   MachineBasicBlock::iterator SavedInsertPt;
0564 
0565   /// Add a stackmap or patchpoint intrinsic call's live variable
0566   /// operands to a stackmap or patchpoint machine instruction.
0567   bool addStackMapLiveVars(SmallVectorImpl<MachineOperand> &Ops,
0568                            const CallInst *CI, unsigned StartIdx);
0569   bool lowerCallOperands(const CallInst *CI, unsigned ArgIdx, unsigned NumArgs,
0570                          const Value *Callee, bool ForceRetVoidTy,
0571                          CallLoweringInfo &CLI);
0572 };
0573 
0574 } // end namespace llvm
0575 
0576 #endif // LLVM_CODEGEN_FASTISEL_H