LLVM 24.0.0git
AArch64ISelLowering.h
Go to the documentation of this file.
1//==-- AArch64ISelLowering.h - AArch64 DAG Lowering Interface ----*- C++ -*-==//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the interfaces that AArch64 uses to lower LLVM code into a
10// selection DAG.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H
15#define LLVM_LIB_TARGET_AARCH64_AARCH64ISELLOWERING_H
16
21#include "llvm/IR/CallingConv.h"
22#include "llvm/IR/Instruction.h"
23
24namespace llvm {
25
27
28namespace AArch64 {
29/// Possible values of current rounding mode, which is specified in bits
30/// 23:22 of FPCR.
32 RN = 0, // Round to Nearest
33 RP = 1, // Round towards Plus infinity
34 RM = 2, // Round towards Minus infinity
35 RZ = 3, // Round towards Zero
36 rmMask = 3 // Bit mask selecting rounding mode
37};
38
39// Bit position of rounding mode bits in FPCR.
40const unsigned RoundingBitsPos = 22;
41
42// Reserved bits should be preserved when modifying FPCR.
43const uint64_t ReservedFPControlBits = 0xfffffffff80040f8;
44
45// Registers used to pass function arguments.
48
49/// Maximum allowed number of unprobed bytes above SP at an ABI
50/// boundary.
51const unsigned StackProbeMaxUnprobedStack = 1024;
52
53/// Maximum number of iterations to unroll for a constant size probing loop.
54const unsigned StackProbeMaxLoopUnroll = 4;
55
56} // namespace AArch64
57
58namespace ARM64AS {
59enum : unsigned { PTR32_SPTR = 270, PTR32_UPTR = 271, PTR64 = 272 };
60}
61
62class AArch64Subtarget;
63
65public:
66 explicit AArch64TargetLowering(const TargetMachine &TM,
67 const AArch64Subtarget &STI);
68
69 const AArch64TargetMachine &getTM() const;
70
71 /// Control the following reassociation of operands: (op (op x, c1), y) -> (op
72 /// (op x, y), c1) where N0 is (op x, c1) and N1 is y.
74 SDValue N1) const override;
75
76 /// Selects the correct CCAssignFn for a given CallingConvention value.
77 CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const;
78
79 /// Selects the correct CCAssignFn for a given CallingConvention value.
81
82 /// Determine which of the bits specified in Mask are known to be either zero
83 /// or one and return them in the KnownZero/KnownOne bitsets.
85 const APInt &DemandedElts,
86 const SelectionDAG &DAG,
87 unsigned Depth = 0) const override;
88
90 const APInt &DemandedElts,
91 const SelectionDAG &DAG,
92 unsigned Depth) const override;
93
95 Register R,
96 const APInt &DemandedElts,
98 unsigned Depth = 0) const override;
99
100 MVT getPointerTy(const DataLayout &DL, uint32_t AS = 0) const override {
101 if ((AS == ARM64AS::PTR32_SPTR) || (AS == ARM64AS::PTR32_UPTR)) {
102 // These are 32-bit pointers created using the `__ptr32` extension or
103 // similar. They are handled by marking them as being in a different
104 // address space, and will be extended to 64-bits when used as the target
105 // of a load or store operation, or cast to a 64-bit pointer type.
106 return MVT::i32;
107 } else {
108 // Returning i64 unconditionally here (i.e. even for ILP32) means that the
109 // *DAG* representation of pointers will always be 64-bits. They will be
110 // truncated and extended when transferred to memory, but the 64-bit DAG
111 // allows us to use AArch64's addressing modes much more easily.
112 return MVT::i64;
113 }
114 }
115
116 unsigned getVectorIdxWidth(const DataLayout &DL) const override {
117 // The VectorIdx type is i64, with both normal and ilp32.
118 return 64;
119 }
120
122 const APInt &DemandedElts,
123 TargetLoweringOpt &TLO) const override;
124
125 MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override;
126
127 /// Returns true if the target allows unaligned memory accesses of the
128 /// specified type.
130 EVT VT, unsigned AddrSpace = 0, Align Alignment = Align(1),
132 unsigned *Fast = nullptr) const override;
133 /// LLT variant.
134 bool allowsMisalignedMemoryAccesses(LLT Ty, unsigned AddrSpace,
135 Align Alignment,
137 unsigned *Fast = nullptr) const override;
138
139 /// Provide custom lowering hooks for some operations.
140 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
141
142 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
143
144 /// This method returns a target specific FastISel object, or null if the
145 /// target does not support "fast" ISel.
146 FastISel *
148 const TargetLibraryInfo *libInfo,
149 const LibcallLoweringInfo *libcallLowering) const override;
150
151 bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
152
153 bool isFPImmLegalAsFMov(const APFloat &Imm, EVT VT) const;
154
156 bool ForCodeSize) const override;
157
158 /// Return true if the given shuffle mask can be codegen'd directly, or if it
159 /// should be stack expanded.
160 bool isShuffleMaskLegal(ArrayRef<int> M, EVT VT) const override;
161
162 /// Similar to isShuffleMaskLegal. Return true is the given 'select with zero'
163 /// shuffle mask can be codegen'd directly.
164 bool isVectorClearMaskLegal(ArrayRef<int> M, EVT VT) const override;
165
166 /// Return the ISD::SETCC ValueType.
168 EVT VT) const override;
169
171
173 MachineBasicBlock *BB) const;
174
176 MachineBasicBlock *BB) const;
177
179 MachineBasicBlock *MBB) const;
180
182 MachineBasicBlock *MBB) const;
183
185 MachineBasicBlock *MBB) const;
186
187 MachineBasicBlock *EmitTileLoad(unsigned Opc, unsigned BaseReg,
189 MachineBasicBlock *BB) const;
191 MachineBasicBlock *EmitZAInstr(unsigned Opc, unsigned BaseReg,
192 MachineInstr &MI, MachineBasicBlock *BB) const;
194 unsigned Opcode, bool Op0IsDef) const;
197 MachineBasicBlock *BB) const;
198
199 /// Replace (0, vreg) discriminator components with the operands of blend
200 /// or with (immediate, NoRegister) when possible.
202 MachineOperand &IntDiscOp,
203 MachineOperand &AddrDiscOp,
204 const TargetRegisterClass *AddrDiscRC) const;
205
208 MachineBasicBlock *MBB) const override;
209
211 const CallBase &I, MachineFunction &MF,
212 unsigned Intrinsic) const override;
213
215 std::optional<unsigned> ByteOffset) const override;
216
217 bool shouldRemoveRedundantExtend(SDValue Op) const override;
218
219 bool isTruncateFree(Type *Ty1, Type *Ty2) const override;
220 bool isTruncateFree(EVT VT1, EVT VT2) const override;
221
222 bool isProfitableToHoist(Instruction *I) const override;
223
224 bool isZExtFree(Type *Ty1, Type *Ty2) const override;
225 bool isZExtFree(EVT VT1, EVT VT2) const override;
226 bool isZExtFree(SDValue Val, EVT VT2) const override;
227
229 Instruction *I, Loop *L, const TargetTransformInfo &TTI) const override;
230
231 bool optimizeVectorCrossLaneOperation(Instruction *I, Loop *L) const override;
232
233 bool hasPairedLoad(EVT LoadedType, Align &RequiredAlignment) const override;
234
235 unsigned getMaxSupportedInterleaveFactor() const override { return 4; }
236
239 ArrayRef<unsigned> Indices, unsigned Factor,
240 const APInt &GapMask) const override;
242 ShuffleVectorInst *SVI, unsigned Factor,
243 const APInt &GapMask) const override;
244
246 IntrinsicInst *DI,
247 const APInt &GapMask) const override;
248
250 Instruction *Store, Value *Mask,
251 ArrayRef<Value *> InterleaveValues) const override;
252
253 bool isLegalAddImmediate(int64_t) const override;
254 bool isLegalAddScalableImmediate(int64_t) const override;
255 bool isLegalICmpImmediate(int64_t) const override;
256
258 SDValue ConstNode) const override;
259
260 bool shouldConsiderGEPOffsetSplit() const override;
261
262 EVT getOptimalMemOpType(LLVMContext &Context, const MemOp &Op,
263 const AttributeList &FuncAttributes) const override;
264
266 const AttributeList &FuncAttributes) const override;
267
268 bool findOptimalMemOpLowering(LLVMContext &Context, std::vector<EVT> &MemOps,
269 unsigned Limit, const MemOp &Op, unsigned DstAS,
270 unsigned SrcAS,
271 const AttributeList &FuncAttributes,
272 EVT *LargestVT = nullptr) const override;
273
274 /// Return true if the addressing mode represented by AM is legal for this
275 /// target, for a load/store of the specified type.
276 bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty,
277 unsigned AS,
278 Instruction *I = nullptr) const override;
279
280 int64_t getPreferredLargeGEPBaseOffset(int64_t MinOffset,
281 int64_t MaxOffset) const override;
282
283 /// Return true if an FMA operation is faster than a pair of fmul and fadd
284 /// instructions. fmuladd intrinsics will be expanded to FMAs when this method
285 /// returns true, otherwise fmuladd is expanded to fmul + fadd.
287 EVT VT) const override;
288 bool isFMAFasterThanFMulAndFAdd(const Function &F, Type *Ty) const override;
289
291 CodeGenOptLevel OptLevel) const override;
292
293 /// Return true if the target has native support for
294 /// the specified value type and it is 'desirable' to use the type for the
295 /// given node type.
296 bool isTypeDesirableForOp(unsigned Opc, EVT VT) const override;
297
298 const MCPhysReg *getScratchRegisters(CallingConv::ID CC) const override;
300
301 bool isNarrowingProfitable(SDNode *N, EVT SrcVT, EVT DestVT) const override;
302
303 /// Returns false if N is a bit extraction pattern of (X >> C) & Mask.
305 CombineLevel Level) const override;
306
307 bool isDesirableToPullExtFromShl(const MachineInstr &MI) const override {
308 return false;
309 }
310
311 /// Returns false if N is a bit extraction pattern of (X >> C) & Mask.
312 bool isDesirableToCommuteXorWithShift(const SDNode *N) const override;
313
314 /// Return true if it is profitable to fold a pair of shifts into a mask.
315 bool shouldFoldConstantShiftPairToMask(const SDNode *N) const override;
316
317 /// Return true if it is profitable to fold a pair of shifts into a mask.
319 EVT VT = Y.getValueType();
320
321 if (VT.isVector())
322 return false;
323
324 return VT.getScalarSizeInBits() <= 64;
325 }
326
327 bool shouldFoldSelectWithIdentityConstant(unsigned BinOpcode, EVT VT,
328 unsigned SelectOpcode, SDValue X,
329 SDValue Y) const override;
330
331 /// Returns true if it is beneficial to convert a load of a constant
332 /// to just the constant itself.
334 Type *Ty) const override;
335
336 /// Return the cost of EXTRACT_SUBVECTOR for this result type with this
337 /// index.
339 unsigned Index) const override;
340
341 bool shouldFormOverflowOp(unsigned Opcode, EVT VT,
342 bool MathUsed) const override {
343 // Using overflow ops for overflow checks only should beneficial on
344 // AArch64.
345 return TargetLowering::shouldFormOverflowOp(Opcode, VT, true);
346 }
347
348 // Return true if the target wants to optimize the mul overflow intrinsic
349 // for the given \p VT.
351 EVT VT) const override;
352
354 AtomicOrdering Ord) const override;
355 Value *emitLoadLinked(IRBuilderBase &Builder, Type *ValueTy, Value *Addr,
356 AtomicOrdering Ord) const override;
357 Value *emitStoreConditional(IRBuilderBase &Builder, Value *Val, Value *Addr,
358 AtomicOrdering Ord) const override;
360 Value *SizeInBytes) const override;
361
362 void emitAtomicCmpXchgNoStoreLLBalance(IRBuilderBase &Builder) const override;
363
364 bool isOpSuitableForLDPSTP(const Instruction *I) const;
365 bool isOpSuitableForLSE128(const Instruction *I) const;
366 bool isOpSuitableForRCPC3(const Instruction *I) const;
367 bool shouldInsertFencesForAtomic(const Instruction *I) const override;
369 const Instruction *I) const override;
370
372 shouldExpandAtomicLoadInIR(LoadInst *LI) const override;
374 shouldCastAtomicLoadInIR(LoadInst *LI) const override;
375
379 shouldCastAtomicStoreInIR(StoreInst *SI) const override;
381 shouldExpandAtomicRMWInIR(const AtomicRMWInst *AI) const override;
382
384 shouldExpandAtomicCmpXchgInIR(const AtomicCmpXchgInst *AI) const override;
385
387 return false;
388 }
389
390 bool useLoadStackGuardNode(const Module &M) const override;
391 bool useStackGuardMixFP() const override;
393 const SDLoc &DL) const override;
395 getPreferredVectorAction(MVT VT) const override;
396
397 /// If the target has a standard location for the stack protector cookie,
398 /// returns the address of that location. Otherwise, returns nullptr.
400 const LibcallLoweringInfo &Libcalls) const override;
401
402 void
404 const LibcallLoweringInfo &Libcalls) const override;
405
406 /// If the target has a standard location for the unsafe stack pointer,
407 /// returns the address of that location. Otherwise, returns nullptr.
409 IRBuilderBase &IRB, const LibcallLoweringInfo &Libcalls) const override;
410
411 /// If a physical register, this returns the register that receives the
412 /// exception address on entry to an EH pad.
415 const Constant *PersonalityFn) const override;
416
417 /// If a physical register, this returns the register that receives the
418 /// exception typeid on entry to a landing pad.
421 const Constant *PersonalityFn) const override;
422
423 bool isIntDivCheap(EVT VT, AttributeList Attr) const override;
424
425 bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT,
426 const MachineFunction &MF) const override;
427
428 bool isCheapToSpeculateCttz(Type *) const override {
429 return true;
430 }
431
432 bool isCheapToSpeculateCtlz(Type *) const override {
433 return true;
434 }
435
436 bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override;
437
438 bool hasAndNotCompare(SDValue V) const override {
439 // We can use bics for any scalar.
440 return V.getValueType().isScalarInteger();
441 }
442
443 bool hasAndNot(SDValue Y) const override {
444 EVT VT = Y.getValueType();
445
446 if (!VT.isVector())
447 return hasAndNotCompare(Y);
448
449 if (VT.isScalableVector())
450 return true;
451
452 return VT.getFixedSizeInBits() >= 64; // vector 'bic'
453 }
454
457 unsigned OldShiftOpcode, unsigned NewShiftOpcode,
458 SelectionDAG &DAG) const override;
459
462 unsigned ExpansionFactor) const override;
463
464 CondMergingParams
466 const Value *Rhs,
467 const Function *F) const override;
468
470 unsigned KeptBits) const override {
471 // For vectors, we don't have a preference..
472 if (XVT.isVector())
473 return false;
474
475 auto VTIsOk = [](EVT VT) -> bool {
476 return VT == MVT::i8 || VT == MVT::i16 || VT == MVT::i32 ||
477 VT == MVT::i64;
478 };
479
480 // We are ok with KeptBitsVT being byte/word/dword, what SXT supports.
481 // XVT will be larger than KeptBitsVT.
482 MVT KeptBitsVT = MVT::getIntegerVT(KeptBits);
483 return VTIsOk(XVT) && VTIsOk(KeptBitsVT);
484 }
485
486 bool preferIncOfAddToSubOfNot(EVT VT) const override;
487
488 bool shouldConvertFpToSat(unsigned Op, EVT FPVT, EVT VT) const override;
489
490 bool preferSelectsOverBooleanArithmetic(EVT VT) const override;
491
492 bool isComplexDeinterleavingSupported() const override;
494 ComplexDeinterleavingOperation Operation, Type *Ty) const override;
495
498 ComplexDeinterleavingRotation Rotation, Value *InputA, Value *InputB,
499 Value *Accumulator = nullptr) const override;
500
501 bool supportSplitCSR(MachineFunction *MF) const override {
503 MF->getFunction().hasFnAttribute(Attribute::NoUnwind);
504 }
505 void initializeSplitCSR(MachineBasicBlock *Entry) const override;
507 MachineBasicBlock *Entry,
508 const SmallVectorImpl<MachineBasicBlock *> &Exits) const override;
509
510 bool supportSwiftError() const override {
511 return true;
512 }
513
514 bool supportPtrAuthBundles() const override { return true; }
515
516 bool supportKCFIBundles() const override { return true; }
517
520 const TargetInstrInfo *TII) const override;
521
523 Type *VectorTy, unsigned ElemSizeInBits, unsigned &Index) const override;
524
525 /// Enable aggressive FMA fusion on targets that want it.
526 bool enableAggressiveFMAFusion(EVT VT) const override;
527
528 bool aggressivelyPreferBuildVectorSources(EVT VecVT) const override {
529 return true;
530 }
531
532 /// Returns the size of the platform's va_list object.
533 unsigned getVaListSizeInBits(const DataLayout &DL) const override;
534
535 /// Returns true if \p VecTy is a legal interleaved access type. This
536 /// function checks the vector element type and the overall width of the
537 /// vector.
539 bool &UseScalable) const;
540
541 /// Returns the number of interleaved accesses that will be generated when
542 /// lowering accesses of the given type.
543 unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL,
544 bool UseScalable) const;
545
547 const Instruction &I) const override;
548
550 Type *Ty, CallingConv::ID CallConv, bool isVarArg,
551 const DataLayout &DL) const override;
552
553 /// Used for exception handling on Win64.
554 bool needsFixedCatchObjects() const override;
555
556 bool fallBackToDAGISel(const Instruction &Inst) const override;
557
558 /// SVE code generation for fixed length vectors does not custom lower
559 /// BUILD_VECTOR. This makes BUILD_VECTOR legalisation a source of stores to
560 /// merge. However, merging them creates a BUILD_VECTOR that is just as
561 /// illegal as the original, thus leading to an infinite legalisation loop.
562 /// NOTE: Once BUILD_VECTOR is legal or can be custom lowered for all legal
563 /// vector types this override can be removed.
564 bool mergeStoresAfterLegalization(EVT VT) const override;
565
566 // If the platform/function should have a redzone, return the size in bytes.
567 unsigned getRedZoneSize(const Function &F) const {
568 if (F.hasFnAttribute(Attribute::NoRedZone))
569 return 0;
570 return 128;
571 }
572
573 bool isAllActivePredicate(const SelectionDAG &DAG, SDValue N) const;
575
577 bool AllowUnknown = false) const override;
578
579 bool shouldExpandGetActiveLaneMask(EVT VT, EVT OpVT) const override;
580
581 /// If a change in streaming mode is required on entry to/return from a
582 /// function call it emits and returns the corresponding SMSTART or SMSTOP
583 /// node. \p Condition should be one of the enum values from
584 /// AArch64SME::ToggleCondition.
586 SDValue Chain, SDValue InGlue, unsigned Condition,
587 bool InsertVectorLengthCheck = false) const;
588
589 /// Returns true if \p RdxOp should be lowered to a SVE reduction. If a SVE2
590 /// pairwise operation can be used for the reduction \p PairwiseOpIID is set
591 /// to its intrinsic ID.
592 bool
594 std::optional<Intrinsic::ID> &PairwiseOpIID) const;
595
596 // Normally SVE is only used for byte size vectors that do not fit within a
597 // NEON vector. This changes when OverrideNEON is true, allowing SVE to be
598 // used for 64bit and 128bit vectors as well.
599 bool useSVEForFixedLengthVectorVT(EVT VT, bool OverrideNEON = false) const;
600
601 // Follow NEON ABI rules even when using SVE for fixed length vectors.
603 EVT VT) const override;
606 EVT VT) const override;
609 EVT &IntermediateVT,
610 unsigned &NumIntermediates,
611 MVT &RegisterVT) const override;
612
614 return true;
615 }
616
617 /// True if stack clash protection is enabled for this functions.
618 bool hasInlineStackProbe(const MachineFunction &MF) const override;
619
620 /// In AArch64, true if FEAT_CPA is present. Allows pointer arithmetic
621 /// semantics to be preserved for instruction selection.
622 bool shouldPreservePtrArith(const Function &F, EVT PtrVT) const override;
623
624 // Match a register name (e.g. "x5", "d5", "sp") to its register number, with
625 // no validity filtering. This is the single entry point for the generated
626 // register-name matcher, shared with getRegisterByName.
628
629private:
630 /// Keep a pointer to the AArch64Subtarget around so that we can
631 /// make the right decision when generating code for different targets.
633
634 bool isExtFreeImpl(const Instruction *Ext) const override;
635
636 void addTypeForNEON(MVT VT);
637 void addTypeForFixedLengthSVE(MVT VT);
638 void addDRType(MVT VT);
639 void addQRType(MVT VT);
640
641 bool shouldExpandBuildVectorWithShuffles(EVT, unsigned) const override;
642
643 SDValue lowerEHPadEntry(SDValue Chain, SDLoc const &DL,
644 SelectionDAG &DAG) const override;
645
646 SDValue LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv,
647 bool isVarArg,
649 const SDLoc &DL, SelectionDAG &DAG,
650 SmallVectorImpl<SDValue> &InVals) const override;
651
652 void AdjustInstrPostInstrSelection(MachineInstr &MI,
653 SDNode *Node) const override;
654
655 SDValue LowerCall(CallLoweringInfo & /*CLI*/,
656 SmallVectorImpl<SDValue> &InVals) const override;
657
659 CallingConv::ID CallConv, bool isVarArg,
660 const SmallVectorImpl<CCValAssign> &RVLocs,
661 const SDLoc &DL, SelectionDAG &DAG,
662 SmallVectorImpl<SDValue> &InVals, bool isThisReturn,
663 SDValue ThisVal, bool RequiresSMChange) const;
664
667 SDValue LowerStore128(SDValue Op, SelectionDAG &DAG) const;
669 SDValue LowerSMULFIXSAT(SDValue Op, SelectionDAG &DAG) const;
670 SDValue LowerFMUL(SDValue Op, SelectionDAG &DAG) const;
671 SDValue LowerFMA(SDValue Op, SelectionDAG &DAG) const;
673
676
678
679 SDValue LowerVECTOR_COMPRESS(SDValue Op, SelectionDAG &DAG) const;
680
682 SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
683 SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG) const;
684
685 bool
686 isEligibleForTailCallOptimization(const CallLoweringInfo &CLI) const;
687
688 /// Finds the incoming stack arguments which overlap the given fixed stack
689 /// object and incorporates their load into the current chain. This prevents
690 /// an upcoming store from clobbering the stack argument before it's used.
691 SDValue addTokenForArgument(SDValue Chain, SelectionDAG &DAG,
692 MachineFrameInfo &MFI, int ClobberedFI) const;
693
694 bool DoesCalleeRestoreStack(CallingConv::ID CallCC, bool TailCallOpt) const;
695
696 void saveVarArgRegisters(CCState &CCInfo, SelectionDAG &DAG, const SDLoc &DL,
697 SDValue &Chain) const;
698
699 bool CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
700 bool isVarArg,
702 LLVMContext &Context, const Type *RetTy) const override;
703
704 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
706 const SmallVectorImpl<SDValue> &OutVals, const SDLoc &DL,
707 SelectionDAG &DAG) const override;
708
710 unsigned Flag) const;
712 unsigned Flag) const;
714 unsigned Flag) const;
716 unsigned Flag) const;
718 unsigned Flag) const;
719 template <class NodeTy>
720 SDValue getGOT(NodeTy *N, SelectionDAG &DAG, unsigned Flags = 0) const;
721 template <class NodeTy>
722 SDValue getAddrLarge(NodeTy *N, SelectionDAG &DAG, unsigned Flags = 0) const;
723 template <class NodeTy>
724 SDValue getAddr(NodeTy *N, SelectionDAG &DAG, unsigned Flags = 0) const;
725 template <class NodeTy>
726 SDValue getAddrTiny(NodeTy *N, SelectionDAG &DAG, unsigned Flags = 0) const;
727 SDValue LowerADDROFRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
728 SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
729 SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
730 SDValue LowerDarwinGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
731 SDValue LowerELFGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
732 SDValue LowerELFTLSLocalExec(const GlobalValue *GV, SDValue ThreadBase,
733 const SDLoc &DL, SelectionDAG &DAG) const;
734 SDValue LowerELFTLSDescCallSeq(SDValue SymAddr, const SDLoc &DL,
735 SelectionDAG &DAG) const;
736 SDValue LowerWindowsGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
737 SDValue LowerPtrAuthGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
738 SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
741 SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
744 SDValue TVal, SDValue FVal,
746 SDNodeFlags Flags, const SDLoc &dl,
747 SelectionDAG &DAG) const;
748 SDValue LowerINIT_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const;
750 SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
751 SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const;
752 SDValue LowerBRIND(SDValue Op, SelectionDAG &DAG) const;
753 SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
754 SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
755 SDValue LowerAAPCS_VASTART(SDValue Op, SelectionDAG &DAG) const;
756 SDValue LowerDarwin_VASTART(SDValue Op, SelectionDAG &DAG) const;
757 SDValue LowerWin64_VASTART(SDValue Op, SelectionDAG &DAG) const;
762 SDValue LowerSPONENTRY(SDValue Op, SelectionDAG &DAG) const;
764 SDValue LowerGET_ROUNDING(SDValue Op, SelectionDAG &DAG) const;
765 SDValue LowerSET_ROUNDING(SDValue Op, SelectionDAG &DAG) const;
766 SDValue LowerGET_FPMODE(SDValue Op, SelectionDAG &DAG) const;
767 SDValue LowerSET_FPMODE(SDValue Op, SelectionDAG &DAG) const;
768 SDValue LowerRESET_FPMODE(SDValue Op, SelectionDAG &DAG) const;
769 SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
771 SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
773 SDValue LowerZERO_EXTEND_VECTOR_INREG(SDValue Op, SelectionDAG &DAG) const;
774 SDValue LowerVECTOR_REPEAT(SDValue Op, SelectionDAG &DAG) const;
776 SDValue LowerVECTOR_REVERSE(SDValue Op, SelectionDAG &DAG) const;
777 SDValue LowerSPLAT_VECTOR(SDValue Op, SelectionDAG &DAG) const;
778 SDValue LowerDUPQLane(SDValue Op, SelectionDAG &DAG) const;
779 SDValue LowerToPredicatedOp(SDValue Op, SelectionDAG &DAG,
780 unsigned NewOp) const;
781 SDValue LowerToScalableOp(SDValue Op, SelectionDAG &DAG) const;
782 SDValue LowerVECTOR_SPLICE(SDValue Op, SelectionDAG &DAG) const;
785 SDValue LowerVECTOR_DEINTERLEAVE(SDValue Op, SelectionDAG &DAG) const;
786 SDValue LowerVECTOR_INTERLEAVE(SDValue Op, SelectionDAG &DAG) const;
787 SDValue LowerVECTOR_HISTOGRAM(SDValue Op, SelectionDAG &DAG) const;
789 SDValue LowerGET_ACTIVE_LANE_MASK(SDValue Op, SelectionDAG &DAG) const;
790 SDValue LowerMASK_BEFOREFIRST(SDValue Op, SelectionDAG &DAG) const;
791 SDValue LowerDIV(SDValue Op, SelectionDAG &DAG) const;
793 SDValue LowerVectorSRA_SRL_SHL(SDValue Op, SelectionDAG &DAG) const;
796 SDValue LowerCTPOP_PARITY(SDValue Op, SelectionDAG &DAG) const;
798 SDValue LowerBitreverse(SDValue Op, SelectionDAG &DAG) const;
799 SDValue LowerMinMax(SDValue Op, SelectionDAG &DAG) const;
801 SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const;
802 SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const;
804 SDValue LowerVectorFP_TO_INT_SAT(SDValue Op, SelectionDAG &DAG) const;
805 SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const;
807 SDValue LowerVectorXRINT(SDValue Op, SelectionDAG &DAG) const;
808 SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
810 SDValue LowerVectorOR(SDValue Op, SelectionDAG &DAG) const;
811 SDValue LowerXOR(SDValue Op, SelectionDAG &DAG) const;
813 SDValue LowerLOOP_DEPENDENCE_MASK(SDValue Op, SelectionDAG &DAG) const;
815 SDValue LowerVSCALE(SDValue Op, SelectionDAG &DAG) const;
816 SDValue LowerTRUNCATE(SDValue Op, SelectionDAG &DAG) const;
818 SDValue LowerVECREDUCE_MUL(SDValue Op, SelectionDAG &DAG) const;
819 SDValue LowerWindowsDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
820 SDValue LowerInlineDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
823 SDValue LowerFCANONICALIZE(SDValue Op, SelectionDAG &DAG) const;
824 SDValue LowerAVG(SDValue Op, SelectionDAG &DAG, unsigned NewOp) const;
825
826 SDValue LowerFPToIntToSVE(SDValue Op, SelectionDAG &DAG) const;
827
828 SDValue LowerFixedLengthVectorIntDivideToSVE(SDValue Op,
829 SelectionDAG &DAG) const;
830 SDValue LowerFixedLengthVectorIntExtendToSVE(SDValue Op,
831 SelectionDAG &DAG) const;
832 SDValue LowerFixedLengthVectorLoadToSVE(SDValue Op, SelectionDAG &DAG) const;
833 SDValue LowerFixedLengthVectorMLoadToSVE(SDValue Op, SelectionDAG &DAG) const;
834 SDValue LowerVECREDUCE_SEQ_FADD(SDValue ScalarOp, SelectionDAG &DAG) const;
835 SDValue LowerPredReductionToSVE(SDValue ScalarOp, SelectionDAG &DAG) const;
836 SDValue LowerReductionToSVE(SDValue Op, SelectionDAG &DAG) const;
837 SDValue LowerFixedLengthVectorSelectToSVE(SDValue Op, SelectionDAG &DAG) const;
838 SDValue LowerFixedLengthVectorSetccToSVE(SDValue Op, SelectionDAG &DAG) const;
839 SDValue LowerFixedLengthVectorStoreToSVE(SDValue Op, SelectionDAG &DAG) const;
840 SDValue LowerFixedLengthVectorMStoreToSVE(SDValue Op,
841 SelectionDAG &DAG) const;
842 SDValue LowerFixedLengthVectorTruncateToSVE(SDValue Op,
843 SelectionDAG &DAG) const;
844 SDValue LowerFixedLengthExtractVectorElt(SDValue Op, SelectionDAG &DAG) const;
845 SDValue LowerFixedLengthInsertVectorElt(SDValue Op, SelectionDAG &DAG) const;
846 SDValue LowerFixedLengthBitcastToSVE(SDValue Op, SelectionDAG &DAG) const;
847 SDValue LowerFixedLengthConcatVectorsToSVE(SDValue Op,
848 SelectionDAG &DAG) const;
849 SDValue LowerFixedLengthFPExtendToSVE(SDValue Op, SelectionDAG &DAG) const;
850 SDValue LowerFixedLengthFPRoundToSVE(SDValue Op, SelectionDAG &DAG) const;
851 SDValue LowerFixedLengthIntToFPToSVE(SDValue Op, SelectionDAG &DAG) const;
852 SDValue LowerFixedLengthFPToIntToSVE(SDValue Op, SelectionDAG &DAG) const;
853 SDValue LowerFixedLengthVECTOR_SHUFFLEToSVE(SDValue Op,
854 SelectionDAG &DAG) const;
855 SDValue LowerFixedLengthBuildVectorToSVE(SDValue Op, SelectionDAG &DAG) const;
856 SDValue LowerFixedLengthVectorCompressToSVE(SDValue Op,
857 SelectionDAG &DAG) const;
858
859 SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
860 SmallVectorImpl<SDNode *> &Created) const override;
861 SDValue BuildSREMPow2(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
862 SmallVectorImpl<SDNode *> &Created) const override;
863 SDValue getSqrtEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled,
864 int &ExtraSteps, bool &UseOneConst,
865 bool Reciprocal) const override;
866 SDValue getRecipEstimate(SDValue Operand, SelectionDAG &DAG, int Enabled,
867 int &ExtraSteps) const override;
868 SDValue getSqrtInputTest(SDValue Operand, SelectionDAG &DAG,
869 const DenormalMode &Mode,
870 SDNodeFlags Flags = {}) const override;
871 SDValue getSqrtResultForDenormInput(SDValue Operand,
872 SelectionDAG &DAG) const override;
873 unsigned combineRepeatedFPDivisors() const override;
874
875 ConstraintType getConstraintType(StringRef Constraint) const override;
876 Register getRegisterByName(const char* RegName, LLT VT,
877 const MachineFunction &MF) const override;
878
879private:
880 /// Examine constraint string and operand type and determine a weight value.
881 /// The operand object must already have been set up with the operand type.
883 getSingleConstraintMatchWeight(AsmOperandInfo &info,
884 const char *constraint) const override;
885
886 std::pair<unsigned, const TargetRegisterClass *>
887 getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
888 StringRef Constraint, MVT VT) const override;
889
890 const char *LowerXConstraint(EVT ConstraintVT) const override;
891
892 void LowerAsmOperandForConstraint(SDValue Op, StringRef Constraint,
893 std::vector<SDValue> &Ops,
894 SelectionDAG &DAG) const override;
895
897 getInlineAsmMemConstraint(StringRef ConstraintCode) const override {
898 if (ConstraintCode == "Q")
900 // FIXME: clang has code for 'Ump', 'Utf', 'Usa', and 'Ush' but these are
901 // followed by llvm_unreachable so we'll leave them unimplemented in
902 // the backend for now.
903 return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
904 }
905
906 /// Handle Lowering flag assembly outputs.
907 SDValue LowerAsmOutputForConstraint(SDValue &Chain, SDValue &Flag,
908 const SDLoc &DL,
909 const AsmOperandInfo &Constraint,
910 SelectionDAG &DAG) const override;
911
912 bool shouldExtendGSIndex(EVT VT, EVT &EltTy) const override;
913 bool shouldRemoveExtendFromGSIndex(SDValue Extend, EVT DataVT) const override;
914 bool isVectorLoadExtDesirable(SDValue ExtVal) const override;
915 bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
916 bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
917 bool getIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base,
918 SDValue &Offset, SelectionDAG &DAG,
919 ISD::MemIndexedMode AM) const;
920 bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset,
922 SelectionDAG &DAG) const override;
923 bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base,
925 SelectionDAG &DAG) const override;
926 bool isIndexingLegal(MachineInstr &MI, Register Base, Register Offset,
927 bool IsPre, MachineRegisterInfo &MRI) const override;
928
929 void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
930 SelectionDAG &DAG) const override;
931 void ReplaceBITCASTResults(SDNode *N, SmallVectorImpl<SDValue> &Results,
932 SelectionDAG &DAG) const;
933 void ReplaceExtractSubVectorResults(SDNode *N,
934 SmallVectorImpl<SDValue> &Results,
935 SelectionDAG &DAG) const;
936 void ReplaceGetActiveLaneMaskResults(SDNode *N,
937 SmallVectorImpl<SDValue> &Results,
938 SelectionDAG &DAG) const;
939
940 bool shouldNormalizeToSelectSequence(LLVMContext &, EVT, EVT) const override;
941
942 void finalizeLowering(MachineFunction &MF) const override;
943
944 bool shouldLocalize(const MachineInstr &MI,
945 const TargetTransformInfo *TTI) const override;
946
947 bool SimplifyDemandedBitsForTargetNode(SDValue Op,
948 const APInt &OriginalDemandedBits,
949 const APInt &OriginalDemandedElts,
950 KnownBits &Known,
952 unsigned Depth) const override;
953
954 bool canCreateUndefOrPoisonForTargetNode(
955 SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG,
956 UndefPoisonKind Kind, bool ConsiderFlags, unsigned Depth) const override;
957
958 bool isTargetCanonicalConstantNode(SDValue Op) const override;
959
960 // With the exception of data-predicate transitions, no instructions are
961 // required to cast between legal scalable vector types. However:
962 // 1. Packed and unpacked types have different bit lengths, meaning BITCAST
963 // is not universally useable.
964 // 2. Most unpacked integer types are not legal and thus integer extends
965 // cannot be used to convert between unpacked and packed types.
966 // These can make "bitcasting" a multiphase process. REINTERPRET_CAST is used
967 // to transition between unpacked and packed types of the same element type,
968 // with BITCAST used otherwise.
969 // This function does not handle predicate bitcasts.
970 SDValue getSVESafeBitCast(EVT VT, SDValue Op, SelectionDAG &DAG) const;
971
972 // Returns the runtime value for PSTATE.SM by generating a call to
973 // __arm_sme_state.
974 SDValue getRuntimePStateSM(SelectionDAG &DAG, SDValue Chain, SDLoc DL,
975 EVT VT) const;
976
977 bool preferScalarizeSplat(SDNode *N) const override;
978
979 unsigned getMinimumJumpTableEntries() const override;
980
981 bool shouldScalarizeBinop(SDValue VecOp) const override {
982 return VecOp.getOpcode() == ISD::SETCC;
983 }
984
985 bool hasMultipleConditionRegisters(EVT VT) const override {
986 return VT.isScalableVector();
987 }
988};
989
990namespace AArch64 {
991FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
992 const TargetLibraryInfo *libInfo,
993 const LibcallLoweringInfo *libcallLowering);
994
995// Determine the effective TLS model for an ELF global, applying
996// AArch64-specific restrictions and configuration.
997TLSModel::Model getELFTLSModel(const GlobalValue *GV,
998 const AArch64TargetMachine &TM,
999 bool HasELFSignedGOT);
1000} // end namespace AArch64
1001
1002} // end namespace llvm
1003
1004#endif
return SDValue()
const AArch64Subtarget & Subtarget
uint64_t uint64_t
uint64_t Imm
static SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG)
static SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerVectorFP_TO_INT(SDValue Op, SelectionDAG &DAG)
static SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerCTTZ(SDNode *N, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerFP_TO_INT_SAT(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *Subtarget)
static SDValue LowerMUL(SDValue Op, SelectionDAG &DAG)
static SDValue LowerMLOAD(SDValue Op, SelectionDAG &DAG)
static SDValue LowerVectorINT_TO_FP(SDValue Op, SelectionDAG &DAG)
static SDValue LowerVSETCC(SDValue Op, SelectionDAG &DAG, const ARMSubtarget *ST)
static SDValue LowerSETCCCARRY(SDValue Op, SelectionDAG &DAG)
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
Function Alias Analysis Results
static SDValue getTargetNode(ConstantPoolSDNode *N, const SDLoc &DL, EVT Ty, SelectionDAG &DAG, unsigned Flags)
#define X(NUM, ENUM, NAME)
Definition ELF.h:665
block Block Frequency Analysis
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
iv Induction Variable Users
Definition IVUsers.cpp:48
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define RegName(no)
lazy value info
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
Register const TargetRegisterInfo * TRI
Promote Memory to Register
Definition Mem2Reg.cpp:110
PowerPC Reduce CR logical Operation
RISCVCC::CondCode CC
MachineRegisterInfo & MRI
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
static SDValue LowerLOAD(SDValue Op, SelectionDAG &DAG)
static SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG, const SparcSubtarget *Subtarget)
static SDValue LowerBR_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad, bool isV9, bool is64Bit)
static SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, bool hasHardQuad, bool isV9, bool is64Bit)
static SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG)
static SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
static SDValue LowerSTORE(SDValue Op, SelectionDAG &DAG)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
This file describes how to lower LLVM code to machine code.
static SDValue LowerCLMUL(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerADJUST_TRAMPOLINE(SDValue Op, SelectionDAG &DAG)
static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerBITCAST(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerMSCATTER(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerShiftParts(SDValue Op, SelectionDAG &DAG)
Lower SRA_PARTS and friends, which return two i32 values and take a 2 x i32 value to shift plus a shi...
static SDValue LowerAVG(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerINSERT_SUBVECTOR(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerMGATHER(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerVACOPY(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerPARTIAL_REDUCE_MLA(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
Lower an i8 x i8 -> i32 or i16 x i16 -> i32 partial reduction to the matching VNNI dot product.
static SDValue LowerMSTORE(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
static SDValue LowerEXTEND_VECTOR_INREG(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
static SDValue LowerVECREDUCE(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG, bool AllowScalarization)
Value * RHS
Value * LHS
static SDValue LowerCallResult(SDValue Chain, SDValue InGlue, const SmallVectorImpl< CCValAssign > &RVLocs, const SDLoc &dl, SelectionDAG &DAG, SmallVectorImpl< SDValue > &InVals)
LowerCallResult - Lower the result values of a call into the appropriate copies out of appropriate ph...
bool isTruncateFree(Type *Ty1, Type *Ty2) const override
Return true if it's free to truncate a value of type FromTy to type ToTy.
bool supportSplitCSR(MachineFunction *MF) const override
Return true if the target supports that a subset of CSRs for the given machine function is handled ex...
SDValue changeStreamingMode(SelectionDAG &DAG, SDLoc DL, bool Enable, SDValue Chain, SDValue InGlue, unsigned Condition, bool InsertVectorLengthCheck=false) const
If a change in streaming mode is required on entry to/return from a function call it emits and return...
Register getExceptionSelectorRegister(ExceptionHandling EH, const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception typeid on entry to a la...
bool shouldFoldMaskToVariableShiftPair(SDValue Y) const override
Return true if it is profitable to fold a pair of shifts into a mask.
MVT getRegisterTypeForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Certain combinations of ABIs, Targets and features require that types are legal for some operations a...
bool shouldReduceLoadWidth(SDNode *Load, ISD::LoadExtType ExtTy, EVT NewVT, std::optional< unsigned > ByteOffset) const override
Return true if it is profitable to reduce a load to a smaller type.
bool optimizeVectorCrossLaneOperation(Instruction *I, Loop *L) const override
Value * getIRStackGuard(IRBuilderBase &IRB, const LibcallLoweringInfo &Libcalls) const override
If the target has a standard location for the stack protector cookie, returns the address of that loc...
Value * getSafeStackPointerLocation(IRBuilderBase &IRB, const LibcallLoweringInfo &Libcalls) const override
If the target has a standard location for the unsafe stack pointer, returns the address of that locat...
void initializeSplitCSR(MachineBasicBlock *Entry) const override
Perform necessary initialization to handle a subset of CSRs explicitly via copies.
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth=0) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
bool hasAndNotCompare(SDValue V) const override
Return true if the target should transform: (X & Y) == Y ---> (~X & Y) == 0 (X & Y) !...
TargetLoweringBase::LegalizeTypeAction getPreferredVectorAction(MVT VT) const override
Return the preferred vector type legalization action.
void insertSSPDeclarations(Module &M, const LibcallLoweringInfo &Libcalls) const override
Inserts necessary declarations for SSP (stack protection) purpose.
bool isShuffleMaskLegal(ArrayRef< int > M, EVT VT) const override
Return true if the given shuffle mask can be codegen'd directly, or if it should be stack expanded.
bool isAllActivePredicate(const SelectionDAG &DAG, SDValue N) const
unsigned getVaListSizeInBits(const DataLayout &DL) const override
Returns the size of the platform's va_list object.
MachineBasicBlock * EmitZAInstr(unsigned Opc, unsigned BaseReg, MachineInstr &MI, MachineBasicBlock *BB) const
void insertCopiesSplitCSR(MachineBasicBlock *Entry, const SmallVectorImpl< MachineBasicBlock * > &Exits) const override
Insert explicit copies in entry and exit blocks.
int64_t getPreferredLargeGEPBaseOffset(int64_t MinOffset, int64_t MaxOffset) const override
Return the prefered common base offset.
bool shouldLowerReductionToSVE(SDValue RdxOp, std::optional< Intrinsic::ID > &PairwiseOpIID) const
Returns true if RdxOp should be lowered to a SVE reduction.
bool isNarrowingProfitable(SDNode *N, EVT SrcVT, EVT DestVT) const override
Return true if it's profitable to narrow operations of type SrcVT to DestVT.
FPImmAction getFPImmAction(const APFloat &Imm, EVT VT, bool ForCodeSize) const override
Returns how the legalizer should materialize the specified FP immediate.
bool lowerInterleavedStore(Instruction *Store, Value *Mask, ShuffleVectorInst *SVI, unsigned Factor, const APInt &GapMask) const override
Lower an interleaved store into a stN intrinsic.
MachineBasicBlock * EmitTileLoad(unsigned Opc, unsigned BaseReg, MachineInstr &MI, MachineBasicBlock *BB) const
unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL, bool UseScalable) const
Returns the number of interleaved accesses that will be generated when lowering accesses of the given...
Instruction * emitLeadingFence(IRBuilderBase &Builder, Instruction *Inst, AtomicOrdering Ord) const override
Inserts in the IR a target-specific intrinsic specifying a fence.
bool shouldFoldConstantShiftPairToMask(const SDNode *N) const override
Return true if it is profitable to fold a pair of shifts into a mask.
bool shouldConvertConstantLoadToIntImm(const APInt &Imm, Type *Ty) const override
Returns true if it is beneficial to convert a load of a constant to just the constant itself.
bool preferSelectsOverBooleanArithmetic(EVT VT) const override
Should we prefer selects to doing arithmetic on boolean types.
unsigned getNumRegistersForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT) const override
Certain targets require unusual breakdowns of certain types.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
Provide custom lowering hooks for some operations.
bool shouldConvertFpToSat(unsigned Op, EVT FPVT, EVT VT) const override
Should we generate fp_to_si_sat and fp_to_ui_sat from type FPVT to type VT.
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT, const MachineFunction &MF) const override
Returns if it's reasonable to merge stores to MemVT size.
bool shouldOptimizeMulOverflowWithZeroHighBits(LLVMContext &Context, EVT VT) const override
bool aggressivelyPreferBuildVectorSources(EVT VecVT) const override
MachineBasicBlock * EmitLoweredSetFpmr(MachineInstr &MI, MachineBasicBlock *MBB) const
CondMergingParams getJumpConditionMergingParams(Instruction::BinaryOps Opc, const Value *Lhs, const Value *Rhs, const Function *F) const override
bool shouldInsertTrailingSeqCstFenceForAtomicStore(const Instruction *I) const override
Whether AtomicExpandPass should automatically insert a seq_cst trailing fence without reducing the or...
bool isIntDivCheap(EVT VT, AttributeList Attr) const override
Return true if integer divide is usually cheaper than a sequence of several shifts,...
bool shouldRemoveRedundantExtend(SDValue Op) const override
Return true (the default) if it is profitable to remove a sext_inreg(x) where the sext is redundant,...
bool shallExtractConstSplatVectorElementToStore(Type *VectorTy, unsigned ElemSizeInBits, unsigned &Index) const override
Return true if the target shall perform extract vector element and store given that the vector is kno...
CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC) const
Selects the correct CCAssignFn for a given CallingConvention value.
bool supportPtrAuthBundles() const override
Return true if the target supports ptrauth operand bundles.
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
Return the ISD::SETCC ValueType.
bool optimizeExtendOrTruncateConversion(Instruction *I, Loop *L, const TargetTransformInfo &TTI) const override
Try to optimize extending or truncating conversion instructions (like zext, trunc,...
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool IsVarArg) const
Selects the correct CCAssignFn for a given CallingConvention value.
TargetLoweringBase::AtomicExpansionKind shouldCastAtomicStoreInIR(StoreInst *SI) const override
Returns how the given (atomic) store should be cast by the IR-level AtomicExpand pass into.
bool findOptimalMemOpLowering(LLVMContext &Context, std::vector< EVT > &MemOps, unsigned Limit, const MemOp &Op, unsigned DstAS, unsigned SrcAS, const AttributeList &FuncAttributes, EVT *LargestVT=nullptr) const override
Determines the optimal series of memory ops to replace the memset / memcpy.
MachineMemOperand::Flags getTargetMMOFlags(const Instruction &I) const override
This callback is used to inspect load/store instructions and add target-specific MachineMemOperand fl...
unsigned getVectorIdxWidth(const DataLayout &DL) const override
Returns the type to be used for the index operand vector operations.
bool hasInlineStackProbe(const MachineFunction &MF) const override
True if stack clash protection is enabled for this functions.
bool shouldFoldSelectWithIdentityConstant(unsigned BinOpcode, EVT VT, unsigned SelectOpcode, SDValue X, SDValue Y) const override
Return true if pulling a binary operation into a select with an identity constant is profitable.
bool isLegalICmpImmediate(int64_t) const override
Return true if the specified immediate is legal icmp immediate, that is the target has icmp instructi...
Value * emitStoreConditional(IRBuilderBase &Builder, Value *Val, Value *Addr, AtomicOrdering Ord) const override
Perform a store-conditional operation to Addr.
bool preferIncOfAddToSubOfNot(EVT VT) const override
These two forms are equivalent: sub y, (xor x, -1) add (add x, 1), y The variant with two add's is IR...
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass.
ShiftLegalizationStrategy preferredShiftLegalizationStrategy(SelectionDAG &DAG, SDNode *N, unsigned ExpansionFactor) const override
bool useStackGuardMixFP() const override
If this function returns true, stack protection checks should mix the frame pointer (or whichever poi...
bool isOpSuitableForLSE128(const Instruction *I) const
void fixupPtrauthDiscriminator(MachineInstr &MI, MachineBasicBlock *BB, MachineOperand &IntDiscOp, MachineOperand &AddrDiscOp, const TargetRegisterClass *AddrDiscRC) const
Replace (0, vreg) discriminator components with the operands of blend or with (immediate,...
bool lowerInterleavedLoad(Instruction *Load, Value *Mask, ArrayRef< ShuffleVectorInst * > Shuffles, ArrayRef< unsigned > Indices, unsigned Factor, const APInt &GapMask) const override
Lower an interleaved load into a ldN intrinsic.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicRMWInIR(const AtomicRMWInst *AI) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all.
bool fallBackToDAGISel(const Instruction &Inst) const override
bool isTypeDesirableForOp(unsigned Opc, EVT VT) const override
Return true if the target has native support for the specified value type and it is 'desirable' to us...
bool isLegalAddScalableImmediate(int64_t) const override
Return true if adding the specified scalable immediate is legal, that is the target has add instructi...
bool shouldFormOverflowOp(unsigned Opcode, EVT VT, bool MathUsed) const override
Try to convert math with an overflow comparison into the corresponding DAG node operation.
Value * createComplexDeinterleavingIR(IRBuilderBase &B, ComplexDeinterleavingOperation OperationType, ComplexDeinterleavingRotation Rotation, Value *InputA, Value *InputB, Value *Accumulator=nullptr) const override
Create the IR node for the given complex deinterleaving operation.
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace=0, Align Alignment=Align(1), MachineMemOperand::Flags Flags=MachineMemOperand::MONone, unsigned *Fast=nullptr) const override
Returns true if the target allows unaligned memory accesses of the specified type.
unsigned computeNumSignBitsForTargetInstr(GISelValueTracking &Analysis, Register R, const APInt &DemandedElts, const MachineRegisterInfo &MRI, unsigned Depth=0) const override
This method can be implemented by targets that want to expose additional information about sign bits ...
MachineBasicBlock * EmitCheckMatchingVL(MachineInstr &MI, MachineBasicBlock *MBB) const
bool lowerDeinterleaveIntrinsicToLoad(Instruction *Load, Value *Mask, IntrinsicInst *DI, const APInt &GapMask) const override
Lower a deinterleave intrinsic to a target specific load intrinsic.
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
bool isLegalInterleavedAccessType(VectorType *VecTy, const DataLayout &DL, bool &UseScalable) const
Returns true if VecTy is a legal interleaved access type.
bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg, const DataLayout &DL) const override
For some targets, an LLVM struct type must be broken down into multiple simple types,...
Value * emitLoadLinked(IRBuilderBase &Builder, Type *ValueTy, Value *Addr, AtomicOrdering Ord) const override
Perform a load-linked operation on Addr, returning a "Value *" with the corresponding pointee type.
MachineBasicBlock * EmitLoweredCatchRet(MachineInstr &MI, MachineBasicBlock *BB) const
TargetLoweringBase::AtomicExpansionKind shouldCastAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be cast by the IR-level AtomicExpand pass.
bool isComplexDeinterleavingSupported() const override
Does this target support complex deinterleaving.
bool isZExtFree(Type *Ty1, Type *Ty2) const override
Return true if any actual instruction that defines a value of type FromTy implicitly zero-extends the...
EVT getAsmOperandValueType(const DataLayout &DL, Type *Ty, bool AllowUnknown=false) const override
SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const
MachineBasicBlock * EmitZero(MachineInstr &MI, MachineBasicBlock *BB) const
SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override
This method will be invoked for all target nodes and for any target-independent nodes that the target...
bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override
Return if the target supports combining a chain like:
bool isProfitableToHoist(Instruction *I) const override
Check if it is profitable to hoist instruction in then/else to if.
bool isOpSuitableForRCPC3(const Instruction *I) const
MVT getPointerTy(const DataLayout &DL, uint32_t AS=0) const override
Return the pointer type for the given address space, defaults to the pointer type from the data layou...
bool isCheapToSpeculateCttz(Type *) const override
Return true if it is cheap to speculate a call to intrinsic cttz.
unsigned getRedZoneSize(const Function &F) const
bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF, EVT VT) const override
Return true if an FMA operation is faster than a pair of fmul and fadd instructions.
MachineBasicBlock * EmitZTInstr(MachineInstr &MI, MachineBasicBlock *BB, unsigned Opcode, bool Op0IsDef) const
bool hasAndNot(SDValue Y) const override
Return true if the target has a bitwise and-not operation: X = ~A & B This can be used to simplify se...
MachineBasicBlock * EmitFill(MachineInstr &MI, MachineBasicBlock *BB) const
bool isCheapToSpeculateCtlz(Type *) const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
MachineBasicBlock * EmitEntryPStateSM(MachineInstr &MI, MachineBasicBlock *BB) const
bool shouldInsertFencesForAtomic(const Instruction *I) const override
Whether AtomicExpandPass should automatically insert fences and reduce ordering for this atomic.
bool isReassocProfitable(SelectionDAG &DAG, SDValue N0, SDValue N1) const override
Control the following reassociation of operands: (op (op x, c1), y) -> (op (op x, y),...
bool shouldPreservePtrArith(const Function &F, EVT PtrVT) const override
In AArch64, true if FEAT_CPA is present.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicStoreInIR(StoreInst *SI) const override
Returns how the given (atomic) store should be expanded by the IR-level AtomicExpand pass into.
MachineBasicBlock * EmitF128CSEL(MachineInstr &MI, MachineBasicBlock *BB) const
LLT getOptimalMemOpLLT(const MemOp &Op, const AttributeList &FuncAttributes) const override
LLT returning variant.
bool isDesirableToPullExtFromShl(const MachineInstr &MI) const override
GlobalISel - return true if it's profitable to perform the combine: shl ([sza]ext x),...
bool shouldProduceAndByConstByHoistingConstFromShiftsLHSOfAnd(SDValue X, ConstantSDNode *XC, ConstantSDNode *CC, SDValue Y, unsigned OldShiftOpcode, unsigned NewShiftOpcode, SelectionDAG &DAG) const override
Given the pattern (X & (C l>>/<< Y)) ==/!= 0 return true if it should be transformed into: ((X <</l>>...
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
bool needsFixedCatchObjects() const override
Used for exception handling on Win64.
const AArch64TargetMachine & getTM() const
bool preferVectorizedNonPowerOfTwoTypeBreakdown() const override
Return true if fixed-length, non-power-of-two vectors should be broken down into legal vector parts i...
unsigned getVectorTypeBreakdownForCallingConv(LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT, unsigned &NumIntermediates, MVT &RegisterVT) const override
Certain targets such as MIPS require that some types such as vectors are always broken down into scal...
bool targetShrinkDemandedConstant(SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts, TargetLoweringOpt &TLO) const override
EVT getOptimalMemOpType(LLVMContext &Context, const MemOp &Op, const AttributeList &FuncAttributes) const override
Returns the target specific optimal type for load and store operations as a result of memset,...
bool generateFMAsInMachineCombiner(EVT VT, CodeGenOptLevel OptLevel) const override
bool isComplexDeinterleavingOperationSupported(ComplexDeinterleavingOperation Operation, Type *Ty) const override
Does this target support complex deinterleaving with the given operation and type.
Register getExceptionPointerRegister(ExceptionHandling EH, const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
Value * emitCanLoadSpeculatively(IRBuilderBase &Builder, Value *Ptr, Value *SizeInBytes) const override
Emit code to check if a speculative load of the given size from Ptr is safe.
bool isOpSuitableForLDPSTP(const Instruction *I) const
AArch64TargetLowering(const TargetMachine &TM, const AArch64Subtarget &STI)
bool hasPairedLoad(EVT LoadedType, Align &RequiredAlignment) const override
Return true if the target supplies and combines to a paired load two loaded values of type LoadedType...
bool isLegalAddImmediate(int64_t) const override
Return true if the specified immediate is legal add immediate, that is the target has add instruction...
bool shouldConsiderGEPOffsetSplit() const override
bool shouldTransformSignedTruncationCheck(EVT XVT, unsigned KeptBits) const override
Should we tranform the IR-optimal check for whether given truncation down into KeptBits would be trun...
SDValue emitStackGuardMixFP(SelectionDAG &DAG, SDValue Val, const SDLoc &DL) const override
bool isVectorClearMaskLegal(ArrayRef< int > M, EVT VT) const override
Similar to isShuffleMaskLegal.
const MCPhysReg * getScratchRegisters(CallingConv::ID CC) const override
Returns a 0 terminated array of registers that can be safely used as scratch registers.
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo, const LibcallLoweringInfo *libcallLowering) const override
This method returns a target specific FastISel object, or null if the target does not support "fast" ...
void emitAtomicCmpXchgNoStoreLLBalance(IRBuilderBase &Builder) const override
bool useLoadStackGuardNode(const Module &M) const override
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
void getTgtMemIntrinsic(SmallVectorImpl< IntrinsicInfo > &Infos, const CallBase &I, MachineFunction &MF, unsigned Intrinsic) const override
getTgtMemIntrinsic - Represent NEON load and store intrinsics as MemIntrinsicNodes.
ArrayRef< MCPhysReg > getRoundingControlRegisters() const override
Returns a 0 terminated array of rounding control registers that can be attached into strict FP call.
bool isFPImmLegalAsFMov(const APFloat &Imm, EVT VT) const
bool lowerInterleaveIntrinsicToStore(Instruction *Store, Value *Mask, ArrayRef< Value * > InterleaveValues) const override
Lower an interleave intrinsic to a target specific store intrinsic.
MachineInstr * EmitKCFICheck(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator &MBBI, const TargetInstrInfo *TII) const override
ExtractSubvectorCost getExtractSubvectorCost(EVT ResVT, EVT SrcVT, unsigned Index) const override
Return the cost of EXTRACT_SUBVECTOR for this result type with this index.
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
Return true if the addressing mode represented by AM is legal for this target, for a load/store of th...
unsigned ComputeNumSignBitsForTargetNode(SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth) const override
This method can be implemented by targets that want to expose additional information about sign bits ...
bool isDesirableToCommuteXorWithShift(const SDNode *N) const override
Returns false if N is a bit extraction pattern of (X >> C) & Mask.
bool isDesirableToCommuteWithShift(const SDNode *N, CombineLevel Level) const override
Returns false if N is a bit extraction pattern of (X >> C) & Mask.
bool supportSwiftError() const override
Return true if the target supports swifterror attribute.
bool enableAggressiveFMAFusion(EVT VT) const override
Enable aggressive FMA fusion on targets that want it.
MVT getScalarShiftAmountTy(const DataLayout &DL, EVT) const override
Return the type to use for a scalar shift opcode, given the shifted amount type.
MachineBasicBlock * EmitDynamicProbedAlloc(MachineInstr &MI, MachineBasicBlock *MBB) const
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicCmpXchgInIR(const AtomicCmpXchgInst *AI) const override
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass.
bool shouldExpandGetActiveLaneMask(EVT VT, EVT OpVT) const override
Return true if the @llvm.get.active.lane.mask intrinsic should be expanded using generic code in Sele...
bool supportKCFIBundles() const override
Return true if the target supports kcfi operand bundles.
bool isMulAddWithConstProfitable(SDValue AddNode, SDValue ConstNode) const override
Return true if it may be profitable to transform (mul (add x, c1), c2) -> (add (mul x,...
bool useSVEForFixedLengthVectorVT(EVT VT, bool OverrideNEON=false) const
bool shouldIssueAtomicLoadForAtomicEmulationLoop() const override
Register matchRegisterName(StringRef RegName) const
bool mergeStoresAfterLegalization(EVT VT) const override
SVE code generation for fixed length vectors does not custom lower BUILD_VECTOR.
Class for arbitrary precision integers.
Definition APInt.h:78
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
An instruction that atomically checks whether a specified value is in a memory location,...
an instruction that atomically reads a memory location, combines it with another value,...
CCState - This class holds information needed while lowering arguments and return values.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
This is an important base class in LLVM.
Definition Constant.h:44
A parsed version of the target data layout string in and methods for querying it.
Definition DataLayout.h:64
This is a fast-path instruction selection class that generates poor code and doesn't support illegal ...
Definition FastISel.h:67
FunctionLoweringInfo - This contains information that is global to a function that is used when lower...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition Function.h:273
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:731
Common base class shared among various IRBuilders.
Definition IRBuilder.h:111
A wrapper class for inspecting calls to intrinsic functions.
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
Tracks which library functions to use for a particular subtarget or function.
An instruction for reading from memory.
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
Machine Value Type.
static MVT getIntegerVT(unsigned BitWidth)
Instructions::iterator instr_iterator
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
Flags
Flags values. These may be or'd together.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
Wrapper class representing virtual and physical registers.
Definition Register.h:20
Wrapper class for IR location info (IR ordering and DebugLoc) to be passed into SDNode creation funct...
Represents one node in the SelectionDAG.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
This instruction constructs a fixed permutation of two input vectors.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
An instruction for storing to memory.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
TargetInstrInfo - Interface to description of machine instruction set.
Provides information about what library functions are available for the current target.
virtual bool shouldFormOverflowOp(unsigned Opcode, EVT VT, bool MathUsed) const
Try to convert math with an overflow comparison into the corresponding DAG node operation.
ShiftLegalizationStrategy
Return the preferred strategy to legalize tihs SHIFT instruction, with ExpansionFactor being the recu...
virtual unsigned getMinimumJumpTableEntries() const
Return lower limit for number of blocks in a jump table.
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
ExtractSubvectorCost
Enum that specifies how expensive lowering an EXTRACT_SUBVECTOR is.
FPImmAction
How the legalizer should materialize a floating-point immediate.
AtomicExpansionKind
Enum that specifies what an atomic load/AtomicRMWInst is expanded to, if at all.
virtual InlineAsm::ConstraintCode getInlineAsmMemConstraint(StringRef ConstraintCode) const
TargetLowering(const TargetLowering &)=delete
virtual unsigned combineRepeatedFPDivisors() const
Indicate whether this target prefers to combine FDIVs with the same divisor.
Primary interface to the complete machine description for the target machine.
This pass provides access to the codegen interfaces that are needed for IR-level transformations.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
LLVM Value Representation.
Definition Value.h:75
Base class of all SIMD vector types.
A range adaptor for a pair of iterators.
ArrayRef< MCPhysReg > getFPRArgRegs()
Rounding
Possible values of current rounding mode, which is specified in bits 23:22 of FPCR.
const unsigned StackProbeMaxLoopUnroll
Maximum number of iterations to unroll for a constant size probing loop.
const unsigned StackProbeMaxUnprobedStack
Maximum allowed number of unprobed bytes above SP at an ABI boundary.
const unsigned RoundingBitsPos
const uint64_t ReservedFPControlBits
ArrayRef< MCPhysReg > getGPRArgRegs()
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo, const LibcallLoweringInfo *libcallLowering)
TLSModel::Model getELFTLSModel(const GlobalValue *GV, const AArch64TargetMachine &TM, bool HasELFSignedGOT)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
@ CXX_FAST_TLS
Used for access functions.
Definition CallingConv.h:72
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
Definition ISDOpcodes.h:851
MemIndexedMode
MemIndexedMode enum - This enum defines the load / store indexed addressing modes.
CondCode
ISD::CondCode enum - These are ordered carefully to make the bitfields below work out,...
LoadExtType
LoadExtType enum - This enum defines the three variants of LOADEXT (load with extension).
This namespace contains an enum with a value for every intrinsic/builtin function known by LLVM.
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
@ Known
Known to have no common set bits.
bool CCAssignFn(unsigned ValNo, MVT ValVT, MVT LocVT, CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags, Type *OrigTy, CCState &State)
CCAssignFn - This function assigns a location for Val, updating State to reflect the change.
@ Load
The value being inserted comes from a load (InsertElement only).
@ Store
The extracted value is stored (ExtractElement only).
CodeGenOptLevel
Code generation optimization level.
Definition CodeGen.h:280
AtomicOrdering
Atomic ordering for LLVM's memory model.
TargetTransformInfo TTI
CombineLevel
Definition DAGCombine.h:15
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
Definition MCRegister.h:21
@ Fast
Assign the register banks as fast as possible (default).
DWARFExpression::Operation Op
ExceptionHandling
Definition CodeGen.h:54
UndefPoisonKind
Enumeration to track whether we are interested in Undef, Poison, or both.
Definition UndefPoison.h:20
@ Enabled
Convert any .debug_str_offsets tables to DWARF64 if needed.
Definition DWP.h:31
@ Enable
Enable colors.
Definition WithColor.h:47
MCRegisterClass TargetRegisterClass
Definition FastISel.h:58
#define N
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Represent subnormal handling kind for floating point instruction inputs and outputs.
Extended Value Type.
Definition ValueTypes.h:35
uint64_t getScalarSizeInBits() const
Definition ValueTypes.h:423
uint64_t getFixedSizeInBits() const
Return the size of the specified fixed width value type in bits.
Definition ValueTypes.h:419
bool isVector() const
Return true if this is a vector value type.
Definition ValueTypes.h:191
bool isScalableVector() const
Return true if this is a vector type where the runtime length is machine dependent.
Definition ValueTypes.h:202
These are IR-level optimization flags that may be propagated to SDNodes.
This contains information for each constraint that we are lowering.
A convenience struct that encapsulates a DAG, and two SDValues for returning information from TargetL...