14#ifndef LLVM_CODEGEN_GLOBALISEL_UTILS_H
15#define LLVM_CODEGEN_GLOBALISEL_UTILS_H
57#define GISEL_VECREDUCE_CASES_ALL \
58 case TargetOpcode::G_VECREDUCE_SEQ_FADD: \
59 case TargetOpcode::G_VECREDUCE_SEQ_FMUL: \
60 case TargetOpcode::G_VECREDUCE_FADD: \
61 case TargetOpcode::G_VECREDUCE_FMUL: \
62 case TargetOpcode::G_VECREDUCE_FMAX: \
63 case TargetOpcode::G_VECREDUCE_FMIN: \
64 case TargetOpcode::G_VECREDUCE_FMAXIMUM: \
65 case TargetOpcode::G_VECREDUCE_FMINIMUM: \
66 case TargetOpcode::G_VECREDUCE_ADD: \
67 case TargetOpcode::G_VECREDUCE_MUL: \
68 case TargetOpcode::G_VECREDUCE_AND: \
69 case TargetOpcode::G_VECREDUCE_OR: \
70 case TargetOpcode::G_VECREDUCE_XOR: \
71 case TargetOpcode::G_VECREDUCE_SMAX: \
72 case TargetOpcode::G_VECREDUCE_SMIN: \
73 case TargetOpcode::G_VECREDUCE_UMAX: \
74 case TargetOpcode::G_VECREDUCE_UMIN:
76#define GISEL_VECREDUCE_CASES_NONSEQ \
77 case TargetOpcode::G_VECREDUCE_FADD: \
78 case TargetOpcode::G_VECREDUCE_FMUL: \
79 case TargetOpcode::G_VECREDUCE_FMAX: \
80 case TargetOpcode::G_VECREDUCE_FMIN: \
81 case TargetOpcode::G_VECREDUCE_FMAXIMUM: \
82 case TargetOpcode::G_VECREDUCE_FMINIMUM: \
83 case TargetOpcode::G_VECREDUCE_ADD: \
84 case TargetOpcode::G_VECREDUCE_MUL: \
85 case TargetOpcode::G_VECREDUCE_AND: \
86 case TargetOpcode::G_VECREDUCE_OR: \
87 case TargetOpcode::G_VECREDUCE_XOR: \
88 case TargetOpcode::G_VECREDUCE_SMAX: \
89 case TargetOpcode::G_VECREDUCE_SMIN: \
90 case TargetOpcode::G_VECREDUCE_UMAX: \
91 case TargetOpcode::G_VECREDUCE_UMIN:
98 const TargetInstrInfo &
TII,
100 const TargetRegisterClass &RegClass);
111 const MachineFunction &MF,
const TargetRegisterInfo &
TRI,
112 MachineRegisterInfo &MRI,
const TargetInstrInfo &
TII,
113 const RegisterBankInfo &RBI, MachineInstr &InsertPt,
114 const TargetRegisterClass &RegClass, MachineOperand &RegMO);
127 const MachineFunction &MF,
const TargetRegisterInfo &
TRI,
128 MachineRegisterInfo &MRI,
const TargetInstrInfo &
TII,
129 const RegisterBankInfo &RBI, MachineInstr &InsertPt,
const MCInstrDesc &
II,
130 MachineOperand &RegMO,
unsigned OpIdx);
140 const TargetInstrInfo &
TII,
141 const TargetRegisterInfo &
TRI,
142 const RegisterBankInfo &RBI);
147 MachineRegisterInfo &MRI);
152 const MachineRegisterInfo &MRI);
157 MachineOptimizationRemarkEmitter &
MORE,
158 MachineOptimizationRemarkMissed &R);
161 MachineOptimizationRemarkEmitter &
MORE,
162 const char *
PassName, StringRef Msg,
163 const MachineInstr &
MI);
168 MachineOptimizationRemarkEmitter &
MORE,
169 MachineOptimizationRemarkMissed &R);
185 const MachineRegisterInfo &MRI);
199 bool LookThroughInstrs =
true);
205 bool LookThroughInstrs =
true,
bool LookThroughAnyExt =
false);
208 std::tuple<Register, Register, uint64_t, Align, bool, std::vector<LLT>>;
216 Align &Alignment,
bool &DstAlignCanChange,
217 std::vector<LLT> &MemOps);
226LLVM_ABI std::optional<FPValueAndVReg>
229 bool LookThroughInstrs =
true);
251LLVM_ABI std::optional<DefinitionAndSourceRegister>
311 const MachineRegisterInfo &MRI);
314 const MachineRegisterInfo &MRI);
320 const MachineRegisterInfo &MRI);
324 const MachineRegisterInfo &MRI);
329 const MachineRegisterInfo &MRI);
333 const MachineRegisterInfo &MRI);
340 const MachineRegisterInfo &MRI);
342LLVM_ABI std::optional<SmallVector<APInt>>
344 unsigned DstScalarSizeInBits,
unsigned ExtOp,
345 const MachineRegisterInfo &MRI);
354 GISelValueTracking *ValueTracking =
nullptr,
355 bool OrNegative =
false);
358 const MachinePointerInfo &MPO);
367 MachineFunction &MF,
const TargetInstrInfo &
TII, MCRegister PhysReg,
368 const TargetRegisterClass &RC,
const DebugLoc &
DL, LLT RegTy = LLT());
416 bool isReg()
const {
return IsReg; }
417 bool isCst()
const {
return !IsReg; }
449 const MachineRegisterInfo &MRI);
453LLVM_ABI std::optional<FPValueAndVReg>
455 bool AllowUndef =
true);
460 const MachineRegisterInfo &MRI,
461 int64_t SplatValue,
bool AllowUndef);
466 const MachineRegisterInfo &MRI,
467 const APInt &SplatValue,
473 const MachineRegisterInfo &MRI,
474 int64_t SplatValue,
bool AllowUndef);
479 const MachineRegisterInfo &MRI,
480 const APInt &SplatValue,
486 const MachineRegisterInfo &MRI,
487 bool AllowUndef =
false);
492 const MachineRegisterInfo &MRI,
493 bool AllowUndef =
false);
502 const MachineRegisterInfo &MRI,
504 bool AllowOpaqueConstants =
true);
511 const MachineRegisterInfo &MRI,
512 bool AllowUndefs =
false);
517 const MachineRegisterInfo &MRI,
518 bool AllowUndefs =
false);
539LLVM_ABI std::optional<RegOrConstant>
545 const MachineRegisterInfo &MRI);
552 const MachineRegisterInfo &MRI);
559 const MachineRegisterInfo &MRI);
566 std::function<
bool(
const Constant *ConstVal)> Match,
567 bool AllowUndefs =
false);
572 bool IsVector,
bool IsFP);
576 bool IsVector,
bool IsFP);
610 bool ConsiderFlagsAndMetadata =
true);
614 bool ConsiderFlagsAndMetadata =
true);
666 : Kind(Kind), Value(Value) {};
674 LLVM_ABI static std::optional<GIConstant>
707 Values.push_back(
Value);
715 "Expected fixed vector or scalar constant");
716 return Values.begin();
719 const_iterator
end()
const {
721 "Expected fixed vector or scalar constant");
727 return Values.size();
733 LLVM_ABI static std::optional<GFConstant>
MachineInstrBuilder MachineInstrBuilder & DefMI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
const HexagonInstrInfo * TII
Implement a low-level type suitable for MachineInstr level instruction selection.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
MachineInstr unsigned OpIdx
uint64_t IntrinsicInst * II
static const char PassName[]
Class for arbitrary precision integers.
Represent the analysis usage information of a pass.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
BlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate IR basic block frequen...
ConstantFP - Floating Point Values [float, double].
const_iterator begin() const
static LLVM_ABI std::optional< GFConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
GFConstant(const APFloat &Value, GFConstantKind Kind)
GFConstant(ArrayRef< APFloat > Values)
GFConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
LLVM_ABI APFloat getScalarValue() const
Returns the value, if this constant is a scalar.
const_iterator end() const
LLVM_ABI APInt getScalarValue() const
Returns the value, if this constant is a scalar.
GIConstant(const APInt &Value, GIConstantKind Kind)
static LLVM_ABI std::optional< GIConstant > getConstant(Register Const, const MachineRegisterInfo &MRI)
GIConstantKind getKind() const
Returns the kind of of this constant, e.g, Scalar.
GIConstant(ArrayRef< APInt > Values)
This is an important class for using LLVM in a threaded context.
Describe properties that are true of each instruction in the target description file.
Helper class to build MachineInstr.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Analysis providing profile information.
RegOrConstant(Register Reg)
RegOrConstant(int64_t Cst)
Holds all the information related to register banks.
Wrapper class representing virtual and physical registers.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetInstrInfo - Interface to description of machine instruction set.
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
Target-Independent Code Generator Pass Configuration Options.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI Register getFunctionLiveInPhysReg(MachineFunction &MF, const TargetInstrInfo &TII, MCRegister PhysReg, const TargetRegisterClass &RC, const DebugLoc &DL, LLT RegTy=LLT())
Return a virtual register corresponding to the incoming argument register PhysReg.
LLVM_ABI std::optional< SmallVector< APInt > > ConstantFoldICmp(unsigned Pred, const Register Op1, const Register Op2, unsigned DstScalarSizeInBits, unsigned ExtOp, const MachineRegisterInfo &MRI)
LLVM_ABI bool isBuildVectorAllZeros(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndef=false)
Return true if the specified instruction is a G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all of the...
LLVM_ABI Type * getTypeForLLT(LLT Ty, LLVMContext &C)
Get the type back from LLT.
LLVM_ABI Register constrainOperandRegClass(const MachineFunction &MF, const TargetRegisterInfo &TRI, MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, MachineInstr &InsertPt, const TargetRegisterClass &RegClass, MachineOperand &RegMO)
Constrain the Register operand OpIdx, so that it is now constrained to the TargetRegisterClass passed...
LLVM_ABI MachineInstr * getOpcodeDef(unsigned Opcode, Register Reg, const MachineRegisterInfo &MRI)
See if Reg is defined by an single def instruction that is Opcode.
LLVM_ABI const ConstantFP * getConstantFPVRegVal(Register VReg, const MachineRegisterInfo &MRI)
LLVM_ABI bool canCreatePoison(const Operator *Op, bool ConsiderFlagsAndMetadata=true)
LLVM_ABI std::optional< APInt > getIConstantVRegVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT, return the corresponding value.
LLVM_ABI std::optional< APFloat > ConstantFoldIntToFloat(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
LLVM_ABI std::optional< APInt > getIConstantSplatVal(const Register Reg, const MachineRegisterInfo &MRI)
LLVM_ABI bool isAllOnesOrAllOnesSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant -1 integer or a splatted vector of a constant -1 integer (with...
LLVM_ABI std::optional< APFloat > ConstantFoldFPBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
LLVM_ABI void salvageDebugInfo(const MachineRegisterInfo &MRI, MachineInstr &MI)
Assuming the instruction MI is going to be deleted, attempt to salvage debug users of MI by writing t...
LLVM_ABI void constrainSelectedInstRegOperands(MachineInstr &I, const TargetInstrInfo &TII, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI)
Mutate the newly-selected instruction I to constrain its (possibly generic) virtual register operands...
LLVM_ABI std::optional< APInt > ConstantFoldExtOp(unsigned Opcode, const Register Op1, uint64_t Imm, const MachineRegisterInfo &MRI)
LLVM_ABI std::optional< RegOrConstant > getVectorSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI)
GISelWorkList< 4 > SmallInstListTy
LLVM_ABI std::optional< APInt > isConstantOrConstantSplatVector(MachineInstr &MI, const MachineRegisterInfo &MRI)
Determines if MI defines a constant integer or a splat vector of constant integers.
LLVM_ABI bool isNullOrNullSplat(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndefs=false)
Return true if the value is a constant 0 integer or a splatted vector of a constant 0 integer (with n...
LLVM_ABI MachineInstr * getDefIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, folding away any trivial copies.
LLVM_ABI bool matchUnaryPredicate(const MachineRegisterInfo &MRI, Register Reg, std::function< bool(const Constant *ConstVal)> Match, bool AllowUndefs=false)
Attempt to match a unary predicate against a scalar/splat constant or every element of a constant G_B...
LLVM_ABI void reportGISelWarning(MachineFunction &MF, MachineOptimizationRemarkEmitter &MORE, MachineOptimizationRemarkMissed &R)
Report an ISel warning as a missed optimization remark to the LLVMContext's diagnostic stream.
LLVM_ABI bool isGuaranteedNotToBeUndef(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Returns true if V cannot be undef, but may be poison.
LLVM_ABI bool isConstTrueVal(const TargetLowering &TLI, int64_t Val, bool IsVector, bool IsFP)
Returns true if given the TargetLowering's boolean contents information, the value Val contains a tru...
LLVM_ABI LLVM_READNONE LLT getLCMType(LLT OrigTy, LLT TargetTy)
Return the least common multiple type of OrigTy and TargetTy, by changing the number of vector elemen...
LLVM_ABI std::optional< int64_t > getIConstantVRegSExtVal(Register VReg, const MachineRegisterInfo &MRI)
If VReg is defined by a G_CONSTANT fits in int64_t returns it.
LLVM_ABI std::optional< APInt > ConstantFoldBinOp(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
auto dyn_cast_or_null(const Y &Val)
LLVM_ABI const APInt & getIConstantFromReg(Register VReg, const MachineRegisterInfo &MRI)
VReg is defined by a G_CONSTANT, return the corresponding value.
LLVM_ABI bool isConstantOrConstantVector(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowFP=true, bool AllowOpaqueConstants=true)
Return true if the specified instruction is known to be a constant, or a vector of constants.
LLVM_ABI bool canReplaceReg(Register DstReg, Register SrcReg, MachineRegisterInfo &MRI)
Check if DstReg can be replaced with SrcReg depending on the register constraints.
LLVM_ABI void saveUsesAndErase(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver, SmallInstListTy &DeadInstChain)
LLVM_ABI void reportGISelFailure(MachineFunction &MF, MachineOptimizationRemarkEmitter &MORE, MachineOptimizationRemarkMissed &R)
Report an ISel error as a missed optimization remark to the LLVMContext's diagnostic stream.
std::tuple< Register, Register, uint64_t, Align, bool, std::vector< LLT > > MemCpyFamilyLoweringInfo
LLVM_ABI std::optional< ValueAndVReg > getAnyConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true, bool LookThroughAnyExt=false)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT or G_FCONST...
LLVM_ABI bool isBuildVectorAllOnes(const MachineInstr &MI, const MachineRegisterInfo &MRI, bool AllowUndef=false)
Return true if the specified instruction is a G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all of the...
LLVM_ABI bool canCreateUndefOrPoison(const Operator *Op, bool ConsiderFlagsAndMetadata=true)
canCreateUndefOrPoison returns true if Op can create undef or poison from non-undef & non-poison oper...
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
LLVM_ABI SmallVector< APInt > ConstantFoldVectorBinop(unsigned Opcode, const Register Op1, const Register Op2, const MachineRegisterInfo &MRI)
Tries to constant fold a vector binop with sources Op1 and Op2.
LLVM_ABI std::optional< FPValueAndVReg > getFConstantSplat(Register VReg, const MachineRegisterInfo &MRI, bool AllowUndef=true)
Returns a floating point scalar constant of a build vector splat if it exists.
LLVM_ABI std::optional< APInt > ConstantFoldCastOp(unsigned Opcode, LLT DstTy, const Register Op0, const MachineRegisterInfo &MRI)
LLVM_ABI void extractParts(Register Reg, LLT Ty, int NumParts, SmallVectorImpl< Register > &VRegs, MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Helper function to split a wide generic register into bitwise blocks with the given Type (which impli...
LLVM_ABI void getSelectionDAGFallbackAnalysisUsage(AnalysisUsage &AU)
Modify analysis usage so it preserves passes required for the SelectionDAG fallback.
LLVM_ABI bool canLowerMemCpyFamily(const MachineInstr &MI, const MachineRegisterInfo &MRI, unsigned MaxLen, Register &Dst, Register &Src, uint64_t &KnownLen, Align &Alignment, bool &DstAlignCanChange, std::vector< LLT > &MemOps)
Matcher for memcpy-like instructions.
LLVM_ABI LLVM_READNONE LLT getCoverTy(LLT OrigTy, LLT TargetTy)
Return smallest type that covers both OrigTy and TargetTy and is multiple of TargetTy.
LLVM_ABI unsigned getInverseGMinMaxOpcode(unsigned MinMaxOpc)
Returns the inverse opcode of MinMaxOpc, which is a generic min/max opcode like G_SMIN.
LLVM_ABI bool isGuaranteedNotToBeUndefOrPoison(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Return true if this function can prove that V does not have undef bits and is never poison.
LLVM_ABI std::optional< FPValueAndVReg > getFConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_FCONSTANT returns it...
LLVM_ABI bool isConstFalseVal(const TargetLowering &TLI, int64_t Val, bool IsVector, bool IsFP)
LLVM_ABI std::optional< APFloat > isConstantOrConstantSplatVectorFP(MachineInstr &MI, const MachineRegisterInfo &MRI)
Determines if MI defines a float constant integer or a splat vector of float constant integers.
LLVM_ABI APFloat getAPFloatFromSize(double Val, unsigned Size)
Returns an APFloat from Val converted to the appropriate size.
LLVM_ABI bool isBuildVectorConstantSplat(const Register Reg, const MachineRegisterInfo &MRI, int64_t SplatValue, bool AllowUndef)
Return true if the specified register is defined by G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC where all ...
LLVM_ABI void eraseInstr(MachineInstr &MI, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
LLVM_ABI Register constrainRegToClass(MachineRegisterInfo &MRI, const TargetInstrInfo &TII, const RegisterBankInfo &RBI, Register Reg, const TargetRegisterClass &RegClass)
Try to constrain Reg to the specified register class.
LLVM_ABI int64_t getICmpTrueVal(const TargetLowering &TLI, bool IsVector, bool IsFP)
Returns an integer representing true, as defined by the TargetBooleanContents.
LLVM_ABI std::optional< ValueAndVReg > getIConstantVRegValWithLookThrough(Register VReg, const MachineRegisterInfo &MRI, bool LookThroughInstrs=true)
If VReg is defined by a statically evaluable chain of instructions rooted on a G_CONSTANT returns its...
LLVM_ABI bool isPreISelGenericFloatingPointOpcode(unsigned Opc)
Returns whether opcode Opc is a pre-isel generic floating-point opcode, having only floating-point op...
LLVM_ABI std::optional< DefinitionAndSourceRegister > getDefSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the def instruction for Reg, and underlying value Register folding away any copies.
LLVM_ABI SmallVector< APInt > ConstantFoldUnaryIntOp(unsigned Opcode, LLT DstTy, Register Src, const MachineRegisterInfo &MRI)
Tries to constant fold a unary integer operation (G_CTLZ, G_CTTZ, G_CTPOP and their _ZERO_POISON vari...
LLVM_ABI void eraseInstrs(ArrayRef< MachineInstr * > DeadInstrs, MachineRegisterInfo &MRI, LostDebugLocObserver *LocObserver=nullptr)
LLVM_ABI bool isKnownToBeAPowerOfTwo(const Value *V, const DataLayout &DL, bool OrZero=false, AssumptionCache *AC=nullptr, const Instruction *CxtI=nullptr, const DominatorTree *DT=nullptr, bool UseInstrInfo=true, unsigned Depth=0)
Return true if the given value is known to have exactly one bit set when defined.
LLVM_ABI Register getSrcRegIgnoringCopies(Register Reg, const MachineRegisterInfo &MRI)
Find the source register for Reg, folding away any trivial copies.
LLVM_ABI LLVM_READNONE LLT getGCDType(LLT OrigTy, LLT TargetTy)
Return a type where the total size is the greatest common divisor of OrigTy and TargetTy.
LLVM_ABI bool isGuaranteedNotToBePoison(const Value *V, AssumptionCache *AC=nullptr, const Instruction *CtxI=nullptr, const DominatorTree *DT=nullptr, unsigned Depth=0)
Returns true if V cannot be poison, but may be undef.
LLVM_ABI std::optional< int64_t > getIConstantSplatSExtVal(const Register Reg, const MachineRegisterInfo &MRI)
LLVM_ABI bool isAssertMI(const MachineInstr &MI)
Returns true if the instruction MI is one of the assert instructions.
LLVM_ABI void extractVectorParts(Register Reg, unsigned NumElts, SmallVectorImpl< Register > &VRegs, MachineIRBuilder &MIRBuilder, MachineRegisterInfo &MRI)
Version which handles irregular sub-vector splits.
LLVM_ABI int getSplatIndex(ArrayRef< int > Mask)
If all non-negative Mask elements are the same value, return that value.
LLVM_ABI bool isTriviallyDead(const MachineInstr &MI, const MachineRegisterInfo &MRI)
Check whether an instruction MI is dead: it only defines dead virtual registers, and doesn't have oth...
LLVM_ABI Align inferAlignFromPtrInfo(MachineFunction &MF, const MachinePointerInfo &MPO)
This struct is a compact representation of a valid (non-zero power of two) alignment.
Simple struct used to hold a Register value and the instruction which defines it.
This class contains a discriminated union of information about pointers in memory operands,...
Simple struct used to hold a constant integer value and a virtual register.