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"
14#include "llvm/IR/IntrinsicsHexagon.h"
15
16using namespace llvm;
17
18// 2048B HLX types
19static const MVT AllTypes2048B[] = {MVT::v2048i8, MVT::v1024i16, MVT::v512i32,
20 MVT::v4096i8, MVT::v2048i16, MVT::v1024i32};
21static const MVT LegalTypes2048B[] = {MVT::v1024i16, MVT::v2048i16,
22 MVT::v1024i32};
23static const MVT LegalPredTypes2048B[] = {MVT::v1024i1, MVT::v2048i1};
24
25void HexagonTargetLowering::initializeHLXLowering() {
27 ArrayRef<MVT> LegalTypes = LegalTypes2048B;
28 ArrayRef<MVT> LegalPredTypes = LegalPredTypes2048B;
29 MVT HalfWordPairTy = MVT::v2048i16;
30
31 // TODO: Remove i32 types for single HLX register
32 // ISA only supports halfword, byte operations on single register
33 addRegisterClass(MVT::v2048i8, &Hexagon::HlxLRRegClass);
34 addRegisterClass(MVT::v1024i16, &Hexagon::HlxLRRegClass);
35 addRegisterClass(MVT::v512i32, &Hexagon::HlxLRRegClass);
36 addRegisterClass(MVT::v1024i1, &Hexagon::HlxLRRegClass);
37 addRegisterClass(MVT::v4096i8, &Hexagon::HlxLLRRegClass);
38 addRegisterClass(MVT::v2048i16, &Hexagon::HlxLLRRegClass);
39 addRegisterClass(MVT::v1024i32, &Hexagon::HlxLLRRegClass);
40 addRegisterClass(MVT::v2048i1, &Hexagon::HlxLLRRegClass);
41
42 // Route element-sensitive operations unsupported by a type to
43 // LowerHlxOperation.
44 static const unsigned UnsupportedOnByteAndSingleWord[] = {
51 SmallVector<MVT, 8> UnsupportedTypes;
52 for (MVT T : AllTypes)
53 if (!llvm::is_contained(LegalTypes, T))
54 UnsupportedTypes.push_back(T);
55 setOperationAction(UnsupportedOnByteAndSingleWord, UnsupportedTypes, Custom);
56
57 // Catch VSELECT before type legalization widens an unsupported predicate.
58 for (MVT T : UnsupportedTypes) {
59 MVT PredTy = MVT::getVectorVT(MVT::i1, T.getVectorNumElements());
60 if (!llvm::is_contained(LegalPredTypes, PredTy))
62 }
63
64 // Reject unsupported halfword-pair operations in LowerHlxOperation.
65 for (unsigned Opc : {ISD::MUL, ISD::ABDS, ISD::ABDU, ISD::AVGFLOORS,
67 setOperationAction(Opc, HalfWordPairTy, Custom);
68
69 for (MVT T : UnsupportedTypes) {
80 }
81
82 for (MVT T : LegalTypes) {
89 }
90
91 setOperationAction(ISD::MUL, MVT::v1024i16, Legal);
92 setOperationAction(ISD::MUL, MVT::v1024i32, Legal);
93
94 setOperationAction(ISD::MULHU, MVT::v1024i16, Legal);
95 setOperationAction(ISD::MULHS, MVT::v1024i16, Legal);
96
97 for (MVT T : AllTypes) {
101 }
102
103 setOperationAction(ISD::SRA, MVT::v1024i16, Legal);
104 setOperationAction(ISD::SRA, MVT::v1024i32, Legal);
105 setOperationAction(ISD::SRL, MVT::v1024i16, Legal);
106 setOperationAction(ISD::SRL, MVT::v1024i32, Legal);
107 setOperationAction(ISD::SHL, MVT::v1024i16, Legal);
108 setOperationAction(ISD::SHL, MVT::v1024i32, Legal);
109
110 for (MVT T : LegalTypes) {
111 // GT comparisons are legal
114 // Expand all non-GT comparisons
121 // Expand equality comparisons
124 }
125
126 // Add SETCC operation for predicate result types
127 for (MVT T : LegalPredTypes)
129
130 for (MVT T : LegalTypes) {
136 }
137
138 // absdiff and average lack halfword-pair instructions.
139 MVT HalfWordSingleTy = MVT::v1024i16;
140 MVT WordPairTy = MVT::v1024i32;
141 for (MVT T : {HalfWordSingleTy, WordPairTy}) {
148 }
149
150 setOperationAction(ISD::SELECT, MVT::v1024i16, Custom);
151 setOperationAction(ISD::SELECT, MVT::v1024i32, Custom);
152
153 // Splat supports halfword singles and word pairs only.
154 for (MVT T : LegalTypes)
156
157 setOperationAction(ISD::LOAD, MVT::v2048i8, Legal);
158 setOperationAction(ISD::LOAD, MVT::v1024i16, Legal);
159 setOperationAction(ISD::LOAD, MVT::v512i32, Legal);
160 setOperationAction(ISD::STORE, MVT::v2048i8, Legal);
161 setOperationAction(ISD::STORE, MVT::v1024i16, Legal);
162 setOperationAction(ISD::STORE, MVT::v512i32, Legal);
163
164 setOperationAction(ISD::MLOAD, MVT::v1024i16, Custom);
165 setOperationAction(ISD::MSTORE, MVT::v1024i16, Custom);
166
170
171 setOperationAction(ISD::TRUNCATE, MVT::v1024i16, Legal);
172 setOperationAction(ISD::TRUNCATE, MVT::v2048i8, Legal);
173}
174
175bool HexagonTargetLowering::isHlxSingleTy(MVT Ty) const {
176 return Subtarget.isHLXVectorType(Ty) &&
177 Ty.getSizeInBits() == 8 * Subtarget.getHLXVectorLength();
178}
179
180bool HexagonTargetLowering::isHlxPairTy(MVT Ty) const {
181 return Subtarget.isHLXVectorType(Ty) &&
182 Ty.getSizeInBits() == 16 * Subtarget.getHLXVectorLength();
183}
184
185bool HexagonTargetLowering::isHlxOperation(SDNode *N, SelectionDAG &DAG) const {
186 if (!Subtarget.useHLXOps())
187 return false;
188 // If the type of any result, or any operand type are HLX vector types,
189 // this is an HLX operation.
190 auto IsHLXTy = [this](EVT Ty) {
191 return Ty.isSimple() && Subtarget.isHLXVectorType(Ty.getSimpleVT());
192 };
193 auto IsHLXOp = [this](SDValue Op) {
194 return Op.getValueType().isSimple() && Subtarget.isHLXVectorType(ty(Op));
195 };
196 if (llvm::any_of(N->values(), IsHLXTy) || llvm::any_of(N->ops(), IsHLXOp))
197 return true;
198
199 // No widening for now
200 return false;
201}
202
203bool HexagonTargetLowering::allowsHlxMemoryAccess(
204 MVT VecTy, MachineMemOperand::Flags Flags, unsigned *Fast) const {
205 // Disallow double vector stores (to prevent unnecessary
206 // store widening in DAG combiner).
207 if (VecTy.getSizeInBits() > 8 * Subtarget.getHLXVectorLength())
208 return false;
209 if (!Subtarget.isHLXVectorType(VecTy))
210 return false;
211 if (Fast)
212 *Fast = 1;
213 return true;
214}
215
216HexagonTargetLowering::TypePair
217HexagonTargetLowering::typeHlxSplit(MVT VecTy) const {
218 assert(VecTy.isVector());
219 unsigned NumElem = VecTy.getVectorNumElements();
220 assert((NumElem % 2) == 0 && "Expecting even-sized vector type");
221 MVT ElemTy = VecTy.getVectorElementType();
222 MVT HalfTy;
223 if (ElemTy == MVT::i32)
224 HalfTy = VecTy.changeVectorElementType(MVT::i16);
225 else
226 HalfTy = MVT::getVectorVT(VecTy.getVectorElementType(), NumElem / 2);
227 return {HalfTy, HalfTy};
228}
229
230// Reload a stack-passed HLX pair argument: two contiguous sub-vector loads
231// recombined with COMBINELL. Calling-convention use only; user pair loads
232// through a pointer are unsupported (QTOOL-134974).
233SDValue HexagonTargetLowering::splitHlxPairArgLoad(
234 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue BaseAddr,
235 MVT PairTy, MachinePointerInfo PtrInfo) const {
236 unsigned HlxVLen = Subtarget.getHLXVectorLength();
237 MVT SingleTy = typeHlxSplit(PairTy).first;
238 SDValue Base1 =
239 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
241 Align HalfAlign = DAG.getEVTAlign(SingleTy);
242 MachineMemOperand *MOp0 = MF.getMachineMemOperand(
243 PtrInfo, MachineMemOperand::MOLoad, HlxVLen, HalfAlign);
244 MachineMemOperand *MOp1 =
245 MF.getMachineMemOperand(PtrInfo.getWithOffset(HlxVLen),
246 MachineMemOperand::MOLoad, HlxVLen, HalfAlign);
247 SDValue Load0 = DAG.getLoad(SingleTy, dl, Chain, BaseAddr, MOp0);
248 SDValue Load1 = DAG.getLoad(SingleTy, dl, Chain, Base1, MOp1);
249 return DAG.getNode(HexagonISD::COMBINELL, dl, PairTy, Load1, Load0);
250}
251
252// Spill a stack-passed HLX pair argument: extract vsub_lo/vsub_hi and store
253// them to contiguous slots, appending both chains to MemOpChains.
254// Calling-convention use only (QTOOL-134974).
255void HexagonTargetLowering::splitHlxPairArgStore(
256 SelectionDAG &DAG, const SDLoc &dl, SDValue Chain, SDValue StoreVal,
257 SDValue BaseAddr, MVT PairTy, MachinePointerInfo PtrInfo,
258 SmallVectorImpl<SDValue> &MemOpChains) const {
259 unsigned HlxVLen = Subtarget.getHLXVectorLength();
260 MVT SingleTy = typeHlxSplit(PairTy).first;
261 SDValue Base1 =
262 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
263 SDValue Lo =
264 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, StoreVal);
265 SDValue Hi =
266 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, StoreVal);
267 MemOpChains.push_back(DAG.getStore(Chain, dl, Lo, BaseAddr, PtrInfo));
268 MemOpChains.push_back(
269 DAG.getStore(Chain, dl, Hi, Base1, PtrInfo.getWithOffset(HlxVLen)));
270}
271
272// Shared helper for splitting pair memory intrinsics into two single-vector
273// operations. Used by LowerHlxPairIntrinsic for the LX_LL16b_tmp /
274// LX_SS16b_new pair load/store intrinsics.
276 const HexagonSubtarget &ST,
277 SDValue BaseAddr,
278 SDValue StoreVal = SDValue()) {
279 auto *MemN = cast<MemSDNode>(Op.getNode());
280 MVT PairTy = MemN->getMemoryVT().getSimpleVT();
281 unsigned HlxVLen = ST.getHLXVectorLength();
282 assert(PairTy.getSizeInBits() == 16 * HlxVLen &&
283 PairTy.getVectorElementType() == MVT::i32 &&
284 "Expected HLX vector pair type");
285 MVT SingleTy = PairTy.changeVectorElementType(MVT::i16);
286 SDValue Chain = MemN->getChain();
287 const SDLoc &dl(Op);
288 SDValue Base1 =
289 DAG.getMemBasePlusOffset(BaseAddr, TypeSize::getFixed(HlxVLen), dl);
290
291 MachineMemOperand *MOp0 = nullptr, *MOp1 = nullptr;
292 if (MachineMemOperand *MMO = MemN->getMemOperand()) {
294 MOp0 = MF.getMachineMemOperand(MMO, 0, HlxVLen);
295 MOp1 = MF.getMachineMemOperand(MMO, HlxVLen, HlxVLen);
296 }
297
298 if (StoreVal) {
299 // Store: split value into two halves, emit two stores, combine chains.
300 SDValue Lo =
301 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, StoreVal);
302 SDValue Hi =
303 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, StoreVal);
304 SDValue Store0 = DAG.getStore(Chain, dl, Lo, BaseAddr, MOp0);
305 SDValue Store1 = DAG.getStore(Chain, dl, Hi, Base1, MOp1);
306 return DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Store0, Store1);
307 }
308
309 // Load: emit two single-vector loads, combine with COMBINELL.
310 SDValue Load0 = DAG.getLoad(SingleTy, dl, Chain, BaseAddr, MOp0);
311 SDValue Load1 = DAG.getLoad(SingleTy, dl, Chain, Base1, MOp1);
312 return DAG.getMergeValues(
313 {DAG.getNode(HexagonISD::COMBINELL, dl, PairTy, Load1, Load0),
314 DAG.getNode(ISD::TokenFactor, dl, MVT::Other, Load0.getValue(1),
315 Load1.getValue(1))},
316 dl);
317}
318
319// Lower pair load/store intrinsics (LX_LL16b_tmp, LX_SS16b_new) by
320// splitting into two single-vector operations via SplitHlxPairMemHelper.
321SDValue HexagonTargetLowering::LowerHlxPairIntrinsic(SDValue Op,
322 SelectionDAG &DAG) const {
323 unsigned IntNo = Op.getConstantOperandVal(1);
324 switch (IntNo) {
325 case Intrinsic::hexagon_LX_LL16b_tmp:
326 return SplitHlxPairMemHelper(Op, DAG, Subtarget, Op.getOperand(2));
327 case Intrinsic::hexagon_LX_SS16b_new:
328 return SplitHlxPairMemHelper(Op, DAG, Subtarget, Op.getOperand(2),
329 Op.getOperand(3));
330 default:
331 return Op;
332 }
333}
334
335// Lower masked load/store operations to HLX instructions.
336//
337// HLX does not have native masked load/store instructions. Instead, we
338// lower them to a sequence of regular load/store + VSELECT operations:
339//
340// MLOAD(base, mask, passthru) => VSELECT(mask, LOAD(base), passthru)
341// MSTORE(base, value, mask) => STORE(base, VSELECT(mask, value,
342// LOAD(base)))
343//
344// For MLOAD: Load the full vector, then use VSELECT to choose between
345// loaded values (where mask is true) and passthru values (where mask is
346// false).
347//
348// For MSTORE: Load the existing memory contents, use VSELECT to merge the
349// new value (where mask is true) with old contents (where mask is false),
350// then store the result. This preserves unmasked lanes.
351SDValue HexagonTargetLowering::LowerHlxMaskedOp(SDValue Op,
352 SelectionDAG &DAG) const {
353 auto *MaskN = cast<MaskedLoadStoreSDNode>(Op.getNode());
354 unsigned HwLen = Subtarget.getHLXVectorLength();
355
356 // HLX has no native masked load/store. We emulate them with a full-width
357 // load (and, for stores, a load-modify-store), which reads/writes the
358 // inactive lanes. That is only sound for ordinary memory accesses: a
359 // volatile or atomic access must not touch inactive lanes, so bail out
360 // rather than silently change the program's memory semantics.
361 if (MaskN->isVolatile() || !MaskN->getMemOperand()->isUnordered()) {
362 DAG.getContext()->emitError(
363 "Volatile or atomic masked load/store of HLX vector type is not "
364 "supported");
365 return SDValue();
366 }
367
368 if (MaskN->getAlign().value() % HwLen != 0) {
369 DAG.getContext()->emitError(
370 "Masked load/store of HLX vector type, requires alignment of " +
371 Twine(HwLen) + " bytes for lowering to HLX");
372 return SDValue();
373 }
374
375 const SDLoc &dl(Op);
377 SDValue Mask = MaskN->getMask();
378 SDValue Chain = MaskN->getChain();
379 SDValue Base = MaskN->getBasePtr();
380 MachineMemOperand *MemOp =
381 MaskN->getMemOperand()
382 ? MF.getMachineMemOperand(MaskN->getMemOperand(), 0, HwLen)
383 : nullptr;
384
385 unsigned Opc = Op->getOpcode();
386
387 switch (Opc) {
388 case ISD::MLOAD: {
389 MVT ValTy = ty(Op);
390 SDValue Load = DAG.getLoad(ValTy, dl, Chain, Base, MemOp);
391 SDValue Thru = cast<MaskedLoadSDNode>(MaskN)->getPassThru();
392 if (isUndef(Thru))
393 return Load;
394 SDValue VSel = DAG.getNode(ISD::VSELECT, dl, ValTy, Mask, Load, Thru);
395 return DAG.getMergeValues({VSel, Load.getValue(1)}, dl);
396 }
397 case ISD::MSTORE: {
398 SDValue Value = cast<MaskedStoreSDNode>(MaskN)->getValue();
399 auto PtrInfo = (MemOp && MemOp->getValue())
400 ? MachinePointerInfo(MemOp->getValue())
401 : MachinePointerInfo();
402 SDValue Load =
403 DAG.getLoad(Value.getSimpleValueType(), dl, Chain, Base, PtrInfo,
405 SDValue VSel = DAG.getNode(ISD::VSELECT, dl, Value.getSimpleValueType(),
406 Mask, Value, Load);
407 SDValue Store = DAG.getStore(Load.getValue(1), dl, VSel, Base, MemOp);
408 return Store;
409 }
410 default: {
411 [[maybe_unused]] std::string Name =
412 "Unexpected masked operation: " + Op->getOperationName(&DAG);
413 llvm_unreachable(Name.c_str());
414 }
415 }
416}
417
418// Lowers ternary operations of the following types:
419// HLX_Vector = (int)? HLX_Vector: HLX_Vector
420// HLX_VectorPair = (int)? HLX_VectorPair: HLX_VectorPair
421SDValue HexagonTargetLowering::LowerHlxSelect(SDValue Op,
422 SelectionDAG &DAG) const {
423 SDValue CondVec = Op.getOperand(0); // i1
424 SDValue True = Op.getOperand(1);
425 SDValue False = Op.getOperand(2);
426
427 const SDLoc &dl(Op);
428 MVT ValTy = ty(Op);
429
430 // Always splat condition into single-vector v1024i16 (HlxLR), not pair.
431 // LX_mux_h only needs a single HlxLR condition register, and for pairs
432 // the scalar i1 condition is uniform so the same register is reused for
433 // both halves.
434 MVT CondTy = MVT::getVectorVT(MVT::i16, ValTy.getVectorNumElements());
435 if (ty(CondVec) == MVT::i1) {
436 SDValue Ext = DAG.getNode(ISD::SIGN_EXTEND, dl, MVT::i16, CondVec);
437 CondVec = DAG.getNode(ISD::SPLAT_VECTOR, dl, CondTy, Ext);
438 }
439
440 if (!isHlxPairTy(ValTy))
441 return DAG.getNode(ISD::VSELECT, dl, ValTy, CondVec, True, False);
442
443 TypePair HalfTys = typeHlxSplit(ValTy);
444 MVT SingleTy = HalfTys.first; // v1024i16
445
446 SDValue TrueLo =
447 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, True);
448 SDValue TrueHi =
449 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, True);
450 SDValue FalseLo =
451 DAG.getTargetExtractSubreg(Hexagon::vsub_lo, dl, SingleTy, False);
452 SDValue FalseHi =
453 DAG.getTargetExtractSubreg(Hexagon::vsub_hi, dl, SingleTy, False);
454
455 SDValue LoSelect =
456 DAG.getNode(ISD::VSELECT, dl, SingleTy, CondVec, TrueLo, FalseLo);
457 SDValue HiSelect =
458 DAG.getNode(ISD::VSELECT, dl, SingleTy, CondVec, TrueHi, FalseHi);
459
460 return DAG.getNode(HexagonISD::COMBINELL, dl, ValTy, HiSelect, LoSelect);
461}
462
463SDValue HexagonTargetLowering::LowerHlxOperation(SDValue Op,
464 SelectionDAG &DAG) const {
465 unsigned Opc = Op.getOpcode();
466 switch (Opc) {
467 default:
468 break;
471 return LowerHlxPairIntrinsic(Op, DAG);
473 return Op;
474 case ISD::MLOAD:
475 case ISD::MSTORE:
476 return LowerHlxMaskedOp(Op, DAG);
477 case ISD::SELECT:
478 return LowerHlxSelect(Op, DAG);
479 case ISD::ADD:
480 case ISD::SUB:
481 case ISD::UADDSAT:
482 case ISD::SADDSAT:
483 case ISD::USUBSAT:
484 case ISD::SSUBSAT:
485 case ISD::MUL:
486 case ISD::SHL:
487 case ISD::SRL:
488 case ISD::SRA:
489 case ISD::SMIN:
490 case ISD::SMAX:
491 case ISD::UMIN:
492 case ISD::UMAX:
493 case ISD::ABS:
494 case ISD::ABDS:
495 case ISD::ABDU:
496 case ISD::AVGFLOORS:
497 case ISD::AVGFLOORU:
498 case ISD::AVGCEILS:
499 case ISD::AVGCEILU:
501 case ISD::VSELECT:
502 case ISD::SETCC: {
503 MVT VT = Opc == ISD::SETCC ? ty(Op.getOperand(0)) : ty(Op);
504 DAG.getContext()->emitError(
505 "HLX does not support '" + Op->getOperationName(&DAG) +
506 "' on vector type " + EVT(VT).getEVTString() +
507 "; use an element type and vector length supported by the HLX ISA");
508 return DAG.getUNDEF(ty(Op));
509 }
510 }
511#ifndef NDEBUG
512 Op.dumpr(&DAG);
513#endif
514 llvm_unreachable("Unhandled HLX operation");
515}
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[]
unsigned Opc
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