LLVM 23.0.0git
ARMISelLowering.h
Go to the documentation of this file.
1//===- ARMISelLowering.h - ARM 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 ARM uses to lower LLVM code into a
10// selection DAG.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
15#define LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
16
19#include "llvm/ADT/StringRef.h"
27#include "llvm/IR/Attributes.h"
28#include "llvm/IR/CallingConv.h"
29#include "llvm/IR/Function.h"
30#include "llvm/IR/InlineAsm.h"
32#include <optional>
33#include <utility>
34
35namespace llvm {
36
38class ARMSubtarget;
39class DataLayout;
40class FastISel;
42class GlobalValue;
44class Instruction;
45class IRBuilderBase;
47class MachineInstr;
48class SelectionDAG;
50class TargetMachine;
52class VectorType;
53
54 namespace ARM {
55 /// Possible values of current rounding mode, which is specified in bits
56 /// 23:22 of FPSCR.
57 enum Rounding {
58 RN = 0, // Round to Nearest
59 RP = 1, // Round towards Plus infinity
60 RM = 2, // Round towards Minus infinity
61 RZ = 3, // Round towards Zero
62 rmMask = 3 // Bit mask selecting rounding mode
63 };
64
65 // Bit position of rounding mode bits in FPSCR.
66 const unsigned RoundingBitsPos = 22;
67
68 // Bits of floating-point status. These are NZCV flags, QC bit and cumulative
69 // FP exception bits.
70 const unsigned FPStatusBits = 0xf800009f;
71
72 // Some bits in the FPSCR are not yet defined. They must be preserved when
73 // modifying the contents.
74 const unsigned FPReservedBits = 0x00006060;
75 } // namespace ARM
76
77 /// Define some predicates that are used for node matching.
78 namespace ARM {
79
80 bool isBitFieldInvertedMask(unsigned v);
81
82 } // end namespace ARM
83
84 //===--------------------------------------------------------------------===//
85 // ARMTargetLowering - ARM Implementation of the TargetLowering interface
86
88 // Copying needed for an outgoing byval argument.
89 enum ByValCopyKind {
90 // Argument is already in the correct location, no copy needed.
91 NoCopy,
92 // Argument value is currently in the local stack frame, needs copying to
93 // outgoing arguemnt area.
94 CopyOnce,
95 // Argument value is currently in the outgoing argument area, but not at
96 // the correct offset, so needs copying via a temporary in local stack
97 // space.
98 CopyViaTemp,
99 };
100
101 public:
102 explicit ARMTargetLowering(const TargetMachine &TM,
103 const ARMSubtarget &STI);
104
105 const ARMBaseTargetMachine &getTM() const;
106
107 unsigned getJumpTableEncoding() const override;
108 bool useSoftFloat() const override;
109
110 SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override;
111
112 /// ReplaceNodeResults - Replace the results of node with an illegal result
113 /// type with new values built out of custom code.
115 SelectionDAG &DAG) const override;
116
117 bool isSelectSupported(SelectSupportKind Kind) const override {
118 // ARM does not support scalar condition selects on vectors.
119 return (Kind != ScalarCondVectorVal);
120 }
121
122 bool isReadOnly(const GlobalValue *GV) const;
123
124 /// getSetCCResultType - Return the value type to use for ISD::SETCC.
126 EVT VT) const override;
127
130 MachineBasicBlock *MBB) const override;
131
133 SDNode *Node) const override;
134
135 bool supportKCFIBundles() const override;
136
139 const TargetInstrInfo *TII) const override;
140
144 SDValue PerformIntrinsicCombine(SDNode *N, DAGCombinerInfo &DCI) const;
145 SDValue PerformMVEExtCombine(SDNode *N, DAGCombinerInfo &DCI) const;
146 SDValue PerformMVETruncCombine(SDNode *N, DAGCombinerInfo &DCI) const;
147 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
148
150 const APInt &OriginalDemandedBits,
151 const APInt &OriginalDemandedElts,
152 KnownBits &Known,
153 TargetLoweringOpt &TLO,
154 unsigned Depth) const override;
155
156 bool isDesirableToTransformToIntegerOp(unsigned Opc, EVT VT) const override;
157
158 /// allowsMisalignedMemoryAccesses - Returns true if the target allows
159 /// unaligned memory accesses of the specified type. Returns whether it
160 /// is "fast" by reference in the second argument.
161 bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace,
162 Align Alignment,
164 unsigned *Fast) const override;
165
166 EVT getOptimalMemOpType(LLVMContext &Context, const MemOp &Op,
167 const AttributeList &FuncAttributes) const override;
168
169 bool isTruncateFree(Type *SrcTy, Type *DstTy) const override;
170 bool isTruncateFree(EVT SrcVT, EVT DstVT) const override;
171 bool isZExtFree(SDValue Val, EVT VT2) const override;
172 Type* shouldConvertSplatType(ShuffleVectorInst* SVI) const override;
173
174 bool isFNegFree(EVT VT) const override;
175
176 bool isVectorLoadExtDesirable(SDValue ExtVal) const override;
177
178 bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override;
179
180
181 /// isLegalAddressingMode - Return true if the addressing mode represented
182 /// by AM is legal for this target, for a load/store of the specified type.
183 bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM,
184 Type *Ty, unsigned AS,
185 Instruction *I = nullptr) const override;
186
187 bool isLegalT2ScaledAddressingMode(const AddrMode &AM, EVT VT) const;
188
189 /// Returns true if the addressing mode representing by AM is legal
190 /// for the Thumb1 target, for a load/store of the specified type.
191 bool isLegalT1ScaledAddressingMode(const AddrMode &AM, EVT VT) const;
192
193 /// isLegalICmpImmediate - Return true if the specified immediate is legal
194 /// icmp immediate, that is the target has icmp instructions which can
195 /// compare a register against the immediate without having to materialize
196 /// the immediate into a register.
197 bool isLegalICmpImmediate(int64_t Imm) const override;
198
199 /// isLegalAddImmediate - Return true if the specified immediate is legal
200 /// add immediate, that is the target has add instructions which can
201 /// add a register and the immediate without having to materialize
202 /// the immediate into a register.
203 bool isLegalAddImmediate(int64_t Imm) const override;
204
205 /// getPreIndexedAddressParts - returns true by value, base pointer and
206 /// offset pointer and addressing mode by reference if the node's address
207 /// can be legally represented as pre-indexed load / store address.
210 SelectionDAG &DAG) const override;
211
212 /// getPostIndexedAddressParts - returns true by value, base pointer and
213 /// offset pointer and addressing mode by reference if this node can be
214 /// combined with a load / store to form a post-indexed load / store.
217 SelectionDAG &DAG) const override;
218
220 const APInt &DemandedElts,
221 const SelectionDAG &DAG,
222 unsigned Depth) const override;
223
225 const APInt &DemandedElts,
226 TargetLoweringOpt &TLO) const override;
227
228 ConstraintType getConstraintType(StringRef Constraint) const override;
229
230 /// Examine constraint string and operand type and determine a weight value.
231 /// The operand object must already have been set up with the operand type.
233 AsmOperandInfo &info, const char *constraint) const override;
234
235 std::pair<unsigned, const TargetRegisterClass *>
237 StringRef Constraint, MVT VT) const override;
238
239 const char *LowerXConstraint(EVT ConstraintVT) const override;
240
241 /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
242 /// vector. If it is invalid, don't add anything to Ops. If hasMemory is
243 /// true it means one of the asm constraint of the inline asm instruction
244 /// being processed is 'm'.
246 std::vector<SDValue> &Ops,
247 SelectionDAG &DAG) const override;
248
250 getInlineAsmMemConstraint(StringRef ConstraintCode) const override {
251 if (ConstraintCode == "Q")
253 if (ConstraintCode.size() == 2) {
254 if (ConstraintCode[0] == 'U') {
255 switch(ConstraintCode[1]) {
256 default:
257 break;
258 case 'm':
260 case 'n':
262 case 'q':
264 case 's':
266 case 't':
268 case 'v':
270 case 'y':
272 }
273 }
274 }
275 return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
276 }
277
278 const ARMSubtarget* getSubtarget() const {
279 return Subtarget;
280 }
281
282 /// getRegClassFor - Return the register class that should be used for the
283 /// specified value type.
284 const TargetRegisterClass *
285 getRegClassFor(MVT VT, bool isDivergent = false) const override;
286
287 bool shouldAlignPointerArgs(CallInst *CI, unsigned &MinSize,
288 Align &PrefAlign) const override;
289
290 /// createFastISel - This method returns a target specific FastISel object,
291 /// or null if the target does not support "fast" ISel.
292 FastISel *
294 const TargetLibraryInfo *libInfo,
295 const LibcallLoweringInfo *libcallLowering) const override;
296
298
299 bool preferZeroCompareBranch() const override { return true; }
300
301 bool preferSelectsOverBooleanArithmetic(EVT VT) const override;
302
303 bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override;
304
305 bool hasAndNotCompare(SDValue V) const override {
306 // We can use bics for any scalar.
307 return V.getValueType().isScalarInteger();
308 }
309
310 bool
311 isShuffleMaskLegal(ArrayRef<int> M, EVT VT) const override;
312 bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override;
313
314 /// isFPImmLegal - Returns true if the target can instruction select the
315 /// specified FP immediate natively. If false, the legalizer will
316 /// materialize the FP immediate as a load from a constant pool.
317 bool isFPImmLegal(const APFloat &Imm, EVT VT,
318 bool ForCodeSize = false) const override;
319
320 bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallBase &I,
321 MachineFunction &MF,
322 unsigned Intrinsic) const override;
323
324 /// Returns true if it is beneficial to convert a load of a constant
325 /// to just the constant itself.
327 Type *Ty) const override;
328
329 /// Return true if EXTRACT_SUBVECTOR is cheap for this result type
330 /// with this index.
331 bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT,
332 unsigned Index) const override;
333
334 bool shouldFormOverflowOp(unsigned Opcode, EVT VT,
335 bool MathUsed) const override {
336 // Using overflow ops for overflow checks only should beneficial on ARM.
337 return TargetLowering::shouldFormOverflowOp(Opcode, VT, true);
338 }
339
340 bool shouldReassociateReduction(unsigned Opc, EVT VT) const override {
341 return Opc != ISD::VECREDUCE_ADD;
342 }
343
344 /// Returns true if an argument of type Ty needs to be passed in a
345 /// contiguous block of registers in calling convention CallConv.
347 Type *Ty, CallingConv::ID CallConv, bool isVarArg,
348 const DataLayout &DL) const override;
349
350 /// If a physical register, this returns the register that receives the
351 /// exception address on entry to an EH pad.
353 getExceptionPointerRegister(const Constant *PersonalityFn) const override;
354
355 /// If a physical register, this returns the register that receives the
356 /// exception typeid on entry to a landing pad.
358 getExceptionSelectorRegister(const Constant *PersonalityFn) const override;
359
361 Value *emitLoadLinked(IRBuilderBase &Builder, Type *ValueTy, Value *Addr,
362 AtomicOrdering Ord) const override;
363 Value *emitStoreConditional(IRBuilderBase &Builder, Value *Val, Value *Addr,
364 AtomicOrdering Ord) const override;
365
366 void
367 emitAtomicCmpXchgNoStoreLLBalance(IRBuilderBase &Builder) const override;
368
370 AtomicOrdering Ord) const override;
372 AtomicOrdering Ord) const override;
373
374 unsigned getMaxSupportedInterleaveFactor() const override;
375
376 bool lowerInterleavedLoad(Instruction *Load, Value *Mask,
378 ArrayRef<unsigned> Indices, unsigned Factor,
379 const APInt &GapMask) const override;
380 bool lowerInterleavedStore(Instruction *Store, Value *Mask,
381 ShuffleVectorInst *SVI, unsigned Factor,
382 const APInt &GapMask) const override;
383
384 bool shouldInsertFencesForAtomic(const Instruction *I) const override;
386 shouldExpandAtomicLoadInIR(LoadInst *LI) const override;
390 shouldExpandAtomicRMWInIR(const AtomicRMWInst *AI) const override;
392 shouldExpandAtomicCmpXchgInIR(const AtomicCmpXchgInst *AI) const override;
393
394 bool useLoadStackGuardNode(const Module &M) const override;
395
396 void
398 const LibcallLoweringInfo &Libcalls) const override;
399
400 bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx,
401 unsigned &Cost) const override;
402
404 SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG,
405 bool PoisonOnly, bool ConsiderFlags, unsigned Depth) const override;
406
407 bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT,
408 const MachineFunction &MF) const override {
409 // Do not merge to larger than i32.
410 return (MemVT.getSizeInBits() <= 32);
411 }
412
413 bool isCheapToSpeculateCttz(Type *Ty) const override;
414 bool isCheapToSpeculateCtlz(Type *Ty) const override;
415
416 bool convertSetCCLogicToBitwiseLogic(EVT VT) const override {
417 return VT.isScalarInteger();
418 }
419
420 bool supportSwiftError() const override {
421 return true;
422 }
423
424 bool supportSplitCSR(MachineFunction *MF) const override {
426 MF->getFunction().hasFnAttribute(Attribute::NoUnwind);
427 }
428
429 bool hasStandaloneRem(EVT VT) const override {
430 return HasStandaloneRem;
431 }
432
435 unsigned ExpansionFactor) const override;
436
437 CCAssignFn *CCAssignFnForCall(CallingConv::ID CC, bool isVarArg) const;
438 CCAssignFn *CCAssignFnForReturn(CallingConv::ID CC, bool isVarArg) const;
439
440 /// Returns true if \p VecTy is a legal interleaved access type. This
441 /// function checks the vector element type and the overall width of the
442 /// vector.
443 bool isLegalInterleavedAccessType(unsigned Factor, FixedVectorType *VecTy,
444 Align Alignment,
445 const DataLayout &DL) const;
446
448 SDValue ConstNode) const override;
449
450 bool alignLoopsWithOptSize() const override;
451
452 /// Returns the number of interleaved accesses that will be generated when
453 /// lowering accesses of the given type.
455 const DataLayout &DL) const;
456
457 void finalizeLowering(MachineFunction &MF) const override;
458
459 /// Return the correct alignment for the current calling convention.
461 const DataLayout &DL) const override;
462
464 CombineLevel Level) const override;
465
466 bool isDesirableToCommuteXorWithShift(const SDNode *N) const override;
467
468 bool shouldFoldConstantShiftPairToMask(const SDNode *N) const override;
469
470 /// Return true if it is profitable to fold a pair of shifts into a mask.
472 EVT VT = Y.getValueType();
473
474 if (VT.isVector())
475 return false;
476
477 return VT.getScalarSizeInBits() <= 32;
478 }
479
480 bool shouldFoldSelectWithIdentityConstant(unsigned BinOpcode, EVT VT,
481 unsigned SelectOpcode, SDValue X,
482 SDValue Y) const override;
483
484 bool preferIncOfAddToSubOfNot(EVT VT) const override;
485
486 bool shouldConvertFpToSat(unsigned Op, EVT FPVT, EVT VT) const override;
487
488 bool isComplexDeinterleavingSupported() const override;
490 ComplexDeinterleavingOperation Operation, Type *Ty) const override;
491
494 ComplexDeinterleavingRotation Rotation, Value *InputA, Value *InputB,
495 Value *Accumulator = nullptr) const override;
496
497 bool useFPRegsForHalfType() const override { return true; }
498
499 protected:
500 std::pair<const TargetRegisterClass *, uint8_t>
502 MVT VT) const override;
503
504 private:
505 /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can
506 /// make the right decision when generating code for different targets.
507 const ARMSubtarget *Subtarget;
508
510
511 const InstrItineraryData *Itins;
512
513 // TODO: remove this, and have shouldInsertFencesForAtomic do the proper
514 // check.
515 bool InsertFencesForAtomic;
516
517 bool HasStandaloneRem = true;
518
519 void addTypeForNEON(MVT VT, MVT PromotedLdStVT);
520 void addDRTypeForNEON(MVT VT);
521 void addQRTypeForNEON(MVT VT);
522 std::pair<SDValue, SDValue> getARMXALUOOp(SDValue Op, SelectionDAG &DAG, SDValue &ARMcc) const;
523
524 using RegsToPassVector = SmallVector<std::pair<unsigned, SDValue>, 8>;
525
526 void PassF64ArgInRegs(const SDLoc &dl, SelectionDAG &DAG, SDValue Chain,
527 SDValue &Arg, RegsToPassVector &RegsToPass,
528 CCValAssign &VA, CCValAssign &NextVA,
529 SDValue &StackPtr,
530 SmallVectorImpl<SDValue> &MemOpChains,
531 bool IsTailCall,
532 int SPDiff) const;
533 SDValue GetF64FormalArgument(CCValAssign &VA, CCValAssign &NextVA,
534 SDValue &Root, SelectionDAG &DAG,
535 const SDLoc &dl) const;
536
537 CallingConv::ID getEffectiveCallingConv(CallingConv::ID CC,
538 bool isVarArg) const;
539 CCAssignFn *CCAssignFnForNode(CallingConv::ID CC, bool Return,
540 bool isVarArg) const;
541 std::pair<SDValue, MachinePointerInfo>
542 computeAddrForCallArg(const SDLoc &dl, SelectionDAG &DAG,
543 const CCValAssign &VA, SDValue StackPtr,
544 bool IsTailCall, int SPDiff) const;
545 ByValCopyKind ByValNeedsCopyForTailCall(SelectionDAG &DAG, SDValue Src,
546 SDValue Dst,
547 ISD::ArgFlagsTy Flags) const;
548 SDValue LowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
549 SDValue LowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
550 SDValue LowerEH_SJLJ_SETUP_DISPATCH(SDValue Op, SelectionDAG &DAG) const;
551 SDValue LowerINTRINSIC_VOID(SDValue Op, SelectionDAG &DAG,
552 const ARMSubtarget *Subtarget) const;
553 SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG,
554 const ARMSubtarget *Subtarget) const;
555 SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
556 SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
557 SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
558 SDValue LowerGlobalAddressDarwin(SDValue Op, SelectionDAG &DAG) const;
559 SDValue LowerGlobalAddressELF(SDValue Op, SelectionDAG &DAG) const;
560 SDValue LowerGlobalAddressWindows(SDValue Op, SelectionDAG &DAG) const;
561 SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
562 SDValue LowerToTLSGeneralDynamicModel(GlobalAddressSDNode *GA,
563 SelectionDAG &DAG) const;
564 SDValue LowerToTLSExecModels(GlobalAddressSDNode *GA,
565 SelectionDAG &DAG,
566 TLSModel::Model model) const;
567 SDValue LowerGlobalTLSAddressDarwin(SDValue Op, SelectionDAG &DAG) const;
568 SDValue LowerGlobalTLSAddressWindows(SDValue Op, SelectionDAG &DAG) const;
569 SDValue LowerBR_JT(SDValue Op, SelectionDAG &DAG) const;
570 SDValue LowerSignedALUO(SDValue Op, SelectionDAG &DAG) const;
571 SDValue LowerUnsignedALUO(SDValue Op, SelectionDAG &DAG) const;
572 SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
579 SDValue LowerShiftRightParts(SDValue Op, SelectionDAG &DAG) const;
580 SDValue LowerShiftLeftParts(SDValue Op, SelectionDAG &DAG) const;
581 SDValue LowerGET_ROUNDING(SDValue Op, SelectionDAG &DAG) const;
582 SDValue LowerSET_ROUNDING(SDValue Op, SelectionDAG &DAG) const;
583 SDValue LowerSET_FPMODE(SDValue Op, SelectionDAG &DAG) const;
584 SDValue LowerRESET_FPMODE(SDValue Op, SelectionDAG &DAG) const;
585 SDValue LowerConstantFP(SDValue Op, SelectionDAG &DAG,
586 const ARMSubtarget *ST) const;
587 SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
588 const ARMSubtarget *ST) const;
589 SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
590 SDValue LowerDivRem(SDValue Op, SelectionDAG &DAG) const;
591 SDValue LowerDIV_Windows(SDValue Op, SelectionDAG &DAG, bool Signed) const;
592 void ExpandDIV_Windows(SDValue Op, SelectionDAG &DAG, bool Signed,
594 SDValue ExpandBITCAST(SDNode *N, SelectionDAG &DAG,
595 const ARMSubtarget *Subtarget) const;
596 SDValue LowerWindowsDIVLibCall(SDValue Op, SelectionDAG &DAG, bool Signed,
597 SDValue &Chain) const;
598 SDValue LowerREM(SDNode *N, SelectionDAG &DAG) const;
600 SDValue LowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const;
601 SDValue LowerFP_EXTEND(SDValue Op, SelectionDAG &DAG) const;
602 SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG) const;
603 SDValue LowerINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
604 SDValue LowerFSETCC(SDValue Op, SelectionDAG &DAG) const;
605 SDValue LowerSPONENTRY(SDValue Op, SelectionDAG &DAG) const;
607 SelectionDAG &DAG) const;
608 SDValue LowerFP_TO_BF16(SDValue Op, SelectionDAG &DAG) const;
609 SDValue LowerCMP(SDValue Op, SelectionDAG &DAG) const;
611
612 Register getRegisterByName(const char* RegName, LLT VT,
613 const MachineFunction &MF) const override;
614
615 SDValue BuildSDIVPow2(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
616 SmallVectorImpl<SDNode *> &Created) const override;
617
618 bool isFMAFasterThanFMulAndFAdd(const MachineFunction &MF,
619 EVT VT) const override;
620
621 SDValue MoveToHPR(const SDLoc &dl, SelectionDAG &DAG, MVT LocVT, MVT ValVT,
622 SDValue Val) const;
623 SDValue MoveFromHPR(const SDLoc &dl, SelectionDAG &DAG, MVT LocVT,
624 MVT ValVT, SDValue Val) const;
625
626 SDValue ReconstructShuffle(SDValue Op, SelectionDAG &DAG) const;
627
629 CallingConv::ID CallConv, bool isVarArg,
631 const SDLoc &dl, SelectionDAG &DAG,
632 SmallVectorImpl<SDValue> &InVals, bool isThisReturn,
633 SDValue ThisVal, bool isCmseNSCall) const;
634
635 void initializeSplitCSR(MachineBasicBlock *Entry) const override;
636 void insertCopiesSplitCSR(
637 MachineBasicBlock *Entry,
638 const SmallVectorImpl<MachineBasicBlock *> &Exits) const override;
639
640 bool splitValueIntoRegisterParts(
641 SelectionDAG & DAG, const SDLoc &DL, SDValue Val, SDValue *Parts,
642 unsigned NumParts, MVT PartVT, std::optional<CallingConv::ID> CC)
643 const override;
644
645 SDValue joinRegisterPartsIntoValue(
646 SelectionDAG & DAG, const SDLoc &DL, const SDValue *Parts,
647 unsigned NumParts, MVT PartVT, EVT ValueVT,
648 std::optional<CallingConv::ID> CC) const override;
649
650 SDValue
651 LowerFormalArguments(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
653 const SDLoc &dl, SelectionDAG &DAG,
654 SmallVectorImpl<SDValue> &InVals) const override;
655
656 int StoreByValRegs(CCState &CCInfo, SelectionDAG &DAG, const SDLoc &dl,
657 SDValue &Chain, const Value *OrigArg,
658 unsigned InRegsParamRecordIdx, int ArgOffset,
659 unsigned ArgSize) const;
660
661 void VarArgStyleRegisters(CCState &CCInfo, SelectionDAG &DAG,
662 const SDLoc &dl, SDValue &Chain,
663 unsigned ArgOffset, unsigned TotalArgRegsSaveSize,
664 bool ForceMutable = false) const;
665
667 SmallVectorImpl<SDValue> &InVals) const override;
668
669 /// HandleByVal - Target-specific cleanup for ByVal support.
670 void HandleByVal(CCState *, unsigned &, Align) const override;
671
672 /// IsEligibleForTailCallOptimization - Check whether the call is eligible
673 /// for tail call optimization. Targets which want to do tail call
674 /// optimization should implement this function.
675 bool IsEligibleForTailCallOptimization(
677 SmallVectorImpl<CCValAssign> &ArgLocs, const bool isIndirect) const;
678
679 bool CanLowerReturn(CallingConv::ID CallConv,
680 MachineFunction &MF, bool isVarArg,
682 LLVMContext &Context, const Type *RetTy) const override;
683
684 SDValue LowerReturn(SDValue Chain, CallingConv::ID CallConv, bool isVarArg,
686 const SmallVectorImpl<SDValue> &OutVals,
687 const SDLoc &dl, SelectionDAG &DAG) const override;
688
689 bool isUsedByReturnOnly(SDNode *N, SDValue &Chain) const override;
690
691 bool mayBeEmittedAsTailCall(const CallInst *CI) const override;
692
693 bool shouldConsiderGEPOffsetSplit() const override { return true; }
694
695 bool isUnsupportedFloatingType(EVT VT) const;
696
698
699 SDValue getCMOV(const SDLoc &dl, EVT VT, SDValue FalseVal, SDValue TrueVal,
700 SDValue ARMcc, SDValue Flags, SelectionDAG &DAG) const;
702 SDValue &ARMcc, SelectionDAG &DAG, const SDLoc &dl) const;
703 SDValue getVFPCmp(SDValue LHS, SDValue RHS, SelectionDAG &DAG,
704 const SDLoc &dl, bool Signaling = false) const;
705
706 SDValue OptimizeVFPBrcond(SDValue Op, SelectionDAG &DAG) const;
707
708 void SetupEntryBlockForSjLj(MachineInstr &MI, MachineBasicBlock *MBB,
709 MachineBasicBlock *DispatchBB, int FI) const;
710
711 void EmitSjLjDispatchBlock(MachineInstr &MI, MachineBasicBlock *MBB) const;
712
713 MachineBasicBlock *EmitStructByval(MachineInstr &MI,
714 MachineBasicBlock *MBB) const;
715
716 MachineBasicBlock *EmitLowered__chkstk(MachineInstr &MI,
717 MachineBasicBlock *MBB) const;
718 MachineBasicBlock *EmitLowered__dbzchk(MachineInstr &MI,
719 MachineBasicBlock *MBB) const;
720 void addMVEVectorTypes(bool HasMVEFP);
721 void addAllExtLoads(const MVT From, const MVT To, LegalizeAction Action);
722 void setAllExpand(MVT VT);
723 };
724
731
732 namespace ARM {
733
734 FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
735 const TargetLibraryInfo *libInfo,
736 const LibcallLoweringInfo *libcallLowering);
737
738 } // end namespace ARM
739
740} // end namespace llvm
741
742#endif // LLVM_LIB_TARGET_ARM_ARMISELLOWERING_H
static SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG)
return SDValue()
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
Function Alias Analysis Results
This file contains the simple types necessary to represent the attributes associated with functions a...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define RegName(no)
lazy value info
#define I(x, y, z)
Definition MD5.cpp:57
Register const TargetRegisterInfo * TRI
PowerPC Reduce CR logical Operation
This file defines the SmallVector class.
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 LowerRETURNADDR(SDValue Op, SelectionDAG &DAG, const SparcTargetLowering &TLI, const SparcSubtarget *Subtarget)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
static TableGen::Emitter::OptClass< SkeletonEmitter > X("gen-skeleton-class", "Generate example skeleton class")
This file describes how to lower LLVM code to machine code.
static SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG)
static SDValue LowerABS(SDValue Op, const X86Subtarget &Subtarget, SelectionDAG &DAG)
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...
Class for arbitrary precision integers.
Definition APInt.h:78
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 isReadOnly(const GlobalValue *GV) const
unsigned getMaxSupportedInterleaveFactor() const override
Get the maximum supported factor for interleaved memory accesses.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicLoadInIR(LoadInst *LI) const override
Returns how the given (atomic) load should be expanded by the IR-level AtomicExpand pass.
unsigned getNumInterleavedAccesses(VectorType *VecTy, const DataLayout &DL) const
Returns the number of interleaved accesses that will be generated when lowering accesses of the given...
bool shouldInsertFencesForAtomic(const Instruction *I) const override
Whether AtomicExpandPass should automatically insert fences and reduce ordering for this atomic.
Align getABIAlignmentForCallingConv(Type *ArgTy, const DataLayout &DL) const override
Return the correct alignment for the current calling convention.
bool isDesirableToCommuteWithShift(const SDNode *N, CombineLevel Level) const override
Return true if it is profitable to move this shift by a constant amount through its operand,...
Register getExceptionPointerRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception address on entry to an ...
ConstraintWeight getSingleConstraintMatchWeight(AsmOperandInfo &info, const char *constraint) const override
Examine constraint string and operand type and determine a weight value.
bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, unsigned AS, Instruction *I=nullptr) const override
isLegalAddressingMode - Return true if the addressing mode represented by AM is legal for this target...
const ARMSubtarget * getSubtarget() const
bool isLegalT2ScaledAddressingMode(const AddrMode &AM, EVT VT) const
bool isLegalT1ScaledAddressingMode(const AddrMode &AM, EVT VT) const
Returns true if the addressing mode representing by AM is legal for the Thumb1 target,...
bool getPreIndexedAddressParts(SDNode *N, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override
getPreIndexedAddressParts - returns true by value, base pointer and offset pointer and addressing mod...
bool getTgtMemIntrinsic(IntrinsicInfo &Info, const CallBase &I, MachineFunction &MF, unsigned Intrinsic) const override
getTgtMemIntrinsic - Represent NEON load and store intrinsics as MemIntrinsicNodes.
MachineInstr * EmitKCFICheck(MachineBasicBlock &MBB, MachineBasicBlock::instr_iterator &MBBI, const TargetInstrInfo *TII) const override
InlineAsm::ConstraintCode getInlineAsmMemConstraint(StringRef ConstraintCode) const override
bool shouldAlignPointerArgs(CallInst *CI, unsigned &MinSize, Align &PrefAlign) const override
Return true if the pointer arguments to CI should be aligned by aligning the object whose address is ...
void ReplaceNodeResults(SDNode *N, SmallVectorImpl< SDValue > &Results, SelectionDAG &DAG) const override
ReplaceNodeResults - Replace the results of node with an illegal result type with new values built ou...
void emitAtomicCmpXchgNoStoreLLBalance(IRBuilderBase &Builder) const override
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 isLegalAddImmediate(int64_t Imm) const override
isLegalAddImmediate - Return true if the specified immediate is legal add immediate,...
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,...
Instruction * emitTrailingFence(IRBuilderBase &Builder, Instruction *Inst, AtomicOrdering Ord) const override
bool supportSwiftError() const override
Return true if the target supports swifterror attribute.
bool isFNegFree(EVT VT) const override
Return true if an fneg operation is free to the point where it is never worthwhile to replace it with...
void finalizeLowering(MachineFunction &MF) const override
Execute target specific actions to finalize target lowering.
SDValue PerformMVETruncCombine(SDNode *N, DAGCombinerInfo &DCI) const
bool isFPImmLegal(const APFloat &Imm, EVT VT, bool ForCodeSize=false) const override
isFPImmLegal - Returns true if the target can instruction select the specified FP immediate natively.
ConstraintType getConstraintType(StringRef Constraint) const override
getConstraintType - Given a constraint letter, return the type of constraint it is for this target.
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...
bool useFPRegsForHalfType() const override
void computeKnownBitsForTargetNode(const SDValue Op, KnownBits &Known, const APInt &DemandedElts, const SelectionDAG &DAG, unsigned Depth) const override
Determine which of the bits specified in Mask are known to be either zero or one and return them in t...
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicStoreInIR(StoreInst *SI) const override
Returns how the given (atomic) store should be expanded by the IR-level AtomicExpand pass into.
SDValue PerformIntrinsicCombine(SDNode *N, DAGCombinerInfo &DCI) const
PerformIntrinsicCombine - ARM-specific DAG combining for intrinsics.
bool shouldFoldConstantShiftPairToMask(const SDNode *N) const override
Return true if it is profitable to fold a pair of shifts into a mask.
bool isDesirableToCommuteXorWithShift(const SDNode *N) const override
Return true if it is profitable to combine an XOR of a logical shift to create a logical shift of NOT...
SDValue PerformCMOVCombine(SDNode *N, SelectionDAG &DAG) const
PerformCMOVCombine - Target-specific DAG combining for ARMISD::CMOV.
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicRMWInIR(const AtomicRMWInst *AI) const override
Returns how the IR-level AtomicExpand pass should expand the given AtomicRMW, if at all.
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 isComplexDeinterleavingSupported() const override
Does this target support complex deinterleaving.
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 PerformMVEExtCombine(SDNode *N, DAGCombinerInfo &DCI) const
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo, const LibcallLoweringInfo *libcallLowering) const override
createFastISel - This method returns a target specific FastISel object, or null if the target does no...
void insertSSPDeclarations(Module &M, const LibcallLoweringInfo &Libcalls) const override
Inserts necessary declarations for SSP (stack protection) purpose.
bool SimplifyDemandedBitsForTargetNode(SDValue Op, const APInt &OriginalDemandedBits, const APInt &OriginalDemandedElts, KnownBits &Known, TargetLoweringOpt &TLO, unsigned Depth) const override
Attempt to simplify any target nodes based on the demanded bits/elts, returning true on success.
EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override
getSetCCResultType - Return the value type to use for ISD::SETCC.
MachineBasicBlock * EmitInstrWithCustomInserter(MachineInstr &MI, MachineBasicBlock *MBB) const override
This method should be implemented by targets that mark instructions with the 'usesCustomInserter' fla...
Value * emitStoreConditional(IRBuilderBase &Builder, Value *Val, Value *Addr, AtomicOrdering Ord) const override
Perform a store-conditional operation to Addr.
SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const override
This callback is invoked for operations that are unsupported by the target, which are registered to u...
CCAssignFn * CCAssignFnForReturn(CallingConv::ID CC, bool isVarArg) const
void AdjustInstrPostInstrSelection(MachineInstr &MI, SDNode *Node) const override
This method should be implemented by targets that mark instructions with the 'hasPostISelHook' flag.
bool isExtractSubvectorCheap(EVT ResVT, EVT SrcVT, unsigned Index) const override
Return true if EXTRACT_SUBVECTOR is cheap for this result type with this index.
bool isTruncateFree(Type *SrcTy, Type *DstTy) const override
Return true if it's free to truncate a value of type FromTy to type ToTy.
bool isShuffleMaskLegal(ArrayRef< int > M, EVT VT) const override
isShuffleMaskLegal - Targets can use this to indicate that they only support some VECTOR_SHUFFLE oper...
TargetLoweringBase::AtomicExpansionKind shouldExpandAtomicCmpXchgInIR(const AtomicCmpXchgInst *AI) const override
Returns how the given atomic cmpxchg should be expanded by the IR-level AtomicExpand pass.
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 shouldFormOverflowOp(unsigned Opcode, EVT VT, bool MathUsed) const override
Try to convert math with an overflow comparison into the corresponding DAG node operation.
bool lowerInterleavedStore(Instruction *Store, Value *Mask, ShuffleVectorInst *SVI, unsigned Factor, const APInt &GapMask) const override
Lower an interleaved store into a vstN intrinsic.
bool canCreateUndefOrPoisonForTargetNode(SDValue Op, const APInt &DemandedElts, const SelectionDAG &DAG, bool PoisonOnly, bool ConsiderFlags, unsigned Depth) const override
Return true if Op can create undef or poison from non-undef & non-poison operands.
bool isSelectSupported(SelectSupportKind Kind) const override
const TargetRegisterClass * getRegClassFor(MVT VT, bool isDivergent=false) const override
getRegClassFor - Return the register class that should be used for the specified value type.
bool useLoadStackGuardNode(const Module &M) const override
If this function returns true, SelectionDAGBuilder emits a LOAD_STACK_GUARD node when it is lowering ...
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 vldN intrinsic.
std::pair< const TargetRegisterClass *, uint8_t > findRepresentativeClass(const TargetRegisterInfo *TRI, MVT VT) const override
Return the largest legal super-reg register class of the register class for the specified type and it...
bool preferSelectsOverBooleanArithmetic(EVT VT) const override
Should we prefer selects to doing arithmetic on boolean types.
bool isZExtFree(SDValue Val, EVT VT2) const override
Return true if zero-extending the specific node Val to type VT2 is free (either because it's implicit...
bool isCheapToSpeculateCttz(Type *Ty) const override
Return true if it is cheap to speculate a call to intrinsic cttz.
bool shouldReassociateReduction(unsigned Opc, EVT VT) const override
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 convertSetCCLogicToBitwiseLogic(EVT VT) const override
Use bitwise logic to make pairs of compares more efficient.
bool isCheapToSpeculateCtlz(Type *Ty) const override
Return true if it is cheap to speculate a call to intrinsic ctlz.
bool targetShrinkDemandedConstant(SDValue Op, const APInt &DemandedBits, const APInt &DemandedElts, TargetLoweringOpt &TLO) const override
ARMTargetLowering(const TargetMachine &TM, const ARMSubtarget &STI)
bool isComplexDeinterleavingOperationSupported(ComplexDeinterleavingOperation Operation, Type *Ty) const override
Does this target support complex deinterleaving with the given operation and type.
bool supportKCFIBundles() const override
Return true if the target supports kcfi operand bundles.
SDValue PerformBRCONDCombine(SDNode *N, SelectionDAG &DAG) const
PerformBRCONDCombine - Target-specific DAG combining for ARMISD::BRCOND.
Register getExceptionSelectorRegister(const Constant *PersonalityFn) const override
If a physical register, this returns the register that receives the exception typeid on entry to a la...
Type * shouldConvertSplatType(ShuffleVectorInst *SVI) const override
Given a shuffle vector SVI representing a vector splat, return a new scalar type of size equal to SVI...
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.
Instruction * makeDMB(IRBuilderBase &Builder, ARM_MB::MemBOpt Domain) const
bool isLegalICmpImmediate(int64_t Imm) const override
isLegalICmpImmediate - Return true if the specified immediate is legal icmp immediate,...
const char * LowerXConstraint(EVT ConstraintVT) const override
Try to replace an X constraint, which matches anything, with another that has more specific requireme...
unsigned getJumpTableEncoding() const override
Return the entry encoding for a jump table in the current function.
bool isDesirableToTransformToIntegerOp(unsigned Opc, EVT VT) const override
Return true if it is profitable for dag combiner to transform a floating point op of specified opcode...
CCAssignFn * CCAssignFnForCall(CallingConv::ID CC, bool isVarArg) const
bool allowsMisalignedMemoryAccesses(EVT VT, unsigned AddrSpace, Align Alignment, MachineMemOperand::Flags Flags, unsigned *Fast) const override
allowsMisalignedMemoryAccesses - Returns true if the target allows unaligned memory accesses of the s...
bool isLegalInterleavedAccessType(unsigned Factor, FixedVectorType *VecTy, Align Alignment, const DataLayout &DL) const
Returns true if VecTy is a legal interleaved access type.
bool isVectorLoadExtDesirable(SDValue ExtVal) const override
Return true if folding a vector load into ExtVal (a sign, zero, or any extend node) is profitable.
bool canCombineStoreAndExtract(Type *VectorTy, Value *Idx, unsigned &Cost) const override
Return true if the target can combine store(extractelement VectorTy,Idx).
bool preferZeroCompareBranch() const override
Return true if the heuristic to prefer icmp eq zero should be used in code gen prepare.
bool canMergeStoresTo(unsigned AddressSpace, EVT MemVT, const MachineFunction &MF) const override
Returns if it's reasonable to merge stores to MemVT size.
bool useSoftFloat() const override
bool alignLoopsWithOptSize() const override
Should loops be aligned even when the function is marked OptSize (but not MinSize).
SDValue PerformCMOVToBFICombine(SDNode *N, SelectionDAG &DAG) const
bool allowTruncateForTailCall(Type *Ty1, Type *Ty2) const override
Return true if a truncation from FromTy to ToTy is permitted when deciding whether a call is in tail ...
void LowerAsmOperandForConstraint(SDValue Op, StringRef Constraint, std::vector< SDValue > &Ops, SelectionDAG &DAG) const override
LowerAsmOperandForConstraint - Lower the specified operand into the Ops vector.
bool hasAndNotCompare(SDValue V) const override
Return true if the target should transform: (X & Y) == Y ---> (~X & Y) == 0 (X & Y) !...
std::pair< unsigned, const TargetRegisterClass * > getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI, StringRef Constraint, MVT VT) const override
Given a physical register constraint (e.g.
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 from min(max(fptoi)) satur...
bool functionArgumentNeedsConsecutiveRegisters(Type *Ty, CallingConv::ID CallConv, bool isVarArg, const DataLayout &DL) const override
Returns true if an argument of type Ty needs to be passed in a contiguous block of registers in calli...
bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const override
Return true if folding a constant offset with the given GlobalAddress is legal.
bool shouldFoldMaskToVariableShiftPair(SDValue Y) const override
Return true if it is profitable to fold a pair of shifts into a mask.
const ARMBaseTargetMachine & getTM() const
bool isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const override
Return if the target supports combining a chain like:
bool hasStandaloneRem(EVT VT) const override
Return true if the target can handle a standalone remainder operation.
ShiftLegalizationStrategy preferredShiftLegalizationStrategy(SelectionDAG &DAG, SDNode *N, unsigned ExpansionFactor) const override
bool getPostIndexedAddressParts(SDNode *N, SDNode *Op, SDValue &Base, SDValue &Offset, ISD::MemIndexedMode &AM, SelectionDAG &DAG) const override
getPostIndexedAddressParts - returns true by value, base pointer and offset pointer and addressing mo...
Instruction * emitLeadingFence(IRBuilderBase &Builder, Instruction *Inst, AtomicOrdering Ord) const override
Inserts in the IR a target-specific intrinsic specifying a fence.
ArrayRef - 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.
CCValAssign - Represent assignment of one arg/retval to a location.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
This class represents a function call, abstracting a target machine's calling convention.
This is an important base class in LLVM.
Definition Constant.h:43
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:66
Class to represent fixed width SIMD vectors.
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:270
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:729
Common base class shared among various IRBuilders.
Definition IRBuilder.h:114
Itinerary data supplied by a subtarget to be used by a target.
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:68
Tracks which library functions to use for a particular subtarget.
An instruction for reading from memory.
Machine Value Type.
Instructions::iterator instr_iterator
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.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
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...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
An instruction for storing to memory.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
constexpr size_t size() const
size - Get the string size.
Definition StringRef.h:146
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...
SelectSupportKind
Enum that describes what type of support for selects the target has.
Sched::Preference getSchedulingPreference() const
Return target scheduling preference.
virtual bool shouldConsiderGEPOffsetSplit() const
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 ArrayRef< MCPhysReg > getRoundingControlRegisters() const
Returns a 0 terminated array of rounding control registers that can be attached into strict FP call.
Primary interface to the complete machine description for the target machine.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:45
LLVM Value Representation.
Definition Value.h:75
Base class of all SIMD vector types.
Define some predicates that are used for node matching.
Definition ARMEHABI.h:25
bool isBitFieldInvertedMask(unsigned v)
const unsigned FPStatusBits
FastISel * createFastISel(FunctionLoweringInfo &funcInfo, const TargetLibraryInfo *libInfo, const LibcallLoweringInfo *libcallLowering)
const unsigned FPReservedBits
Rounding
Possible values of current rounding mode, which is specified in bits 23:22 of FPSCR.
const unsigned RoundingBitsPos
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
@ Fast
Attempts to make calls as fast as possible (e.g.
Definition CallingConv.h:41
@ VECREDUCE_ADD
Integer reductions may have a result type larger than the vector element type.
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,...
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.
Definition Types.h:26
@ Offset
Definition DWP.cpp:532
InstructionCost Cost
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.
AtomicOrdering
Atomic ordering for LLVM's memory model.
CombineLevel
Definition DAGCombine.h:15
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
#define N
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39
Extended Value Type.
Definition ValueTypes.h:35
TypeSize getSizeInBits() const
Return the size of the specified value type in bits.
Definition ValueTypes.h:373
uint64_t getScalarSizeInBits() const
Definition ValueTypes.h:385
bool isVector() const
Return true if this is a vector value type.
Definition ValueTypes.h:168
bool isScalarInteger() const
Return true if this is an integer, but not a vector.
Definition ValueTypes.h:157
This structure contains all information that is necessary for lowering calls.