LLVM 24.0.0git
HexagonISelLoweringHLX.cpp
Go to the documentation of this file.
1//===-- HexagonISelLoweringHLX.cpp --- Lowering HLX operations ------------===//
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
10#include "HexagonRegisterInfo.h"
11#include "HexagonSubtarget.h"
15#include "llvm/IR/IntrinsicsHexagon.h"
16
17using namespace llvm;
18
19// 2048B HLX types
20static const MVT AllTypes2048B[] = {MVT::v2048i8, MVT::v1024i16, MVT::v512i32,
21 MVT::v4096i8, MVT::v2048i16, MVT::v1024i32};
22static const MVT LegalTypes2048B[] = {MVT::v1024i16, MVT::v2048i16,
23 MVT::v1024i32};
24static const MVT LegalPredTypes2048B[] = {MVT::v1024i1, MVT::v2048i1};
25
26void HexagonTargetLowering::initializeHLXLowering() {
28 ArrayRef<MVT> LegalTypes = LegalTypes2048B;
29 ArrayRef<MVT> LegalPredTypes = LegalPredTypes2048B;
30 MVT HalfWordPairTy = MVT::v2048i16;
31
32 // TODO: Remove i32 types for single HLX register
33 // ISA only supports halfword, byte operations on single register
34 addRegisterClass(MVT::v2048i8, &Hexagon::HlxLRRegClass);
35 addRegisterClass(MVT::v1024i16, &Hexagon::HlxLRRegClass);
36 addRegisterClass(MVT::v512i32, &Hexagon::HlxLRRegClass);
37 addRegisterClass(MVT::v1024i1, &Hexagon::HlxLRRegClass);
38 addRegisterClass(MVT::v4096i8, &Hexagon::HlxLLRRegClass);
39 addRegisterClass(MVT::v2048i16, &Hexagon::HlxLLRRegClass);
40 addRegisterClass(MVT::v1024i32, &Hexagon::HlxLLRRegClass);
41 addRegisterClass(MVT::v2048i1, &Hexagon::HlxLLRRegClass);
42
43 // Route element-sensitive operations unsupported by a type to
44 // LowerHlxOperation.
45 static const unsigned UnsupportedOnByteAndSingleWord[] = {
52 SmallVector<MVT, 8> UnsupportedTypes;
53 for (MVT T : AllTypes)
54 if (!llvm::is_contained(LegalTypes, T))
55 UnsupportedTypes.push_back(T);
56 setOperationAction(UnsupportedOnByteAndSingleWord, UnsupportedTypes, Custom);
57
58 // Catch VSELECT before type legalization widens an unsupported predicate.
59 for (MVT T : UnsupportedTypes) {
60 MVT PredTy = MVT::getVectorVT(MVT::i1, T.getVectorNumElements());
61 if (!llvm::is_contained(LegalPredTypes, PredTy))
63 }
64
65 // Reject unsupported halfword-pair operations in LowerHlxOperation.
66 for (unsigned Opc : {ISD::MUL, ISD::ABDS, ISD::ABDU, ISD::AVGFLOORS,
68 setOperationAction(Opc, HalfWordPairTy, Custom);
69
70 for (MVT T : UnsupportedTypes) {
81 }
82
83 for (MVT T : LegalTypes) {
90 }
91
92 setOperationAction(ISD::MUL, MVT::v1024i16, Legal);
93 setOperationAction(ISD::MUL, MVT::v1024i32, Legal);
94
95 setOperationAction(ISD::MULHU, MVT::v1024i16, Legal);
96 setOperationAction(ISD::MULHS, MVT::v1024i16, Legal);
97
98 for (MVT T : AllTypes) {
102 }
103
104 setOperationAction(ISD::SRA, MVT::v1024i16, Legal);
105 setOperationAction(ISD::SRA, MVT::v1024i32, Legal);
106 setOperationAction(ISD::SRL, MVT::v1024i16, Legal);
107 setOperationAction(ISD::SRL, MVT::v1024i32, Legal);
108 setOperationAction(ISD::SHL, MVT::v1024i16, Legal);
109 setOperationAction(ISD::SHL, MVT::v1024i32, Legal);
110
111 for (MVT T : LegalTypes) {
112 // GT comparisons are legal
115 // Expand all non-GT comparisons
122 // Expand equality comparisons
125 }
126
127 // Add SETCC operation for predicate result types
128 for (MVT T : LegalPredTypes)
130
131 for (MVT T : LegalTypes) {
137 }
138
139 // absdiff and average lack halfword-pair instructions.
140 MVT HalfWordSingleTy = MVT::v1024i16;
141 MVT WordPairTy = MVT::v1024i32;
142 for (MVT T : {HalfWordSingleTy, WordPairTy}) {
149 }
150
151 setOperationAction(ISD::SELECT, MVT::v1024i16, Custom);
152 setOperationAction(ISD::SELECT, MVT::v1024i32, Custom);
153
154 // Splat supports halfword singles and word pairs only.
155 for (MVT T : LegalTypes)
157
158 setOperationAction(ISD::LOAD, MVT::v2048i8, Legal);
159 setOperationAction(ISD::LOAD, MVT::v1024i16, Legal);
160 setOperationAction(ISD::LOAD, MVT::v512i32, Legal);
161 setOperationAction(ISD::STORE, MVT::v2048i8, Legal);
162 setOperationAction(ISD::STORE, MVT::v1024i16, Legal);
163 setOperationAction(ISD::STORE, MVT::v512i32, Legal);
164
165 setOperationAction(ISD::MLOAD, MVT::v1024i16, Custom);
166 setOperationAction(ISD::MSTORE, MVT::v1024i16, Custom);
167
171
172 setOperationAction(ISD::TRUNCATE, MVT::v1024i16, Legal);
173 setOperationAction(ISD::TRUNCATE, MVT::v2048i8, Legal);
174}
175
176bool HexagonTargetLowering::isHlxSingleTy(MVT Ty) const {
177 return Subtarget.isHLXVectorType(Ty) &&
178 Ty.getSizeInBits() == 8 * Subtarget.getHLXVectorLength();
179}
180
181bool HexagonTargetLowering::isHlxPairTy(MVT Ty) const {
182 return Subtarget.isHLXVectorType(Ty) &&
183 Ty.getSizeInBits() == 16 * Subtarget.getHLXVectorLength();
184}
185
186bool HexagonTargetLowering::isHlxOperation(SDNode *N, SelectionDAG &DAG) const {
187 if (!Subtarget.useHLXOps())
188 return false;
189 // If the type of any result, or any operand type are HLX vector types,
190 // this is an HLX operation.
191 auto IsHLXTy = [this](EVT Ty) {
192 return Ty.isSimple() && Subtarget.isHLXVectorType(Ty.getSimpleVT());
193 };
194 auto IsHLXOp = [this](SDValue Op) {
195 return Op.getValueType().isSimple() && Subtarget.isHLXVectorType(ty(Op));
196 };
197 if (llvm::any_of(N->values(), IsHLXTy) || llvm::any_of(N->ops(), IsHLXOp))
198 return true;
199
200 // No widening for now
201 return false;
202}
203
204bool HexagonTargetLowering::allowsHlxMemoryAccess(
205 MVT VecTy, MachineMemOperand::Flags Flags, unsigned *Fast) const {
206 // Disallow double vector stores (to prevent unnecessary
207 // store widening in DAG combiner).
208 if (VecTy.getSizeInBits() > 8 * Subtarget.getHLXVectorLength())
209 return false;
210 if (!Subtarget.isHLXVectorType(VecTy))
211 return false;
212 if (Fast)
213 *Fast = 1;
214 return true;
215}
216
217HexagonTargetLowering::TypePair
218HexagonTargetLowering::typeHlxSplit(MVT VecTy) const {
219 assert(VecTy.isVector());
220 unsigned NumElem = VecTy.getVectorNumElements();
221 assert((NumElem % 2) == 0 && "Expecting even-sized vector type");
222 MVT ElemTy = VecTy.getVectorElementType();
223 MVT HalfTy;
224 if (ElemTy == MVT::i32)
225 HalfTy = VecTy.changeVectorElementType(MVT::i16);
226 else
227 HalfTy = MVT::getVectorVT(VecTy.getVectorElementType(), NumElem / 2);
228 return {HalfTy, HalfTy};
229}
230
231// Reload a stack-passed HLX pair argument: two contiguous sub-vector loads
232// recombined with COMBINELL. Calling-convention use only; user pair loads
233// through a pointer are unsupported (QTOOL-134974).
234SDValue HexagonTargetLowering::splitHlxPairArgLoad(
235 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue BaseAddr,
236 MVT PairTy, MachinePointerInfo PtrInfo) const {
237 unsigned HlxVLen = Subtarget.getHLXVectorLength();
238 MVT SingleTy = PairTy.changeVectorElementType(MVT::i16);
239 SDValue Base1 =
240 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
242 Align HalfAlign = DAG.getEVTAlign(SingleTy);
243 MachineMemOperand *MOp0 = MF.getMachineMemOperand(
244 PtrInfo, MachineMemOperand::MOLoad, HlxVLen, HalfAlign);
245 MachineMemOperand *MOp1 =
246 MF.getMachineMemOperand(PtrInfo.getWithOffset(HlxVLen),
247 MachineMemOperand::MOLoad, HlxVLen, HalfAlign);
248 SDValue Load0 = DAG.getLoad(SingleTy, dl, Chain, BaseAddr, MOp0);
249 SDValue Load1 = DAG.getLoad(SingleTy, dl, Chain, Base1, MOp1);
250 return DAG.getNode(HexagonISD::COMBINELL, dl, PairTy, Load1, Load0);
251}
252
253// Spill a stack-passed HLX pair argument: extract vsub_lo/vsub_hi and store
254// them to contiguous slots, appending both chains to MemOpChains.
255// Calling-convention use only (QTOOL-134974).
256void HexagonTargetLowering::splitHlxPairArgStore(
257 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue StoreVal,
258 SDValue BaseAddr, MVT PairTy, MachinePointerInfo PtrInfo,
259 SmallVectorImpl<SDValue> &MemOpChains) const {
260 unsigned HlxVLen = Subtarget.getHLXVectorLength();
261 MVT SingleTy = PairTy.changeVectorElementType(MVT::i16);
262 SDValue Base1 =
263 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
264 SDValue Lo =
265 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, StoreVal);
266 SDValue Hi =
267 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, StoreVal);
268 MemOpChains.push_back(DAG.getStore(Chain, dl, Lo, BaseAddr, PtrInfo));
269 MemOpChains.push_back(
270 DAG.getStore(Chain, dl, Hi, Base1, PtrInfo.getWithOffset(HlxVLen)));
271}
272
273// Shared helper for splitting pair memory intrinsics into two single-vector
274// operations. Used by LowerHlxPairIntrinsic for the LX_LL16b_tmp /
275// LX_SS16b_new pair load/store intrinsics.
277 const HexagonSubtarget &ST,
278 SDValue BaseAddr,
279 SDValue StoreVal = SDValue()) {
280 auto *MemN = cast<MemSDNode>(Op.getNode());
281 MVT PairTy = MemN->getMemoryVT().getSimpleVT();
282 unsigned HlxVLen = ST.getHLXVectorLength();
283 assert(PairTy.getSizeInBits() == 16 * HlxVLen &&
284 PairTy.getVectorElementType() == MVT::i32 &&
285 "Expected HLX vector pair type");
286 MVT SingleTy = PairTy.changeVectorElementType(MVT::i16);
287 SDValue Chain = MemN->getChain();
288 const SDLoc &dl(Op);
289 SDValue Base1 =
290 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
291
292 MachineMemOperand *MOp0 = nullptr, *MOp1 = nullptr;
293 if (MachineMemOperand *MMO = MemN->getMemOperand()) {
295 MOp0 = MF.getMachineMemOperand(MMO, 0, HlxVLen);
296 MOp1 = MF.getMachineMemOperand(MMO, HlxVLen, HlxVLen);
297 }
298
299 if (StoreVal) {
300 // Store: split value into two halves, emit two stores, combine chains.
301 SDValue Lo =
302 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, StoreVal);
303 SDValue Hi =
304 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, StoreVal);
305 SDValue Store0 = DAG.getStore(Chain, dl, Lo, BaseAddr, MOp0);
306 SDValue Store1 = DAG.getStore(Chain, dl, Hi, Base1, MOp1);
307 return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Store0, Store1);
308 }
309
310 // Load: emit two single-vector loads, combine with COMBINELL.
311 SDValue Load0 = DAG.getLoad(SingleTy, dl, Chain, BaseAddr, MOp0);
312 SDValue Load1 = DAG.getLoad(SingleTy, dl, Chain, Base1, MOp1);
313 return DAG.getMergeValues(
314 {DAG.getNode(HexagonISD::COMBINELL, dl, PairTy, Load1, Load0),
315 DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Load0.getValue(1),
316 Load1.getValue(1))},
317 dl);
318}
319
320// Lower pair load/store intrinsics (LX_LL16b_tmp, LX_SS16b_new) by
321// splitting into two single-vector operations via SplitHlxPairMemHelper.
322SDValue HexagonTargetLowering::LowerHlxPairIntrinsic(SDValue Op,
323 SelectionDAG &DAG) const {
324 unsigned IntNo = Op.getConstantOperandVal(1);
325 switch (IntNo) {
326 case Intrinsic::hexagon_LX_LL16b_tmp:
327 return SplitHlxPairMemHelper(Op, DAG, Subtarget, Op.getOperand(2));
328 case Intrinsic::hexagon_LX_SS16b_new:
329 return SplitHlxPairMemHelper(Op, DAG, Subtarget, Op.getOperand(2),
330 Op.getOperand(3));
331 default:
332 return Op;
333 }
334}
335
336// Lower masked load/store operations to HLX instructions.
337//
338// HLX does not have native masked load/store instructions. Instead, we
339// lower them to a sequence of regular load/store + VSELECT operations:
340//
341// MLOAD(base, mask, passthru) => VSELECT(mask, LOAD(base), passthru)
342// MSTORE(base, value, mask) => STORE(base, VSELECT(mask, value,
343// LOAD(base)))
344//
345// For MLOAD: Load the full vector, then use VSELECT to choose between
346// loaded values (where mask is true) and passthru values (where mask is
347// false).
348//
349// For MSTORE: Load the existing memory contents, use VSELECT to merge the
350// new value (where mask is true) with old contents (where mask is false),
351// then store the result. This preserves unmasked lanes.
352SDValue HexagonTargetLowering::LowerHlxMaskedOp(SDValue Op,
353 SelectionDAG &DAG) const {
354 auto *MaskN = cast<MaskedLoadStoreSDNode>(Op.getNode());
355 unsigned HwLen = Subtarget.getHLXVectorLength();
356
357 // HLX has no native masked load/store. We emulate them with a full-width
358 // load (and, for stores, a load-modify-store), which reads/writes the
359 // inactive lanes. That is only sound for ordinary memory accesses: a
360 // volatile or atomic access must not touch inactive lanes, so bail out
361 // rather than silently change the program's memory semantics.
362 if (MaskN->isVolatile() || !MaskN->getMemOperand()->isUnordered()) {
363 DAG.getContext()->emitError(
364 "Volatile or atomic masked load/store of HLX vector type is not "
365 "supported");
366 return SDValue();
367 }
368
369 if (MaskN->getAlign().value() % HwLen != 0) {
370 DAG.getContext()->emitError(
371 "Masked load/store of HLX vector type, requires alignment of " +
372 Twine(HwLen) + " bytes for lowering to HLX");
373 return SDValue();
374 }
375
376 const SDLoc &dl(Op);
378 SDValue Mask = MaskN->getMask();
379 SDValue Chain = MaskN->getChain();
380 SDValue Base = MaskN->getBasePtr();
381 MachineMemOperand *MemOp =
382 MaskN->getMemOperand()
383 ? MF.getMachineMemOperand(MaskN->getMemOperand(), 0, HwLen)
384 : nullptr;
385
386 unsigned Opc = Op->getOpcode();
387
388 switch (Opc) {
389 case ISD::MLOAD: {
390 MVT ValTy = ty(Op);
391 SDValue Load = DAG.getLoad(ValTy, dl, Chain, Base, MemOp);
392 SDValue Thru = cast<MaskedLoadSDNode>(MaskN)->getPassThru();
393 if (isUndef(Thru))
394 return Load;
395 SDValue VSel = DAG.getNode(ISD::VSELECT, dl, ValTy, Mask, Load, Thru);
396 return DAG.getMergeValues({VSel, Load.getValue(1)}, dl);
397 }
398 case ISD::MSTORE: {
399 SDValue Value = cast<MaskedStoreSDNode>(MaskN)->getValue();
400 auto PtrInfo = (MemOp && MemOp->getValue())
401 ? MachinePointerInfo(MemOp->getValue())
402 : MachinePointerInfo();
403 SDValue Load =
404 DAG.getLoad(Value.getSimpleValueType(), dl, Chain, Base, PtrInfo,
406 SDValue VSel = DAG.getNode(ISD::VSELECT, dl, Value.getSimpleValueType(),
407 Mask, Value, Load);
408 SDValue Store = DAG.getStore(Load.getValue(1), dl, VSel, Base, MemOp);
409 return Store;
410 }
411 default: {
412 [[maybe_unused]] std::string Name =
413 "Unexpected masked operation: " + Op->getOperationName(&DAG);
414 llvm_unreachable(Name.c_str());
415 }
416 }
417}
418
419// Lowers ternary operations of the following types:
420// HLX_Vector = (int)? HLX_Vector: HLX_Vector
421// HLX_VectorPair = (int)? HLX_VectorPair: HLX_VectorPair
422SDValue HexagonTargetLowering::LowerHlxSelect(SDValue Op,
423 SelectionDAG &DAG) const {
424 SDValue CondVec = Op.getOperand(0); // i1
425 SDValue True = Op.getOperand(1);
426 SDValue False = Op.getOperand(2);
427
428 const SDLoc &dl(Op);
429 MVT ValTy = ty(Op);
430
431 // Always splat condition into single-vector v1024i16 (HlxLR), not pair.
432 // LX_mux_h only needs a single HlxLR condition register, and for pairs
433 // the scalar i1 condition is uniform so the same register is reused for
434 // both halves.
435 MVT CondTy = MVT::getVectorVT(MVT::i16, ValTy.getVectorNumElements());
436 if (ty(CondVec) == MVT::i1) {
437 SDValue Ext = DAG.getNode(ISD::SIGN_EXTEND, dl, MVT::i16, CondVec);
438 CondVec = DAG.getNode(ISD::SPLAT_VECTOR, dl, CondTy, Ext);
439 }
440
441 if (!isHlxPairTy(ValTy))
442 return DAG.getNode(ISD::VSELECT, dl, ValTy, CondVec, True, False);
443
444 TypePair HalfTys = typeHlxSplit(ValTy);
445 MVT SingleTy = HalfTys.first; // v1024i16
446
447 SDValue TrueLo =
448 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, True);
449 SDValue TrueHi =
450 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, True);
451 SDValue FalseLo =
452 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, False);
453 SDValue FalseHi =
454 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, False);
455
456 SDValue LoSelect =
457 DAG.getNode(ISD::VSELECT, dl, SingleTy, CondVec, TrueLo, FalseLo);
458 SDValue HiSelect =
459 DAG.getNode(ISD::VSELECT, dl, SingleTy, CondVec, TrueHi, FalseHi);
460
461 return DAG.getNode(HexagonISD::COMBINELL, dl, ValTy, HiSelect, LoSelect);
462}
463
464SDValue HexagonTargetLowering::LowerHlxOperation(SDValue Op,
465 SelectionDAG &DAG) const {
466 unsigned Opc = Op.getOpcode();
467 switch (Opc) {
468 default:
469 break;
472 return LowerHlxPairIntrinsic(Op, DAG);
474 return Op;
475 case ISD::MLOAD:
476 case ISD::MSTORE:
477 return LowerHlxMaskedOp(Op, DAG);
478 case ISD::SELECT:
479 return LowerHlxSelect(Op, DAG);
480 case ISD::ADD:
481 case ISD::SUB:
482 case ISD::UADDSAT:
483 case ISD::SADDSAT:
484 case ISD::USUBSAT:
485 case ISD::SSUBSAT:
486 case ISD::MUL:
487 case ISD::SHL:
488 case ISD::SRL:
489 case ISD::SRA:
490 case ISD::SMIN:
491 case ISD::SMAX:
492 case ISD::UMIN:
493 case ISD::UMAX:
494 case ISD::ABS:
495 case ISD::ABDS:
496 case ISD::ABDU:
497 case ISD::AVGFLOORS:
498 case ISD::AVGFLOORU:
499 case ISD::AVGCEILS:
500 case ISD::AVGCEILU:
502 case ISD::VSELECT:
503 case ISD::SETCC: {
504 MVT VT = Opc == ISD::SETCC ? ty(Op.getOperand(0)) : ty(Op);
505 DAG.getContext()->emitError(
506 "HLX does not support '" + Op->getOperationName(&DAG) +
507 "' on vector type " + EVT(VT).getEVTString() +
508 "; use an element type and vector length supported by the HLX ISA");
509 return DAG.getUNDEF(ty(Op));
510 }
511 }
512#ifndef NDEBUG
513 Op.dumpr(&DAG);
514#endif
515 llvm_unreachable("Unhandled HLX operation");
516}
auto * MemN
return SDValue()
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const MVT LegalPredTypes2048B[]
static const MVT LegalTypes2048B[]
static SDValue SplitHlxPairMemHelper(SDValue Op, SelectionDAG &DAG, const HexagonSubtarget &ST, SDValue BaseAddr, SDValue StoreVal=SDValue())
static const MVT AllTypes2048B[]
std::pair< MCSymbol *, MachineModuleInfoImpl::StubValueTy > PairTy
#define T
MachineInstr *& Lo
This file defines the SmallVector class.
LLVM_ABI void emitError(const Instruction *I, const Twine &ErrorStr)
emitError - Emit an error message to the currently installed error handler with optional location inf...
Machine Value Type.
MVT changeVectorElementType(MVT EltVT) const
Return a VT for a vector type whose attributes match ourselves with the exception of the element type...
unsigned getVectorNumElements() const
bool isVector() const
Return true if this is a vector value type.
TypeSize getSizeInBits() const
Returns the size of the specified MVT in bits.
static MVT getVectorVT(MVT VT, unsigned NumElements)
MVT getVectorElementType() const
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, MachineMemOperand::Flags F, LLT MemTy, Align BaseAlignment, const MMOMetadata &Metadata=MMOMetadata(), SyncScope::ID SSID=SyncScope::System, AtomicOrdering Ordering=AtomicOrdering::NotAtomic, AtomicOrdering FailureOrdering=AtomicOrdering::NotAtomic)
getMachineMemOperand - Allocate a new MachineMemOperand.
A description of a memory reference used in the backend.
Flags
Flags values. These may be or'd together.
@ MOLoad
The memory access reads data.
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.
SDValue getValue(unsigned R) const
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
LLVM_ABI SDValue getMergeValues(ArrayRef< SDValue > Ops, const SDLoc &dl)
Create a MERGE_VALUES node from the given operands.
LLVM_ABI Align getEVTAlign(EVT MemoryVT) const
Compute the default alignment value for the given type.
SDValue getUNDEF(EVT VT)
Return an UNDEF node. UNDEF does not have a useful SDLoc.
LLVM_ABI SDValue getStore(SDValue Chain, const SDLoc &dl, SDValue Val, SDValue Ptr, MachinePointerInfo PtrInfo, Align Alignment, MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const MMOMetadata &Metadata=MMOMetadata())
Helper function to build ISD::STORE nodes.
LLVM_ABI SDValue getMemBasePlusOffset(SDValue Base, TypeSize Offset, const SDLoc &DL, const SDNodeFlags Flags=SDNodeFlags())
Returns sum of the base pointer and offset.
LLVM_ABI SDValue getTargetExtractSubreg(int SRIdx, const SDLoc &DL, EVT VT, SDValue Operand)
A convenience function for creating TargetInstrInfo::EXTRACT_SUBREG nodes.
LLVM_ABI SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr, MachinePointerInfo PtrInfo, MaybeAlign Alignment=MaybeAlign(), MachineMemOperand::Flags MMOFlags=MachineMemOperand::MONone, const MMOMetadata &Metadata=MMOMetadata())
Loads are not normal binary operators: their result type is not determined by their operands,...
LLVM_ABI SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
MachineFunction & getMachineFunction() const
LLVMContext * getContext() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
void setOperationAction(unsigned Op, MVT VT, LegalizeAction Action)
Indicate that the specified operation does not work with the specified type and indicate what to do a...
void addRegisterClass(MVT VT, const TargetRegisterClass *RC)
Add the specified register class as an available regclass for the specified value type.
void setCondCodeAction(ArrayRef< ISD::CondCode > CCs, MVT VT, LegalizeAction Action)
Indicate that the specified condition code is or isn't supported on the target and indicate what to d...
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition TypeSize.h:352
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
@ SETCC
SetCC operator - This evaluates to a true value iff the condition is true.
Definition ISDOpcodes.h:851
@ MLOAD
Masked load and store - consecutive vector load and store operations with additional mask operand tha...
@ ADD
Simple integer binary arithmetic operators.
Definition ISDOpcodes.h:266
@ LOAD
LOAD and STORE have token chains as their first operand, then the same operands as an LLVM load/store...
@ INTRINSIC_VOID
OUTCHAIN = INTRINSIC_VOID(INCHAIN, INTRINSICID, arg1, arg2, ...) This node represents a target intrin...
Definition ISDOpcodes.h:222
@ ABS
ABS - Determine the unsigned absolute value of a signed integer value of the same bitwidth.
Definition ISDOpcodes.h:771
@ SIGN_EXTEND
Conversion operators.
Definition ISDOpcodes.h:876
@ AVGCEILS
AVGCEILS/AVGCEILU - Rounding averaging add - Add two integers using an integer of type i[N+2],...
Definition ISDOpcodes.h:731
@ SSUBSAT
RESULT = [US]SUBSAT(LHS, RHS) - Perform saturation subtraction on 2 integers with the same bit width ...
Definition ISDOpcodes.h:377
@ SELECT
Select(COND, TRUEVAL, FALSEVAL).
Definition ISDOpcodes.h:828
@ SPLAT_VECTOR
SPLAT_VECTOR(VAL) - Returns a vector with the scalar value VAL duplicated in all lanes.
Definition ISDOpcodes.h:688
@ MULHU
MULHU/MULHS - Multiply high - Multiply two integers of type iN, producing an unsigned/signed value of...
Definition ISDOpcodes.h:720
@ SHL
Shift and rotation operations.
Definition ISDOpcodes.h:793
@ ZERO_EXTEND
ZERO_EXTEND - Used for integer types, zeroing the new bits.
Definition ISDOpcodes.h:882
@ SMIN
[US]{MIN/MAX} - Binary minimum or maximum of signed or unsigned integers.
Definition ISDOpcodes.h:751
@ VSELECT
Select with a vector condition (op #0) and two vector operands (ops #1 and #2), returning a vector re...
Definition ISDOpcodes.h:837
@ AND
Bitwise operators - logical and, logical or, logical xor.
Definition ISDOpcodes.h:763
@ INTRINSIC_WO_CHAIN
RESULT = INTRINSIC_WO_CHAIN(INTRINSICID, arg1, arg2, ...) This node represents a target intrinsic fun...
Definition ISDOpcodes.h:207
@ AVGFLOORS
AVGFLOORS/AVGFLOORU - Averaging add - Add two integers using an integer of type i[N+1],...
Definition ISDOpcodes.h:726
@ TokenFactor
TokenFactor - This node takes multiple tokens as input and produces a single token result.
Definition ISDOpcodes.h:55
@ TRUNCATE
TRUNCATE - Completely drop the high bits.
Definition ISDOpcodes.h:888
@ SADDSAT
RESULT = [US]ADDSAT(LHS, RHS) - Perform saturation addition on 2 integers with the same bit width (W)...
Definition ISDOpcodes.h:368
@ ABDS
ABDS/ABDU - Absolute difference - Return the absolute difference between two numbers interpreted as s...
Definition ISDOpcodes.h:746
@ INTRINSIC_W_CHAIN
RESULT,OUTCHAIN = INTRINSIC_W_CHAIN(INCHAIN, INTRINSICID, arg1, ...) This node represents a target in...
Definition ISDOpcodes.h:215
This is an optimization pass for GlobalISel generic memory operations.
@ Load
The value being inserted comes from a load (InsertElement only).
@ Store
The extracted value is stored (ExtractElement only).
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1762
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
@ Fast
Assign the register banks as fast as possible (default).
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1963
#define N
This class contains a discriminated union of information about pointers in memory operands,...
MachinePointerInfo getWithOffset(int64_t O) const