27using namespace TargetOpcode;
28using namespace LegalizeActions;
29using namespace LegalityPredicates;
35 bool Is64Bit = Subtarget.is64Bit();
37 bool HasSSE1 = Subtarget.
hasSSE1();
38 bool HasSSE2 = Subtarget.
hasSSE2();
39 bool HasSSE41 = Subtarget.
hasSSE41();
40 bool HasAVX = Subtarget.
hasAVX();
41 bool HasAVX2 = Subtarget.
hasAVX2();
43 bool HasVLX = Subtarget.hasVLX();
44 bool HasDQI = Subtarget.
hasAVX512() && Subtarget.hasDQI();
45 bool HasBWI = Subtarget.
hasAVX512() && Subtarget.hasBWI();
46 bool UseX87 = !Subtarget.useSoftFloat() && Subtarget.hasX87();
47 bool HasPOPCNT = Subtarget.hasPOPCNT();
48 bool HasLZCNT = Subtarget.hasLZCNT();
49 bool HasBMI = Subtarget.hasBMI();
59 const LLT sMaxScalar = Subtarget.is64Bit() ? s64 : s32;
80 const LLT s8MaxVector = HasAVX512 ? v64s8 : HasAVX ? v32s8 : v16s8;
81 const LLT s16MaxVector = HasAVX512 ? v32s16 : HasAVX ? v16s16 : v8s16;
82 const LLT s32MaxVector = HasAVX512 ? v16s32 : HasAVX ? v8s32 : v4s32;
83 const LLT s64MaxVector = HasAVX512 ? v8s64 : HasAVX ? v4s64 : v2s64;
92 .
legalFor({p0, s1, s8, s16, s32, s64})
93 .legalFor(Is64Bit, {s128});
97 .legalFor(Is64Bit, {s64})
98 .widenScalarToNextPow2(0, 8)
102 {G_LROUND, G_LLROUND, G_FCOS, G_FCOSH, G_FACOS, G_FSIN, G_FSINH,
103 G_FASIN, G_FTAN, G_FTANH, G_FATAN, G_FATAN2, G_FPOW, G_FEXP,
104 G_FEXP2, G_FEXP10, G_FLOG, G_FLOG2, G_FLOG10, G_FPOWI, G_FSINCOS})
109 .legalFor(HasSSE2 || UseX87, {s64})
110 .legalFor(UseX87, {s80});
115 for (
unsigned Op : {G_MERGE_VALUES, G_UNMERGE_VALUES}) {
116 unsigned BigTyIdx =
Op == G_MERGE_VALUES ? 0 : 1;
117 unsigned LitTyIdx =
Op == G_MERGE_VALUES ? 1 : 0;
124 switch (Q.
Types[BigTyIdx].getSizeInBits()) {
135 switch (Q.
Types[LitTyIdx].getSizeInBits()) {
151 .legalFor({s8, s16, s32})
152 .legalFor(Is64Bit, {s64})
153 .legalFor(HasSSE2, {v16s8, v8s16, v4s32, v2s64})
154 .legalFor(HasAVX2, {v32s8, v16s16, v8s32, v4s64})
155 .legalFor(HasAVX512, {v16s32, v8s64})
156 .legalFor(HasBWI, {v64s8, v32s16})
157 .clampMinNumElements(0, s8, 16)
170 .legalFor({{s8, s1}, {s16, s1}, {s32, s1}})
171 .legalFor(Is64Bit, {{s64, s1}})
172 .widenScalarToNextPow2(0, 32)
180 .legalFor(Is64Bit, {s64})
181 .legalFor(HasSSE2, {v8s16})
182 .legalFor(HasSSE41, {v4s32})
183 .legalFor(HasAVX2, {v16s16, v8s32})
184 .legalFor(HasAVX512, {v16s32})
185 .legalFor(HasDQI, {v8s64})
186 .legalFor(HasDQI && HasVLX, {v2s64, v4s64})
187 .legalFor(HasBWI, {v32s16})
188 .clampMinNumElements(0, s16, 8)
199 .legalFor({s8, s16, s32})
200 .legalFor(Is64Bit, {s64})
201 .widenScalarToNextPow2(0, 32)
207 .legalFor({s8, s16, s32})
208 .legalFor(Is64Bit, {s64})
210 .clampScalar(0, s8, sMaxScalar);
214 .legalFor({{s8, s8}, {s16, s8}, {s32, s8}})
215 .legalFor(Is64Bit, {{s64, s8}})
216 .clampScalar(0, s8, sMaxScalar)
221 .legalFor({s8, s16, s32})
222 .legalFor(Is64Bit, {s64})
223 .legalFor(HasSSE2, {v16s8, v8s16, v4s32, v2s64})
224 .legalFor(HasAVX, {v32s8, v16s16, v8s32, v4s64})
225 .legalFor(HasAVX512, {v64s8, v32s16, v16s32, v8s64})
226 .clampMinNumElements(0, s8, 16)
239 const std::initializer_list<LLT> IntTypes32 = {s8, s16, s32, p0};
240 const std::initializer_list<LLT> IntTypes64 = {s8, s16, s32, s64, p0};
244 .clampScalar(0, s8, s8)
250 .legalFor(Is64Bit, {s64})
251 .widenScalarToNextPow2(0, 32)
256 .
legalFor(HasPOPCNT, {{s16, s16}, {s32, s32}})
257 .legalFor(HasPOPCNT && Is64Bit, {{s64, s64}})
258 .widenScalarToNextPow2(1, 16)
264 .
legalFor(HasLZCNT, {{s16, s16}, {s32, s32}})
265 .legalFor(HasLZCNT && Is64Bit, {{s64, s64}})
266 .widenScalarToNextPow2(1, 16)
273 .legalFor(Is64Bit, {{s64, s64}})
274 .widenScalarToNextPow2(1, 16)
279 .
legalFor(HasBMI, {{s16, s16}, {s32, s32}})
280 .legalFor(HasBMI && Is64Bit, {{s64, s64}})
281 .widenScalarToNextPow2(1, 16)
288 .legalFor(UseX87, {s80})
289 .legalFor(Is64Bit, {s64})
290 .legalFor(HasSSE1, {v16s8, v8s16, v4s32, v2s64})
291 .legalFor(HasAVX, {v32s8, v16s16, v8s32, v4s64})
292 .legalFor(HasAVX512, {v64s8, v32s16, v16s32, v8s64})
293 .clampMinNumElements(0, s8, 16)
308 const std::initializer_list<LLT> PtrTypes32 = {s1, s8, s16, s32};
309 const std::initializer_list<LLT> PtrTypes64 = {s1, s8, s16, s32, s64};
313 .maxScalar(0, sMaxScalar)
322 .legalFor(Is64Bit, {{p0, s64}})
323 .widenScalarToNextPow2(1, 32)
329 for (
unsigned Op : {G_LOAD, G_STORE}) {
331 Action.legalForTypesWithMemDesc({{s8, p0, s8, 1},
336 {v4s8, p0, v4s8, 1}});
338 Action.legalForTypesWithMemDesc(
339 {{s64, p0, s64, 1}, {v2s32, p0, v2s32, 1}});
342 Action.legalForTypesWithMemDesc({{v4s32, p0, v4s32, 1}});
344 Action.legalForTypesWithMemDesc({{v16s8, p0, v16s8, 1},
345 {v8s16, p0, v8s16, 1},
346 {v2s64, p0, v2s64, 1},
347 {v2p0, p0, v2p0, 1}});
349 Action.legalForTypesWithMemDesc({{v32s8, p0, v32s8, 1},
350 {v16s16, p0, v16s16, 1},
351 {v8s32, p0, v8s32, 1},
352 {v4s64, p0, v4s64, 1},
353 {v4p0, p0, v4p0, 1}});
355 Action.legalForTypesWithMemDesc({{v64s8, p0, v64s8, 1},
356 {v32s16, p0, v32s16, 1},
357 {v16s32, p0, v16s32, 1},
358 {v8s64, p0, v8s64, 1}});
362 Action.legalForTypesWithMemDesc({{s8, p0, s1, 1},
367 Action.legalForTypesWithMemDesc(
368 {{s64, p0, s8, 1}, {s64, p0, s16, 1}, {s64, p0, s32, 1}});
374 Action.widenScalarToNextPow2(0, 8)
375 .clampScalar(0, s8, sMaxScalar)
379 for (
unsigned Op : {G_SEXTLOAD, G_ZEXTLOAD}) {
381 Action.legalForTypesWithMemDesc(
382 {{s16, p0, s8, 1}, {s32, p0, s8, 1}, {s32, p0, s16, 1}});
384 Action.legalForTypesWithMemDesc(
385 {{s64, p0, s8, 1}, {s64, p0, s16, 1}, {s64, p0, s32, 1}});
392 .legalFor(Is64Bit, {s64})
393 .widenScalarToNextPow2(0, 8)
400 .legalFor({s8, s16, s32})
401 .legalFor(Is64Bit, {s64})
402 .widenScalarToNextPow2(0, 8)
413 .legalFor(UseX87, {s80});
417 .legalFor({s32, s64})
418 .legalFor(HasSSE1, {v4s32})
419 .legalFor(HasSSE2, {v2s64})
420 .legalFor(HasAVX, {v8s32, v4s64})
421 .legalFor(HasAVX512, {v16s32, v8s64})
422 .legalFor(UseX87, {s80});
426 .legalFor(UseX87 && !Is64Bit, {s64})
431 .
legalFor(HasSSE1 || UseX87, {s8, s32})
432 .legalFor(HasSSE2 || UseX87, {s8, s64})
433 .legalFor(UseX87, {s8, s80})
434 .clampScalar(0, s8, s8)
441 .legalFor(HasAVX, {{v4s64, v4s32}})
442 .legalFor(HasAVX512, {{v8s64, v8s32}});
446 .legalFor(HasAVX, {{v4s32, v4s64}})
447 .legalFor(HasAVX512, {{v8s32, v8s64}});
451 .legalFor(HasSSE1 && Is64Bit, {{s32, s64}})
452 .legalFor(HasSSE2, {{s64, s32}})
453 .legalFor(HasSSE2 && Is64Bit, {{s64, s64}})
454 .clampScalar(1, (UseX87 && !HasSSE1) ? s16 : s32, sMaxScalar)
457 .clampScalar(0, s32, HasSSE2 ? s64 : s32)
462 .legalFor(HasSSE1 && Is64Bit, {{s64, s32}})
463 .legalFor(HasSSE2, {{s32, s64}})
464 .legalFor(HasSSE2 && Is64Bit, {{s64, s64}})
465 .clampScalar(0, (UseX87 && !HasSSE1) ? s16 : s32, sMaxScalar)
468 .clampScalar(1, s32, HasSSE2 ? s64 : s32)
479 .
legalFor(HasAVX512, {{s32, s32}, {s32, s64}, {s64, s32}, {s64, s64}})
482 ((HasSSE1 &&
typeIs(0, s32)(Query)) ||
483 (HasSSE2 &&
typeIs(0, s64)(Query))) &&
489 ((HasSSE1 &&
typeIs(0, s32)(Query)) ||
490 (HasSSE2 &&
typeIs(0, s64)(Query))) &&
491 (Is64Bit &&
typeIs(1, s64)(Query));
493 .clampScalar(0, s32, HasSSE2 ? s64 : s32)
499 .
legalFor(HasAVX512, {{s32, s32}, {s32, s64}, {s64, s32}, {s64, s64}})
502 ((HasSSE1 &&
typeIs(1, s32)(Query)) ||
503 (HasSSE2 &&
typeIs(1, s64)(Query))) &&
512 ((HasSSE1 &&
typeIs(1, s32)(Query)) ||
513 (HasSSE2 &&
typeIs(1, s64)(Query))) &&
514 (Is64Bit &&
typeIs(0, s64)(Query));
516 .clampScalar(0, s32, sMaxScalar)
524 return (HasSSE1 &&
typeInSet(0, {v4s32})(Query)) ||
525 (HasSSE2 &&
typeInSet(0, {v2s64, v8s16, v16s8})(Query)) ||
526 (HasAVX &&
typeInSet(0, {v4s64, v8s32, v16s16, v32s8})(Query)) ||
527 (HasAVX512 &&
typeInSet(0, {v8s64, v16s32, v32s16, v64s8}));
529 .clampNumElements(0, v16s8, s8MaxVector)
537 unsigned SubIdx = Query.
Opcode == G_EXTRACT ? 0 : 1;
538 unsigned FullIdx = Query.
Opcode == G_EXTRACT ? 1 : 0;
543 {v2s64, v4s64}})(Query)) ||
552 {v4s64, v8s64}})(Query));
559 {{v32s8, v16s8}, {v16s16, v8s16}, {v8s32, v4s32}, {v4s64, v2s64}})
560 .legalFor(HasAVX, {{v64s8, v16s8},
571 .
legalFor({{s8, s32}, {s16, s32}, {s32, s32}, {s64, s32}, {p0, s32}})
572 .widenScalarToNextPow2(0, 8)
589 .legalFor({s8, s16, s32, s64, p0})
590 .widenScalarToNextPow2(0, 8)
601 switch (
MI.getOpcode()) {
605 case TargetOpcode::G_BUILD_VECTOR:
606 return legalizeBuildVector(
MI,
MRI, Helper);
607 case TargetOpcode::G_FPTOUI:
608 return legalizeFPTOUI(
MI,
MRI, Helper);
609 case TargetOpcode::G_UITOFP:
610 return legalizeUITOFP(
MI,
MRI, Helper);
611 case TargetOpcode::G_STORE:
612 return legalizeNarrowingStore(
MI,
MRI, Helper);
613 case TargetOpcode::G_SITOFP:
614 return legalizeSITOFP(
MI,
MRI, Helper);
615 case TargetOpcode::G_FPTOSI:
616 return legalizeFPTOSI(
MI,
MRI, Helper);
617 case TargetOpcode::G_GET_ROUNDING:
618 return legalizeGETROUNDING(
MI,
MRI, Helper);
628 auto [Dst, DstTy, Src, SrcTy] =
MI.getFirst2RegLLTs();
630 assert((SrcTy.getSizeInBits() == 16 || SrcTy.getSizeInBits() == 32 ||
631 SrcTy.getSizeInBits() == 64) &&
632 "Unexpected source type for SITOFP in X87 mode.");
634 TypeSize MemSize = SrcTy.getSizeInBytes();
642 MIRBuilder.
buildStore(Src, SlotPointer, *StoreMMO);
648 .
addUse(SlotPointer.getReg(0))
651 MI.eraseFromParent();
660 auto [Dst, DstTy, Src, SrcTy] =
MI.getFirst2RegLLTs();
662 TypeSize MemSize = DstTy.getSizeInBytes();
671 .
addUse(SlotPointer.getReg(0))
675 MI.eraseFromParent();
683 const auto &BuildVector = cast<GBuildVector>(
MI);
684 Register Dst = BuildVector.getReg(0);
685 LLT DstTy =
MRI.getType(Dst);
691 for (
unsigned i = 0; i < BuildVector.getNumSources(); ++i) {
696 CstIdxs.
emplace_back(ConstantInt::get(Ctx, ValueAndReg->Value));
702 CstIdxs.
emplace_back(ConstantFP::get(Ctx, FPValueAndReg->Value));
706 if (getOpcodeDef<GImplicitDef>(Source,
MRI)) {
716 unsigned AddrSpace =
DL.getDefaultGlobalsAddressSpace();
726 MI.eraseFromParent();
734 auto [Dst, DstTy, Src, SrcTy] =
MI.getFirst2RegLLTs();
735 unsigned DstSizeInBits = DstTy.getScalarSizeInBits();
740 if (DstSizeInBits <= 32) {
741 auto Casted = MIRBuilder.
buildFPTOSI(DstTy == s32 ? s64 : s32, Src);
743 MI.eraseFromParent();
754 auto [Dst, DstTy, Src, SrcTy] =
MI.getFirst2RegLLTs();
759 if (SrcTy.getSizeInBits() <= 32) {
760 auto Ext = MIRBuilder.
buildZExt(SrcTy == s32 ? s64 : s32, Src);
762 MI.eraseFromParent();
772 auto &
Store = cast<GStore>(
MI);
780 Store.setMemRefs(MF, {NewMMO});
813 LLT DstTy =
MRI.getType(Dst);
850 auto LUTShifted = MIRBuilder.
buildLShr(s32,
LUT, Masked32);
857 MI.eraseFromParent();
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Declares convenience wrapper classes for interpreting MachineInstr instances as specific generic oper...
This file declares the MachineConstantPool class which is an abstract constant pool to keep track of ...
This file declares the MachineIRBuilder class.
This file declares the targeting of the Machinelegalizer class for X86.
static LLVM_ABI Constant * get(ArrayRef< Constant * > V)
This is an important base class in LLVM.
This class represents an Operation in the Expression.
A parsed version of the target data layout string in and methods for querying it.
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
virtual void changingInstr(MachineInstr &MI)=0
This instruction is about to be mutated in some way.
virtual void changedInstr(MachineInstr &MI)=0
This instruction was mutated in some way.
constexpr unsigned getScalarSizeInBits() const
static constexpr LLT scalar(unsigned SizeInBits)
Get a low-level scalar or aggregate "bag of bits".
static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits)
Get a low-level pointer in the given address space.
static constexpr LLT fixed_vector(unsigned NumElements, unsigned ScalarSizeInBits)
Get a low-level fixed-width vector of some number of elements and element width.
This is an important class for using LLVM in a threaded context.
LLVM_ABI void computeTables()
Compute any ancillary tables needed to quickly decide how an operation should be handled.
LegalizeRuleSet & minScalar(unsigned TypeIdx, const LLT Ty)
Ensure the scalar is at least as wide as Ty.
LegalizeRuleSet & legalFor(std::initializer_list< LLT > Types)
The instruction is legal when type index 0 is any type in the given list.
LegalizeRuleSet & scalarSameSizeAs(unsigned TypeIdx, unsigned SameSizeIdx)
Change the type TypeIdx to have the same scalar size as type SameSizeIdx.
LegalizeRuleSet & libcall()
The instruction is emitted as a library call.
LegalizeRuleSet & clampMaxNumElements(unsigned TypeIdx, const LLT EltTy, unsigned MaxElements)
Limit the number of elements in EltTy vectors to at most MaxElements.
LegalizeRuleSet & clampMinNumElements(unsigned TypeIdx, const LLT EltTy, unsigned MinElements)
Limit the number of elements in EltTy vectors to at least MinElements.
LegalizeRuleSet & customForCartesianProduct(std::initializer_list< LLT > Types)
LegalizeRuleSet & moreElementsToNextPow2(unsigned TypeIdx)
Add more elements to the vector to reach the next power of two.
LegalizeRuleSet & lower()
The instruction is lowered.
LegalizeRuleSet & clampScalar(unsigned TypeIdx, const LLT MinTy, const LLT MaxTy)
Limit the range of scalar sizes to MinTy and MaxTy.
LegalizeRuleSet & clampNumElements(unsigned TypeIdx, const LLT MinTy, const LLT MaxTy)
Limit the number of elements for the given vectors to at least MinTy's number of elements and at most...
LegalizeRuleSet & customIf(LegalityPredicate Predicate)
LegalizeRuleSet & widenScalarToNextPow2(unsigned TypeIdx, unsigned MinSize=0)
Widen the scalar to the next power of two that is at least MinSize.
LegalizeRuleSet & scalarize(unsigned TypeIdx)
LegalizeRuleSet & legalForCartesianProduct(std::initializer_list< LLT > Types)
The instruction is legal when type indexes 0 and 1 are both in the given list.
LegalizeRuleSet & legalIf(LegalityPredicate Predicate)
The instruction is legal if predicate is true.
LegalizeRuleSet & customFor(std::initializer_list< LLT > Types)
LLVM_ABI MachineInstrBuilder createStackTemporary(TypeSize Bytes, Align Alignment, MachinePointerInfo &PtrInfo)
Create a stack temporary based on the size in bytes and the alignment.
GISelChangeObserver & Observer
To keep track of changes made by the LegalizerHelper.
MachineIRBuilder & MIRBuilder
Expose MIRBuilder so clients can set their own RecordInsertInstruction functions.
LLVM_ABI Align getStackTemporaryAlignment(LLT Type, Align MinAlign=Align()) const
Return the alignment to use for a stack temporary object with the given type.
LegalizeRuleSet & getActionDefinitionsBuilder(unsigned Opcode)
Get the action definition builder for the given opcode.
const LegacyLegalizerInfo & getLegacyLegalizerInfo() const
unsigned getConstantPoolIndex(const Constant *C, Align Alignment)
getConstantPoolIndex - Create a new entry in the constant pool or return an existing one.
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags f, LLT MemTy, Align base_alignment, const AAMDNodes &AAInfo=AAMDNodes(), const MDNode *Ranges=nullptr, SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
Function & getFunction()
Return the LLVM function that this machine code represents.
MachineConstantPool * getConstantPool()
getConstantPool - Return the constant pool object for the current function.
Helper class to build MachineInstr.
MachineInstrBuilder buildFPTOSI(const DstOp &Dst, const SrcOp &Src0)
Build and insert Res = G_FPTOSI Src0.
MachineInstrBuilder buildConstantPool(const DstOp &Res, unsigned Idx)
Build and insert Res = G_CONSTANT_POOL Idx.
MachineInstrBuilder buildAnd(const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1)
Build and insert Res = G_AND Op0, Op1.
MachineInstrBuilder buildLShr(const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1, std::optional< unsigned > Flags=std::nullopt)
MachineInstrBuilder buildZExt(const DstOp &Res, const SrcOp &Op, std::optional< unsigned > Flags=std::nullopt)
Build and insert Res = G_ZEXT Op.
MachineInstrBuilder buildLoad(const DstOp &Res, const SrcOp &Addr, MachineMemOperand &MMO)
Build and insert Res = G_LOAD Addr, MMO.
MachineInstrBuilder buildZExtOrTrunc(const DstOp &Res, const SrcOp &Op)
Build and insert Res = G_ZEXT Op, Res = G_TRUNC Op, or Res = COPY Op depending on the differing sizes...
MachineInstrBuilder buildStore(const SrcOp &Val, const SrcOp &Addr, MachineMemOperand &MMO)
Build and insert G_STORE Val, Addr, MMO.
MachineInstrBuilder buildInstr(unsigned Opcode)
Build and insert <empty> = Opcode <empty>.
MachineInstrBuilder buildSITOFP(const DstOp &Dst, const SrcOp &Src0)
Build and insert Res = G_SITOFP Src0.
MachineFunction & getMF()
Getter for the function we currently build.
MachineInstrBuilder buildTrunc(const DstOp &Res, const SrcOp &Op, std::optional< unsigned > Flags=std::nullopt)
Build and insert Res = G_TRUNC Op.
MachineRegisterInfo * getMRI()
Getter for MRI.
MachineInstrBuilder buildCopy(const DstOp &Res, const SrcOp &Op)
Build and insert Res = COPY Op.
const DataLayout & getDataLayout() const
virtual MachineInstrBuilder buildConstant(const DstOp &Res, const ConstantInt &Val)
Build and insert Res = G_CONSTANT Val.
const MachineInstrBuilder & addUse(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register use operand.
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
const MachineInstrBuilder & addDef(Register RegNo, unsigned Flags=0, unsigned SubReg=0) const
Add a virtual register definition operand.
Representation of each machine instruction.
A description of a memory reference used in the backend.
@ MOLoad
The memory access reads data.
@ MOStore
The memory access writes data.
const MachinePointerInfo & getPointerInfo() const
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
reference emplace_back(ArgTypes &&... Args)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static constexpr TypeSize getFixed(ScalarTy ExactSize)
static LLVM_ABI IntegerType * getIntNTy(LLVMContext &C, unsigned N)
static LLVM_ABI UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Type * getType() const
All values are typed, get the type of this value.
bool legalizeCustom(LegalizerHelper &Helper, MachineInstr &MI, LostDebugLocObserver &LocObserver) const override
Called for instructions with the Custom LegalizationAction.
bool legalizeIntrinsic(LegalizerHelper &Helper, MachineInstr &MI) const override
X86LegalizerInfo(const X86Subtarget &STI, const X86TargetMachine &TM)
const X86InstrInfo * getInstrInfo() const override
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI LegalityPredicate typeInSet(unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
True iff the given type index is one of the specified types.
LLVM_ABI LegalityPredicate typePairInSet(unsigned TypeIdx0, unsigned TypeIdx1, std::initializer_list< std::pair< LLT, LLT > > TypesInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs.
LLVM_ABI LegalityPredicate typeIs(unsigned TypeIdx, LLT TypesInit)
True iff the given type index is the specified type.
LLVM_ABI LegalityPredicate scalarNarrowerThan(unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's narrower than the given size.
This is an optimization pass for GlobalISel generic memory operations.
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 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...
This struct is a compact representation of a valid (non-zero power of two) alignment.
The LegalityQuery object bundles together all the information that's needed to decide whether a given...
ArrayRef< MemDesc > MMODescrs
Operations which require memory can use this to place requirements on the memory type for each MMO.
This class contains a discriminated union of information about pointers in memory operands,...
static LLVM_ABI MachinePointerInfo getConstantPool(MachineFunction &MF)
Return a MachinePointerInfo record that refers to the constant pool.