15#ifndef LLVM_LIB_CODEGEN_SELECTIONDAG_LEGALIZETYPES_H
16#define LLVM_LIB_CODEGEN_SELECTIONDAG_LEGALIZETYPES_H
67 bool isTypeLegal(EVT VT)
const {
68 return TLI.getTypeAction(*DAG.
getContext(), VT) == TargetLowering::TypeLegal;
72 bool isSimpleLegalType(EVT VT)
const {
73 return VT.isSimple() && TLI.isTypeLegal(VT);
76 EVT getSetCCResultType(EVT VT)
const {
81 bool IgnoreNodeResults(SDNode *
N)
const {
82 return N->getOpcode() == ISD::TargetConstant ||
83 N->getOpcode() == ISD::Register;
89 typedef unsigned TableId;
91 TableId NextValueId = 1;
93 SmallDenseMap<SDValue, TableId, 8> ValueToIdMap;
94 SmallDenseMap<TableId, SDValue, 8> IdToValueMap;
98 SmallDenseMap<TableId, TableId, 8> PromotedIntegers;
102 SmallDenseMap<TableId, std::pair<TableId, TableId>, 8> ExpandedIntegers;
106 SmallDenseMap<TableId, TableId, 8> SoftenedFloats;
110 SmallDenseMap<TableId, TableId, 8> PromotedFloats;
114 SmallDenseMap<TableId, TableId, 8> SoftPromotedHalfs;
118 SmallDenseMap<TableId, std::pair<TableId, TableId>, 8> ExpandedFloats;
122 SmallDenseMap<TableId, TableId, 8> ScalarizedVectors;
126 SmallDenseMap<TableId, std::pair<TableId, TableId>, 8> SplitVectors;
130 SmallDenseMap<TableId, TableId, 8> WidenedVectors;
134 SmallDenseMap<TableId, TableId, 8> ReplacedValues;
138 SmallVector<SDNode*, 128> Worklist;
140 TableId getTableId(SDValue V) {
141 assert(
V.getNode() &&
"Getting TableId on SDValue()");
143 auto I = ValueToIdMap.find(V);
144 if (
I != ValueToIdMap.end()) {
147 assert(
I->second &&
"All Ids should be nonzero");
151 ValueToIdMap.insert(std::make_pair(V, NextValueId));
152 IdToValueMap.insert(std::make_pair(NextValueId, V));
154 assert(NextValueId != 0 &&
155 "Ran out of Ids. Increase id type size or add compactification");
156 return NextValueId - 1;
159 const SDValue &getSDValue(TableId &Id) {
161 assert(Id &&
"TableId should be non-zero");
162 auto I = IdToValueMap.find(Id);
163 assert(
I != IdToValueMap.end() &&
"cannot find Id in map");
169 : TLI(dag.getTargetLoweringInfo()), DAG(dag),
170 ValueTypeActions(TLI.getValueTypeActions()) {
179 assert(Old != New &&
"node replaced with self");
180 for (
unsigned i = 0, e = Old->
getNumValues(); i != e; ++i) {
184 if (OldId != NewId) {
185 ReplacedValues[OldId] = NewId;
190 IdToValueMap.erase(OldId);
191 PromotedIntegers.erase(OldId);
192 ExpandedIntegers.erase(OldId);
193 SoftenedFloats.erase(OldId);
194 PromotedFloats.erase(OldId);
195 SoftPromotedHalfs.erase(OldId);
196 ExpandedFloats.erase(OldId);
197 ScalarizedVectors.erase(OldId);
198 SplitVectors.erase(OldId);
199 WidenedVectors.erase(OldId);
202 ValueToIdMap.erase(
SDValue(Old, i));
210 void AnalyzeNewValue(
SDValue &Val);
211 void PerformExpensiveChecks();
212 void RemapId(TableId &Id);
219 bool CustomLowerNode(
SDNode *
N,
EVT VT,
bool LegalizeResult);
229 std::pair<SDValue, SDValue> ExpandAtomic(
SDNode *
Node);
252 TableId &PromotedId = PromotedIntegers[getTableId(
Op)];
253 SDValue PromotedOp = getSDValue(PromotedId);
257 void SetPromotedInteger(SDValue Op, SDValue Result);
260 SDValue SExtPromotedInteger(SDValue Op) {
261 EVT OldVT = Op.getValueType();
263 Op = GetPromotedInteger(Op);
264 return DAG.
getNode(ISD::SIGN_EXTEND_INREG, dl, Op.getValueType(), Op,
269 SDValue ZExtPromotedInteger(SDValue Op) {
270 EVT OldVT =
Op.getValueType();
272 Op = GetPromotedInteger(Op);
277 SDValue VPSExtPromotedInteger(SDValue Op, SDValue Mask, SDValue EVL) {
278 EVT OldVT =
Op.getValueType();
280 Op = GetPromotedInteger(Op);
282 EVT VT =
Op.getValueType();
283 unsigned BitsDiff = VT.getScalarSizeInBits() - OldVT.getScalarSizeInBits();
285 SDValue Shl = DAG.
getNode(ISD::VP_SHL, dl, VT, Op, ShiftCst, Mask, EVL);
286 return DAG.
getNode(ISD::VP_SRA, dl, VT, Shl, ShiftCst, Mask, EVL);
290 SDValue VPZExtPromotedInteger(SDValue Op, SDValue Mask, SDValue EVL) {
291 EVT OldVT =
Op.getValueType();
293 Op = GetPromotedInteger(Op);
301 SDValue PromoteIntOpVectorReduction(SDNode *
N, SDValue V);
304 void PromoteIntegerResult(SDNode *
N,
unsigned ResNo);
305 SDValue PromoteIntRes_MERGE_VALUES(SDNode *
N,
unsigned ResNo);
306 SDValue PromoteIntRes_AssertSext(SDNode *
N);
307 SDValue PromoteIntRes_AssertZext(SDNode *
N);
308 SDValue PromoteIntRes_Atomic0(AtomicSDNode *
N);
309 SDValue PromoteIntRes_Atomic1(AtomicSDNode *
N);
310 SDValue PromoteIntRes_AtomicCmpSwap(AtomicSDNode *
N,
unsigned ResNo);
311 SDValue PromoteIntRes_EXTRACT_SUBVECTOR(SDNode *
N);
312 SDValue PromoteIntRes_INSERT_SUBVECTOR(SDNode *
N);
313 SDValue PromoteIntRes_VECTOR_REVERSE(SDNode *
N);
314 SDValue PromoteIntRes_VECTOR_SHUFFLE(SDNode *
N);
315 SDValue PromoteIntRes_VECTOR_SPLICE(SDNode *
N);
316 SDValue PromoteIntRes_VECTOR_INTERLEAVE_DEINTERLEAVE(SDNode *
N);
317 SDValue PromoteIntRes_BUILD_VECTOR(SDNode *
N);
318 SDValue PromoteIntRes_ScalarOp(SDNode *
N);
319 SDValue PromoteIntRes_STEP_VECTOR(SDNode *
N);
320 SDValue PromoteIntRes_EXTEND_VECTOR_INREG(SDNode *
N);
321 SDValue PromoteIntRes_INSERT_VECTOR_ELT(SDNode *
N);
322 SDValue PromoteIntRes_CONCAT_VECTORS(SDNode *
N);
323 SDValue PromoteIntRes_BITCAST(SDNode *
N);
324 SDValue PromoteIntRes_BSWAP(SDNode *
N);
325 SDValue PromoteIntRes_BITREVERSE(SDNode *
N);
326 SDValue PromoteIntRes_BUILD_PAIR(SDNode *
N);
327 SDValue PromoteIntRes_Constant(SDNode *
N);
328 SDValue PromoteIntRes_CTLZ(SDNode *
N);
329 SDValue PromoteIntRes_CTPOP_PARITY(SDNode *
N);
330 SDValue PromoteIntRes_CTTZ(SDNode *
N);
331 SDValue PromoteIntRes_VP_CttzElements(SDNode *
N);
332 SDValue PromoteIntRes_EXTRACT_VECTOR_ELT(SDNode *
N);
333 SDValue PromoteIntRes_FP_TO_XINT(SDNode *
N);
334 SDValue PromoteIntRes_FP_TO_XINT_SAT(SDNode *
N);
335 SDValue PromoteIntRes_FP_TO_FP16_BF16(SDNode *
N);
336 SDValue PromoteIntRes_STRICT_FP_TO_FP16_BF16(SDNode *
N);
337 SDValue PromoteIntRes_XRINT(SDNode *
N);
338 SDValue PromoteIntRes_FREEZE(SDNode *
N);
339 SDValue PromoteIntRes_INT_EXTEND(SDNode *
N);
340 SDValue PromoteIntRes_LOAD(LoadSDNode *
N);
341 SDValue PromoteIntRes_MLOAD(MaskedLoadSDNode *
N);
342 SDValue PromoteIntRes_MGATHER(MaskedGatherSDNode *
N);
343 SDValue PromoteIntRes_VECTOR_COMPRESS(SDNode *
N);
344 SDValue PromoteIntRes_Overflow(SDNode *
N);
345 SDValue PromoteIntRes_FFREXP(SDNode *
N);
346 SDValue PromoteIntRes_SADDSUBO(SDNode *
N,
unsigned ResNo);
347 SDValue PromoteIntRes_CMP(SDNode *
N);
348 SDValue PromoteIntRes_Select(SDNode *
N);
349 SDValue PromoteIntRes_SELECT_CC(SDNode *
N);
350 SDValue PromoteIntRes_SETCC(SDNode *
N);
351 SDValue PromoteIntRes_SHL(SDNode *
N);
352 SDValue PromoteIntRes_SimpleIntBinOp(SDNode *
N);
353 SDValue PromoteIntRes_ZExtIntBinOp(SDNode *
N);
354 SDValue PromoteIntRes_SExtIntBinOp(SDNode *
N);
355 SDValue PromoteIntRes_UMINUMAX(SDNode *
N);
356 SDValue PromoteIntRes_SIGN_EXTEND_INREG(SDNode *
N);
357 SDValue PromoteIntRes_SRA(SDNode *
N);
358 SDValue PromoteIntRes_SRL(SDNode *
N);
359 SDValue PromoteIntRes_TRUNCATE(SDNode *
N);
360 SDValue PromoteIntRes_UADDSUBO(SDNode *
N,
unsigned ResNo);
361 SDValue PromoteIntRes_UADDSUBO_CARRY(SDNode *
N,
unsigned ResNo);
362 SDValue PromoteIntRes_SADDSUBO_CARRY(SDNode *
N,
unsigned ResNo);
363 SDValue PromoteIntRes_UNDEF(SDNode *
N);
364 SDValue PromoteIntRes_VAARG(SDNode *
N);
365 SDValue PromoteIntRes_VSCALE(SDNode *
N);
366 SDValue PromoteIntRes_XMULO(SDNode *
N,
unsigned ResNo);
367 template <
class MatchContextClass>
368 SDValue PromoteIntRes_ADDSUBSHLSAT(SDNode *
N);
369 SDValue PromoteIntRes_MULFIX(SDNode *
N);
370 SDValue PromoteIntRes_DIVFIX(SDNode *
N);
371 SDValue PromoteIntRes_GET_ROUNDING(SDNode *
N);
372 SDValue PromoteIntRes_VECREDUCE(SDNode *
N);
373 SDValue PromoteIntRes_VP_REDUCE(SDNode *
N);
374 SDValue PromoteIntRes_ABS(SDNode *
N);
375 SDValue PromoteIntRes_Rotate(SDNode *
N);
376 SDValue PromoteIntRes_FunnelShift(SDNode *
N);
377 SDValue PromoteIntRes_VPFunnelShift(SDNode *
N);
378 SDValue PromoteIntRes_IS_FPCLASS(SDNode *
N);
379 SDValue PromoteIntRes_PATCHPOINT(SDNode *
N);
382 bool PromoteIntegerOperand(SDNode *
N,
unsigned OpNo);
383 SDValue PromoteIntOp_ANY_EXTEND(SDNode *
N);
384 SDValue PromoteIntOp_ATOMIC_STORE(AtomicSDNode *
N);
385 SDValue PromoteIntOp_BITCAST(SDNode *
N);
386 SDValue PromoteIntOp_BUILD_PAIR(SDNode *
N);
387 SDValue PromoteIntOp_BR_CC(SDNode *
N,
unsigned OpNo);
388 SDValue PromoteIntOp_BRCOND(SDNode *
N,
unsigned OpNo);
389 SDValue PromoteIntOp_BUILD_VECTOR(SDNode *
N);
390 SDValue PromoteIntOp_INSERT_VECTOR_ELT(SDNode *
N,
unsigned OpNo);
391 SDValue PromoteIntOp_EXTRACT_VECTOR_ELT(SDNode *
N);
392 SDValue PromoteIntOp_EXTRACT_SUBVECTOR(SDNode *
N);
393 SDValue PromoteIntOp_INSERT_SUBVECTOR(SDNode *
N);
394 SDValue PromoteIntOp_CONCAT_VECTORS(SDNode *
N);
395 SDValue PromoteIntOp_ScalarOp(SDNode *
N);
396 SDValue PromoteIntOp_SELECT(SDNode *
N,
unsigned OpNo);
397 SDValue PromoteIntOp_SELECT_CC(SDNode *
N,
unsigned OpNo);
398 SDValue PromoteIntOp_SETCC(SDNode *
N,
unsigned OpNo);
399 SDValue PromoteIntOp_Shift(SDNode *
N);
400 SDValue PromoteIntOp_CMP(SDNode *
N);
401 SDValue PromoteIntOp_FunnelShift(SDNode *
N);
402 SDValue PromoteIntOp_SIGN_EXTEND(SDNode *
N);
403 SDValue PromoteIntOp_VP_SIGN_EXTEND(SDNode *
N);
404 SDValue PromoteIntOp_SINT_TO_FP(SDNode *
N);
405 SDValue PromoteIntOp_STRICT_SINT_TO_FP(SDNode *
N);
406 SDValue PromoteIntOp_STORE(StoreSDNode *
N,
unsigned OpNo);
407 SDValue PromoteIntOp_TRUNCATE(SDNode *
N);
408 SDValue PromoteIntOp_UINT_TO_FP(SDNode *
N);
409 SDValue PromoteIntOp_STRICT_UINT_TO_FP(SDNode *
N);
410 SDValue PromoteIntOp_ZERO_EXTEND(SDNode *
N);
411 SDValue PromoteIntOp_VP_ZERO_EXTEND(SDNode *
N);
412 SDValue PromoteIntOp_MSTORE(MaskedStoreSDNode *
N,
unsigned OpNo);
413 SDValue PromoteIntOp_MLOAD(MaskedLoadSDNode *
N,
unsigned OpNo);
414 SDValue PromoteIntOp_MSCATTER(MaskedScatterSDNode *
N,
unsigned OpNo);
415 SDValue PromoteIntOp_MGATHER(MaskedGatherSDNode *
N,
unsigned OpNo);
416 SDValue PromoteIntOp_VECTOR_COMPRESS(SDNode *
N,
unsigned OpNo);
417 SDValue PromoteIntOp_FRAMERETURNADDR(SDNode *
N);
418 SDValue PromoteIntOp_FIX(SDNode *
N);
419 SDValue PromoteIntOp_ExpOp(SDNode *
N);
420 SDValue PromoteIntOp_VECREDUCE(SDNode *
N);
421 SDValue PromoteIntOp_VP_REDUCE(SDNode *
N,
unsigned OpNo);
422 SDValue PromoteIntOp_SET_ROUNDING(SDNode *
N);
423 SDValue PromoteIntOp_STACKMAP(SDNode *
N,
unsigned OpNo);
424 SDValue PromoteIntOp_PATCHPOINT(SDNode *
N,
unsigned OpNo);
425 SDValue PromoteIntOp_VP_STRIDED(SDNode *
N,
unsigned OpNo);
426 SDValue PromoteIntOp_VP_SPLICE(SDNode *
N,
unsigned OpNo);
428 void SExtOrZExtPromotedOperands(SDValue &
LHS, SDValue &
RHS);
429 void PromoteSetCCOperands(SDValue &
LHS,SDValue &
RHS, ISD::CondCode Code);
441 void GetExpandedInteger(SDValue Op, SDValue &
Lo, SDValue &
Hi);
442 void SetExpandedInteger(SDValue Op, SDValue
Lo, SDValue
Hi);
445 void ExpandIntegerResult(SDNode *
N,
unsigned ResNo);
446 void ExpandIntRes_ANY_EXTEND (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
447 void ExpandIntRes_AssertSext (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
448 void ExpandIntRes_AssertZext (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
449 void ExpandIntRes_Constant (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
450 void ExpandIntRes_ABS (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
451 void ExpandIntRes_ABD (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
452 void ExpandIntRes_CTLZ (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
453 void ExpandIntRes_CTPOP (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
454 void ExpandIntRes_CTTZ (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
455 void ExpandIntRes_LOAD (LoadSDNode *
N, SDValue &
Lo, SDValue &
Hi);
456 void ExpandIntRes_READCOUNTER (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
457 void ExpandIntRes_SIGN_EXTEND (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
458 void ExpandIntRes_SIGN_EXTEND_INREG (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
459 void ExpandIntRes_TRUNCATE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
460 void ExpandIntRes_ZERO_EXTEND (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
461 void ExpandIntRes_GET_ROUNDING (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
462 void ExpandIntRes_FP_TO_XINT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
463 void ExpandIntRes_FP_TO_XINT_SAT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
464 void ExpandIntRes_XROUND_XRINT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
466 void ExpandIntRes_Logical (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
467 void ExpandIntRes_ADDSUB (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
468 void ExpandIntRes_ADDSUBC (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
469 void ExpandIntRes_ADDSUBE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
470 void ExpandIntRes_UADDSUBO_CARRY (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
471 void ExpandIntRes_SADDSUBO_CARRY (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
472 void ExpandIntRes_BITREVERSE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
473 void ExpandIntRes_BSWAP (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
474 void ExpandIntRes_PARITY (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
475 void ExpandIntRes_MUL (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
476 void ExpandIntRes_SDIV (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
477 void ExpandIntRes_SREM (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
478 void ExpandIntRes_UDIV (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
479 void ExpandIntRes_UREM (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
480 void ExpandIntRes_ShiftThroughStack (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
481 void ExpandIntRes_Shift (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
483 void ExpandIntRes_MINMAX (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
485 void ExpandIntRes_CMP (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
487 void ExpandIntRes_SADDSUBO (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
488 void ExpandIntRes_UADDSUBO (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
489 void ExpandIntRes_XMULO (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
490 void ExpandIntRes_AVG (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
491 void ExpandIntRes_ADDSUBSAT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
492 void ExpandIntRes_SHLSAT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
493 void ExpandIntRes_MULFIX (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
494 void ExpandIntRes_DIVFIX (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
496 void ExpandIntRes_ATOMIC_LOAD (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
497 void ExpandIntRes_VECREDUCE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
499 void ExpandIntRes_Rotate (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
500 void ExpandIntRes_FunnelShift (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
502 void ExpandIntRes_VSCALE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
504 void ExpandShiftByConstant(SDNode *
N,
const APInt &Amt,
505 SDValue &
Lo, SDValue &
Hi);
506 bool ExpandShiftWithKnownAmountBit(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
507 bool ExpandShiftWithUnknownAmountBit(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
510 bool ExpandIntegerOperand(SDNode *
N,
unsigned OpNo);
511 SDValue ExpandIntOp_BR_CC(SDNode *
N);
512 SDValue ExpandIntOp_SELECT_CC(SDNode *
N);
513 SDValue ExpandIntOp_SETCC(SDNode *
N);
514 SDValue ExpandIntOp_SETCCCARRY(SDNode *
N);
515 SDValue ExpandIntOp_Shift(SDNode *
N);
516 SDValue ExpandIntOp_CMP(SDNode *
N);
517 SDValue ExpandIntOp_STORE(StoreSDNode *
N,
unsigned OpNo);
518 SDValue ExpandIntOp_TRUNCATE(SDNode *
N);
519 SDValue ExpandIntOp_XINT_TO_FP(SDNode *
N);
520 SDValue ExpandIntOp_RETURNADDR(SDNode *
N);
521 SDValue ExpandIntOp_ATOMIC_STORE(SDNode *
N);
522 SDValue ExpandIntOp_SPLAT_VECTOR(SDNode *
N);
523 SDValue ExpandIntOp_STACKMAP(SDNode *
N,
unsigned OpNo);
524 SDValue ExpandIntOp_PATCHPOINT(SDNode *
N,
unsigned OpNo);
525 SDValue ExpandIntOp_VP_STRIDED(SDNode *
N,
unsigned OpNo);
527 void IntegerExpandSetCCOperands(SDValue &NewLHS, SDValue &NewRHS,
528 ISD::CondCode &CCCode,
const SDLoc &dl);
539 SDValue GetSoftenedFloat(SDValue Op) {
540 TableId
Id = getTableId(Op);
541 auto Iter = SoftenedFloats.find(Id);
542 if (Iter == SoftenedFloats.end()) {
543 assert(isSimpleLegalType(
Op.getValueType()) &&
544 "Operand wasn't converted to integer?");
547 SDValue SoftenedOp = getSDValue(Iter->second);
548 assert(SoftenedOp.getNode() &&
"Unconverted op in SoftenedFloats?");
551 void SetSoftenedFloat(SDValue Op, SDValue Result);
554 void SoftenFloatResult(SDNode *
N,
unsigned ResNo);
555 SDValue SoftenFloatRes_Unary(SDNode *
N, RTLIB::Libcall LC);
556 SDValue SoftenFloatRes_Binary(SDNode *
N, RTLIB::Libcall LC);
557 SDValue SoftenFloatRes_MERGE_VALUES(SDNode *
N,
unsigned ResNo);
558 SDValue SoftenFloatRes_ARITH_FENCE(SDNode *
N);
559 SDValue SoftenFloatRes_BITCAST(SDNode *
N);
560 SDValue SoftenFloatRes_BUILD_PAIR(SDNode *
N);
561 SDValue SoftenFloatRes_ConstantFP(SDNode *
N);
562 SDValue SoftenFloatRes_EXTRACT_ELEMENT(SDNode *
N);
563 SDValue SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *
N,
unsigned ResNo);
564 SDValue SoftenFloatRes_FABS(SDNode *
N);
565 SDValue SoftenFloatRes_FACOS(SDNode *
N);
566 SDValue SoftenFloatRes_FASIN(SDNode *
N);
567 SDValue SoftenFloatRes_FATAN(SDNode *
N);
568 SDValue SoftenFloatRes_FMINNUM(SDNode *
N);
569 SDValue SoftenFloatRes_FMAXNUM(SDNode *
N);
570 SDValue SoftenFloatRes_FMINIMUMNUM(SDNode *
N);
571 SDValue SoftenFloatRes_FMAXIMUMNUM(SDNode *
N);
572 SDValue SoftenFloatRes_FADD(SDNode *
N);
573 SDValue SoftenFloatRes_FCBRT(SDNode *
N);
574 SDValue SoftenFloatRes_FCEIL(SDNode *
N);
575 SDValue SoftenFloatRes_FCOPYSIGN(SDNode *
N);
576 SDValue SoftenFloatRes_FCOS(SDNode *
N);
577 SDValue SoftenFloatRes_FCOSH(SDNode *
N);
578 SDValue SoftenFloatRes_FDIV(SDNode *
N);
579 SDValue SoftenFloatRes_FEXP(SDNode *
N);
580 SDValue SoftenFloatRes_FEXP2(SDNode *
N);
581 SDValue SoftenFloatRes_FEXP10(SDNode *
N);
582 SDValue SoftenFloatRes_FFLOOR(SDNode *
N);
583 SDValue SoftenFloatRes_FLOG(SDNode *
N);
584 SDValue SoftenFloatRes_FLOG2(SDNode *
N);
585 SDValue SoftenFloatRes_FLOG10(SDNode *
N);
586 SDValue SoftenFloatRes_FMA(SDNode *
N);
587 SDValue SoftenFloatRes_FMUL(SDNode *
N);
588 SDValue SoftenFloatRes_FNEARBYINT(SDNode *
N);
589 SDValue SoftenFloatRes_FNEG(SDNode *
N);
590 SDValue SoftenFloatRes_FP_EXTEND(SDNode *
N);
591 SDValue SoftenFloatRes_FP16_TO_FP(SDNode *
N);
592 SDValue SoftenFloatRes_BF16_TO_FP(SDNode *
N);
593 SDValue SoftenFloatRes_FP_ROUND(SDNode *
N);
594 SDValue SoftenFloatRes_FPOW(SDNode *
N);
595 SDValue SoftenFloatRes_ExpOp(SDNode *
N);
596 SDValue SoftenFloatRes_FFREXP(SDNode *
N);
597 SDValue SoftenFloatRes_FREEZE(SDNode *
N);
598 SDValue SoftenFloatRes_FREM(SDNode *
N);
599 SDValue SoftenFloatRes_FRINT(SDNode *
N);
600 SDValue SoftenFloatRes_FROUND(SDNode *
N);
601 SDValue SoftenFloatRes_FROUNDEVEN(SDNode *
N);
602 SDValue SoftenFloatRes_FSIN(SDNode *
N);
603 SDValue SoftenFloatRes_FSINH(SDNode *
N);
604 SDValue SoftenFloatRes_FSQRT(SDNode *
N);
605 SDValue SoftenFloatRes_FSUB(SDNode *
N);
606 SDValue SoftenFloatRes_FTAN(SDNode *
N);
607 SDValue SoftenFloatRes_FTANH(SDNode *
N);
608 SDValue SoftenFloatRes_FTRUNC(SDNode *
N);
609 SDValue SoftenFloatRes_LOAD(SDNode *
N);
610 SDValue SoftenFloatRes_ATOMIC_LOAD(SDNode *
N);
611 SDValue SoftenFloatRes_SELECT(SDNode *
N);
612 SDValue SoftenFloatRes_SELECT_CC(SDNode *
N);
613 SDValue SoftenFloatRes_UNDEF(SDNode *
N);
614 SDValue SoftenFloatRes_VAARG(SDNode *
N);
615 SDValue SoftenFloatRes_XINT_TO_FP(SDNode *
N);
616 SDValue SoftenFloatRes_VECREDUCE(SDNode *
N);
617 SDValue SoftenFloatRes_VECREDUCE_SEQ(SDNode *
N);
620 bool SoftenFloatOperand(SDNode *
N,
unsigned OpNo);
621 SDValue SoftenFloatOp_Unary(SDNode *
N, RTLIB::Libcall LC);
622 SDValue SoftenFloatOp_BITCAST(SDNode *
N);
623 SDValue SoftenFloatOp_BR_CC(SDNode *
N);
624 SDValue SoftenFloatOp_FP_ROUND(SDNode *
N);
625 SDValue SoftenFloatOp_FP_TO_XINT(SDNode *
N);
626 SDValue SoftenFloatOp_FP_TO_XINT_SAT(SDNode *
N);
627 SDValue SoftenFloatOp_LROUND(SDNode *
N);
628 SDValue SoftenFloatOp_LLROUND(SDNode *
N);
629 SDValue SoftenFloatOp_LRINT(SDNode *
N);
630 SDValue SoftenFloatOp_LLRINT(SDNode *
N);
631 SDValue SoftenFloatOp_SELECT_CC(SDNode *
N);
632 SDValue SoftenFloatOp_SETCC(SDNode *
N);
633 SDValue SoftenFloatOp_STORE(SDNode *
N,
unsigned OpNo);
634 SDValue SoftenFloatOp_ATOMIC_STORE(SDNode *
N,
unsigned OpNo);
635 SDValue SoftenFloatOp_FCOPYSIGN(SDNode *
N);
647 void GetExpandedFloat(SDValue Op, SDValue &
Lo, SDValue &
Hi);
648 void SetExpandedFloat(SDValue Op, SDValue
Lo, SDValue
Hi);
651 void ExpandFloatResult(SDNode *
N,
unsigned ResNo);
652 void ExpandFloatRes_ConstantFP(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
653 void ExpandFloatRes_Unary(SDNode *
N, RTLIB::Libcall LC,
654 SDValue &
Lo, SDValue &
Hi);
655 void ExpandFloatRes_Binary(SDNode *
N, RTLIB::Libcall LC,
656 SDValue &
Lo, SDValue &
Hi);
658 void ExpandFloatRes_FABS (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
659 void ExpandFloatRes_FACOS (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
660 void ExpandFloatRes_FASIN (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
661 void ExpandFloatRes_FATAN (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
662 void ExpandFloatRes_FMINNUM (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
663 void ExpandFloatRes_FMAXNUM (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
664 void ExpandFloatRes_FMINIMUMNUM(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
665 void ExpandFloatRes_FMAXIMUMNUM(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
666 void ExpandFloatRes_FADD (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
667 void ExpandFloatRes_FCBRT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
668 void ExpandFloatRes_FCEIL (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
669 void ExpandFloatRes_FCOPYSIGN (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
670 void ExpandFloatRes_FCOS (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
671 void ExpandFloatRes_FCOSH (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
672 void ExpandFloatRes_FDIV (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
673 void ExpandFloatRes_FEXP (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
674 void ExpandFloatRes_FEXP2 (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
675 void ExpandFloatRes_FEXP10 (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
676 void ExpandFloatRes_FFLOOR (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
677 void ExpandFloatRes_FLOG (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
678 void ExpandFloatRes_FLOG2 (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
679 void ExpandFloatRes_FLOG10 (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
680 void ExpandFloatRes_FMA (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
681 void ExpandFloatRes_FMUL (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
682 void ExpandFloatRes_FNEARBYINT(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
683 void ExpandFloatRes_FNEG (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
684 void ExpandFloatRes_FP_EXTEND (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
685 void ExpandFloatRes_FPOW (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
686 void ExpandFloatRes_FPOWI (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
687 void ExpandFloatRes_FLDEXP (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
688 void ExpandFloatRes_FREEZE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
689 void ExpandFloatRes_FREM (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
690 void ExpandFloatRes_FRINT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
691 void ExpandFloatRes_FROUND (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
692 void ExpandFloatRes_FROUNDEVEN(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
693 void ExpandFloatRes_FSIN (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
694 void ExpandFloatRes_FSINH (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
695 void ExpandFloatRes_FSQRT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
696 void ExpandFloatRes_FSUB (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
697 void ExpandFloatRes_FTAN (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
698 void ExpandFloatRes_FTANH (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
699 void ExpandFloatRes_FTRUNC (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
700 void ExpandFloatRes_LOAD (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
701 void ExpandFloatRes_XINT_TO_FP(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
705 bool ExpandFloatOperand(SDNode *
N,
unsigned OpNo);
706 SDValue ExpandFloatOp_BR_CC(SDNode *
N);
707 SDValue ExpandFloatOp_FCOPYSIGN(SDNode *
N);
708 SDValue ExpandFloatOp_FP_ROUND(SDNode *
N);
709 SDValue ExpandFloatOp_FP_TO_XINT(SDNode *
N);
710 SDValue ExpandFloatOp_LROUND(SDNode *
N);
711 SDValue ExpandFloatOp_LLROUND(SDNode *
N);
712 SDValue ExpandFloatOp_LRINT(SDNode *
N);
713 SDValue ExpandFloatOp_LLRINT(SDNode *
N);
714 SDValue ExpandFloatOp_SELECT_CC(SDNode *
N);
715 SDValue ExpandFloatOp_SETCC(SDNode *
N);
716 SDValue ExpandFloatOp_STORE(SDNode *
N,
unsigned OpNo);
718 void FloatExpandSetCCOperands(SDValue &NewLHS, SDValue &NewRHS,
719 ISD::CondCode &CCCode,
const SDLoc &dl,
720 SDValue &Chain,
bool IsSignaling =
false);
726 SDValue GetPromotedFloat(SDValue Op) {
727 TableId &PromotedId = PromotedFloats[getTableId(Op)];
728 SDValue PromotedOp = getSDValue(PromotedId);
729 assert(PromotedOp.getNode() &&
"Operand wasn't promoted?");
732 void SetPromotedFloat(SDValue Op, SDValue Result);
734 void PromoteFloatResult(SDNode *
N,
unsigned ResNo);
735 SDValue PromoteFloatRes_BITCAST(SDNode *
N);
736 SDValue PromoteFloatRes_BinOp(SDNode *
N);
737 SDValue PromoteFloatRes_ConstantFP(SDNode *
N);
738 SDValue PromoteFloatRes_EXTRACT_VECTOR_ELT(SDNode *
N);
739 SDValue PromoteFloatRes_FCOPYSIGN(SDNode *
N);
740 SDValue PromoteFloatRes_FMAD(SDNode *
N);
741 SDValue PromoteFloatRes_ExpOp(SDNode *
N);
742 SDValue PromoteFloatRes_FFREXP(SDNode *
N);
743 SDValue PromoteFloatRes_FP_ROUND(SDNode *
N);
744 SDValue PromoteFloatRes_STRICT_FP_ROUND(SDNode *
N);
745 SDValue PromoteFloatRes_LOAD(SDNode *
N);
746 SDValue PromoteFloatRes_ATOMIC_LOAD(SDNode *
N);
747 SDValue PromoteFloatRes_SELECT(SDNode *
N);
748 SDValue PromoteFloatRes_SELECT_CC(SDNode *
N);
749 SDValue PromoteFloatRes_UnaryOp(SDNode *
N);
750 SDValue PromoteFloatRes_UNDEF(SDNode *
N);
751 SDValue BitcastToInt_ATOMIC_SWAP(SDNode *
N);
752 SDValue PromoteFloatRes_XINT_TO_FP(SDNode *
N);
753 SDValue PromoteFloatRes_VECREDUCE(SDNode *
N);
754 SDValue PromoteFloatRes_VECREDUCE_SEQ(SDNode *
N);
756 bool PromoteFloatOperand(SDNode *
N,
unsigned OpNo);
757 SDValue PromoteFloatOp_BITCAST(SDNode *
N,
unsigned OpNo);
758 SDValue PromoteFloatOp_FCOPYSIGN(SDNode *
N,
unsigned OpNo);
759 SDValue PromoteFloatOp_FP_EXTEND(SDNode *
N,
unsigned OpNo);
760 SDValue PromoteFloatOp_STRICT_FP_EXTEND(SDNode *
N,
unsigned OpNo);
761 SDValue PromoteFloatOp_UnaryOp(SDNode *
N,
unsigned OpNo);
762 SDValue PromoteFloatOp_FP_TO_XINT_SAT(SDNode *
N,
unsigned OpNo);
763 SDValue PromoteFloatOp_STORE(SDNode *
N,
unsigned OpNo);
764 SDValue PromoteFloatOp_ATOMIC_STORE(SDNode *
N,
unsigned OpNo);
765 SDValue PromoteFloatOp_SELECT_CC(SDNode *
N,
unsigned OpNo);
766 SDValue PromoteFloatOp_SETCC(SDNode *
N,
unsigned OpNo);
772 SDValue GetSoftPromotedHalf(SDValue Op) {
773 TableId &PromotedId = SoftPromotedHalfs[getTableId(Op)];
774 SDValue PromotedOp = getSDValue(PromotedId);
775 assert(PromotedOp.getNode() &&
"Operand wasn't promoted?");
778 void SetSoftPromotedHalf(SDValue Op, SDValue Result);
780 void SoftPromoteHalfResult(SDNode *
N,
unsigned ResNo);
781 SDValue SoftPromoteHalfRes_ARITH_FENCE(SDNode *
N);
782 SDValue SoftPromoteHalfRes_BinOp(SDNode *
N);
783 SDValue SoftPromoteHalfRes_BITCAST(SDNode *
N);
784 SDValue SoftPromoteHalfRes_ConstantFP(SDNode *
N);
785 SDValue SoftPromoteHalfRes_EXTRACT_VECTOR_ELT(SDNode *
N);
786 SDValue SoftPromoteHalfRes_FCOPYSIGN(SDNode *
N);
787 SDValue SoftPromoteHalfRes_FMAD(SDNode *
N);
788 SDValue SoftPromoteHalfRes_ExpOp(SDNode *
N);
789 SDValue SoftPromoteHalfRes_FFREXP(SDNode *
N);
790 SDValue SoftPromoteHalfRes_FP_ROUND(SDNode *
N);
791 SDValue SoftPromoteHalfRes_LOAD(SDNode *
N);
792 SDValue SoftPromoteHalfRes_ATOMIC_LOAD(SDNode *
N);
793 SDValue SoftPromoteHalfRes_SELECT(SDNode *
N);
794 SDValue SoftPromoteHalfRes_SELECT_CC(SDNode *
N);
795 SDValue SoftPromoteHalfRes_UnaryOp(SDNode *
N);
796 SDValue SoftPromoteHalfRes_XINT_TO_FP(SDNode *
N);
797 SDValue SoftPromoteHalfRes_UNDEF(SDNode *
N);
798 SDValue SoftPromoteHalfRes_VECREDUCE(SDNode *
N);
799 SDValue SoftPromoteHalfRes_VECREDUCE_SEQ(SDNode *
N);
801 bool SoftPromoteHalfOperand(SDNode *
N,
unsigned OpNo);
802 SDValue SoftPromoteHalfOp_BITCAST(SDNode *
N);
803 SDValue SoftPromoteHalfOp_FCOPYSIGN(SDNode *
N,
unsigned OpNo);
804 SDValue SoftPromoteHalfOp_FP_EXTEND(SDNode *
N);
805 SDValue SoftPromoteHalfOp_FP_TO_XINT(SDNode *
N);
806 SDValue SoftPromoteHalfOp_FP_TO_XINT_SAT(SDNode *
N);
807 SDValue SoftPromoteHalfOp_SETCC(SDNode *
N);
808 SDValue SoftPromoteHalfOp_SELECT_CC(SDNode *
N,
unsigned OpNo);
809 SDValue SoftPromoteHalfOp_STORE(SDNode *
N,
unsigned OpNo);
810 SDValue SoftPromoteHalfOp_ATOMIC_STORE(SDNode *
N,
unsigned OpNo);
811 SDValue SoftPromoteHalfOp_STACKMAP(SDNode *
N,
unsigned OpNo);
812 SDValue SoftPromoteHalfOp_PATCHPOINT(SDNode *
N,
unsigned OpNo);
821 SDValue GetScalarizedVector(SDValue Op) {
822 TableId &ScalarizedId = ScalarizedVectors[getTableId(Op)];
823 SDValue ScalarizedOp = getSDValue(ScalarizedId);
824 assert(ScalarizedOp.getNode() &&
"Operand wasn't scalarized?");
827 void SetScalarizedVector(SDValue Op, SDValue Result);
830 void ScalarizeVectorResult(SDNode *
N,
unsigned ResNo);
831 SDValue ScalarizeVecRes_MERGE_VALUES(SDNode *
N,
unsigned ResNo);
832 SDValue ScalarizeVecRes_BinOp(SDNode *
N);
833 SDValue ScalarizeVecRes_CMP(SDNode *
N);
834 SDValue ScalarizeVecRes_TernaryOp(SDNode *
N);
835 SDValue ScalarizeVecRes_UnaryOp(SDNode *
N);
836 SDValue ScalarizeVecRes_StrictFPOp(SDNode *
N);
837 SDValue ScalarizeVecRes_OverflowOp(SDNode *
N,
unsigned ResNo);
838 SDValue ScalarizeVecRes_InregOp(SDNode *
N);
839 SDValue ScalarizeVecRes_VecInregOp(SDNode *
N);
841 SDValue ScalarizeVecRes_ADDRSPACECAST(SDNode *
N);
842 SDValue ScalarizeVecRes_BITCAST(SDNode *
N);
843 SDValue ScalarizeVecRes_BUILD_VECTOR(SDNode *
N);
844 SDValue ScalarizeVecRes_EXTRACT_SUBVECTOR(SDNode *
N);
845 SDValue ScalarizeVecRes_FP_ROUND(SDNode *
N);
846 SDValue ScalarizeVecRes_ExpOp(SDNode *
N);
847 SDValue ScalarizeVecRes_INSERT_VECTOR_ELT(SDNode *
N);
848 SDValue ScalarizeVecRes_LOAD(LoadSDNode *
N);
849 SDValue ScalarizeVecRes_SCALAR_TO_VECTOR(SDNode *
N);
850 SDValue ScalarizeVecRes_VSELECT(SDNode *
N);
851 SDValue ScalarizeVecRes_SELECT(SDNode *
N);
852 SDValue ScalarizeVecRes_SELECT_CC(SDNode *
N);
853 SDValue ScalarizeVecRes_SETCC(SDNode *
N);
854 SDValue ScalarizeVecRes_UNDEF(SDNode *
N);
855 SDValue ScalarizeVecRes_VECTOR_SHUFFLE(SDNode *
N);
856 SDValue ScalarizeVecRes_FP_TO_XINT_SAT(SDNode *
N);
857 SDValue ScalarizeVecRes_IS_FPCLASS(SDNode *
N);
859 SDValue ScalarizeVecRes_FIX(SDNode *
N);
860 SDValue ScalarizeVecRes_FFREXP(SDNode *
N,
unsigned ResNo);
863 bool ScalarizeVectorOperand(SDNode *
N,
unsigned OpNo);
864 SDValue ScalarizeVecOp_BITCAST(SDNode *
N);
865 SDValue ScalarizeVecOp_UnaryOp(SDNode *
N);
866 SDValue ScalarizeVecOp_UnaryOp_StrictFP(SDNode *
N);
867 SDValue ScalarizeVecOp_CONCAT_VECTORS(SDNode *
N);
868 SDValue ScalarizeVecOp_INSERT_SUBVECTOR(SDNode *
N,
unsigned OpNo);
869 SDValue ScalarizeVecOp_EXTRACT_VECTOR_ELT(SDNode *
N);
870 SDValue ScalarizeVecOp_VSELECT(SDNode *
N);
871 SDValue ScalarizeVecOp_VSETCC(SDNode *
N);
872 SDValue ScalarizeVecOp_STORE(StoreSDNode *
N,
unsigned OpNo);
873 SDValue ScalarizeVecOp_FP_ROUND(SDNode *
N,
unsigned OpNo);
874 SDValue ScalarizeVecOp_STRICT_FP_ROUND(SDNode *
N,
unsigned OpNo);
875 SDValue ScalarizeVecOp_FP_EXTEND(SDNode *
N);
876 SDValue ScalarizeVecOp_STRICT_FP_EXTEND(SDNode *
N);
877 SDValue ScalarizeVecOp_VECREDUCE(SDNode *
N);
878 SDValue ScalarizeVecOp_VECREDUCE_SEQ(SDNode *
N);
879 SDValue ScalarizeVecOp_CMP(SDNode *
N);
892 void GetSplitVector(SDValue Op, SDValue &
Lo, SDValue &
Hi);
893 void SetSplitVector(SDValue Op, SDValue
Lo, SDValue
Hi);
896 std::pair<SDValue, SDValue> SplitMask(SDValue Mask);
899 std::pair<SDValue, SDValue> SplitMask(SDValue Mask,
const SDLoc &
DL);
903 void IncrementPointer(MemSDNode *
N, EVT MemVT, MachinePointerInfo &MPI,
907 void SplitVectorResult(SDNode *
N,
unsigned ResNo);
908 void SplitVecRes_BinOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
909 void SplitVecRes_TernaryOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
910 void SplitVecRes_CMP(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
911 void SplitVecRes_UnaryOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
912 void SplitVecRes_ADDRSPACECAST(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
913 void SplitVecRes_FFREXP(SDNode *
N,
unsigned ResNo, SDValue &
Lo, SDValue &
Hi);
914 void SplitVecRes_ExtendOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
915 void SplitVecRes_InregOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
916 void SplitVecRes_ExtVecInRegOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
917 void SplitVecRes_StrictFPOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
918 void SplitVecRes_OverflowOp(SDNode *
N,
unsigned ResNo,
919 SDValue &
Lo, SDValue &
Hi);
921 void SplitVecRes_FIX(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
923 void SplitVecRes_BITCAST(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
924 void SplitVecRes_BUILD_VECTOR(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
925 void SplitVecRes_CONCAT_VECTORS(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
926 void SplitVecRes_EXTRACT_SUBVECTOR(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
927 void SplitVecRes_INSERT_SUBVECTOR(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
928 void SplitVecRes_FPOp_MultiType(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
929 void SplitVecRes_IS_FPCLASS(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
930 void SplitVecRes_INSERT_VECTOR_ELT(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
931 void SplitVecRes_LOAD(LoadSDNode *LD, SDValue &
Lo, SDValue &
Hi);
932 void SplitVecRes_VP_LOAD(VPLoadSDNode *LD, SDValue &
Lo, SDValue &
Hi);
933 void SplitVecRes_VP_STRIDED_LOAD(VPStridedLoadSDNode *SLD, SDValue &
Lo,
935 void SplitVecRes_MLOAD(MaskedLoadSDNode *MLD, SDValue &
Lo, SDValue &
Hi);
936 void SplitVecRes_Gather(MemSDNode *VPGT, SDValue &
Lo, SDValue &
Hi,
937 bool SplitSETCC =
false);
938 void SplitVecRes_VECTOR_COMPRESS(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
939 void SplitVecRes_ScalarOp(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
940 void SplitVecRes_VP_SPLAT(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
941 void SplitVecRes_STEP_VECTOR(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
942 void SplitVecRes_SETCC(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
943 void SplitVecRes_VECTOR_REVERSE(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
944 void SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *
N, SDValue &
Lo,
946 void SplitVecRes_VECTOR_SPLICE(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
947 void SplitVecRes_VECTOR_DEINTERLEAVE(SDNode *
N);
948 void SplitVecRes_VECTOR_INTERLEAVE(SDNode *
N);
949 void SplitVecRes_VAARG(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
950 void SplitVecRes_FP_TO_XINT_SAT(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
951 void SplitVecRes_VP_REVERSE(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
954 bool SplitVectorOperand(SDNode *
N,
unsigned OpNo);
955 SDValue SplitVecOp_VSELECT(SDNode *
N,
unsigned OpNo);
956 SDValue SplitVecOp_VECREDUCE(SDNode *
N,
unsigned OpNo);
957 SDValue SplitVecOp_VECREDUCE_SEQ(SDNode *
N);
958 SDValue SplitVecOp_VP_REDUCE(SDNode *
N,
unsigned OpNo);
959 SDValue SplitVecOp_UnaryOp(SDNode *
N);
960 SDValue SplitVecOp_TruncateHelper(SDNode *
N);
962 SDValue SplitVecOp_BITCAST(SDNode *
N);
963 SDValue SplitVecOp_INSERT_SUBVECTOR(SDNode *
N,
unsigned OpNo);
964 SDValue SplitVecOp_EXTRACT_SUBVECTOR(SDNode *
N);
965 SDValue SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *
N);
966 SDValue SplitVecOp_ExtVecInRegOp(SDNode *
N);
967 SDValue SplitVecOp_STORE(StoreSDNode *
N,
unsigned OpNo);
968 SDValue SplitVecOp_VP_STORE(VPStoreSDNode *
N,
unsigned OpNo);
969 SDValue SplitVecOp_VP_STRIDED_STORE(VPStridedStoreSDNode *
N,
unsigned OpNo);
970 SDValue SplitVecOp_MSTORE(MaskedStoreSDNode *
N,
unsigned OpNo);
971 SDValue SplitVecOp_Scatter(MemSDNode *
N,
unsigned OpNo);
972 SDValue SplitVecOp_Gather(MemSDNode *MGT,
unsigned OpNo);
973 SDValue SplitVecOp_CONCAT_VECTORS(SDNode *
N);
974 SDValue SplitVecOp_VSETCC(SDNode *
N);
975 SDValue SplitVecOp_FP_ROUND(SDNode *
N);
976 SDValue SplitVecOp_FPOpDifferentTypes(SDNode *
N);
977 SDValue SplitVecOp_CMP(SDNode *
N);
978 SDValue SplitVecOp_FP_TO_XINT_SAT(SDNode *
N);
979 SDValue SplitVecOp_VP_CttzElements(SDNode *
N);
991 SDValue GetWidenedVector(SDValue Op) {
992 TableId &WidenedId = WidenedVectors[getTableId(Op)];
993 SDValue WidenedOp = getSDValue(WidenedId);
994 assert(WidenedOp.getNode() &&
"Operand wasn't widened?");
997 void SetWidenedVector(SDValue Op, SDValue Result);
1000 SDValue GetWidenedMask(SDValue Mask, ElementCount EC) {
1008 TargetLowering::TypeWidenVector &&
1009 "Unable to widen binary VP op");
1010 Mask = GetWidenedVector(Mask);
1011 assert(
Mask.getValueType().getVectorElementCount() == EC &&
1012 "Unable to widen binary VP op");
1017 void WidenVectorResult(SDNode *
N,
unsigned ResNo);
1018 SDValue WidenVecRes_MERGE_VALUES(SDNode*
N,
unsigned ResNo);
1019 SDValue WidenVecRes_ADDRSPACECAST(SDNode *
N);
1020 SDValue WidenVecRes_AssertZext(SDNode*
N);
1021 SDValue WidenVecRes_BITCAST(SDNode*
N);
1022 SDValue WidenVecRes_BUILD_VECTOR(SDNode*
N);
1023 SDValue WidenVecRes_CONCAT_VECTORS(SDNode*
N);
1024 SDValue WidenVecRes_EXTEND_VECTOR_INREG(SDNode*
N);
1025 SDValue WidenVecRes_EXTRACT_SUBVECTOR(SDNode*
N);
1026 SDValue WidenVecRes_INSERT_SUBVECTOR(SDNode *
N);
1027 SDValue WidenVecRes_INSERT_VECTOR_ELT(SDNode*
N);
1028 SDValue WidenVecRes_LOAD(SDNode*
N);
1029 SDValue WidenVecRes_VP_LOAD(VPLoadSDNode *
N);
1030 SDValue WidenVecRes_VP_STRIDED_LOAD(VPStridedLoadSDNode *
N);
1031 SDValue WidenVecRes_VECTOR_COMPRESS(SDNode *
N);
1032 SDValue WidenVecRes_MLOAD(MaskedLoadSDNode*
N);
1033 SDValue WidenVecRes_MGATHER(MaskedGatherSDNode*
N);
1034 SDValue WidenVecRes_VP_GATHER(VPGatherSDNode*
N);
1035 SDValue WidenVecRes_ScalarOp(SDNode*
N);
1036 SDValue WidenVecRes_Select(SDNode *
N);
1037 SDValue WidenVSELECTMask(SDNode *
N);
1038 SDValue WidenVecRes_SELECT_CC(SDNode*
N);
1039 SDValue WidenVecRes_SETCC(SDNode*
N);
1040 SDValue WidenVecRes_STRICT_FSETCC(SDNode*
N);
1041 SDValue WidenVecRes_UNDEF(SDNode *
N);
1042 SDValue WidenVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *
N);
1043 SDValue WidenVecRes_VECTOR_REVERSE(SDNode *
N);
1045 SDValue WidenVecRes_Ternary(SDNode *
N);
1046 SDValue WidenVecRes_Binary(SDNode *
N);
1047 SDValue WidenVecRes_CMP(SDNode *
N);
1048 SDValue WidenVecRes_BinaryCanTrap(SDNode *
N);
1049 SDValue WidenVecRes_BinaryWithExtraScalarOp(SDNode *
N);
1050 SDValue WidenVecRes_StrictFP(SDNode *
N);
1051 SDValue WidenVecRes_OverflowOp(SDNode *
N,
unsigned ResNo);
1052 SDValue WidenVecRes_Convert(SDNode *
N);
1053 SDValue WidenVecRes_Convert_StrictFP(SDNode *
N);
1054 SDValue WidenVecRes_FP_TO_XINT_SAT(SDNode *
N);
1055 SDValue WidenVecRes_XRINT(SDNode *
N);
1056 SDValue WidenVecRes_FCOPYSIGN(SDNode *
N);
1057 SDValue WidenVecRes_UnarySameEltsWithScalarArg(SDNode *
N);
1058 SDValue WidenVecRes_ExpOp(SDNode *
N);
1059 SDValue WidenVecRes_Unary(SDNode *
N);
1060 SDValue WidenVecRes_InregOp(SDNode *
N);
1063 bool WidenVectorOperand(SDNode *
N,
unsigned OpNo);
1064 SDValue WidenVecOp_BITCAST(SDNode *
N);
1065 SDValue WidenVecOp_CONCAT_VECTORS(SDNode *
N);
1066 SDValue WidenVecOp_EXTEND(SDNode *
N);
1067 SDValue WidenVecOp_CMP(SDNode *
N);
1068 SDValue WidenVecOp_EXTRACT_VECTOR_ELT(SDNode *
N);
1069 SDValue WidenVecOp_INSERT_SUBVECTOR(SDNode *
N);
1070 SDValue WidenVecOp_EXTRACT_SUBVECTOR(SDNode *
N);
1071 SDValue WidenVecOp_EXTEND_VECTOR_INREG(SDNode *
N);
1072 SDValue WidenVecOp_STORE(SDNode*
N);
1073 SDValue WidenVecOp_VP_STORE(SDNode *
N,
unsigned OpNo);
1074 SDValue WidenVecOp_VP_STRIDED_STORE(SDNode *
N,
unsigned OpNo);
1075 SDValue WidenVecOp_MSTORE(SDNode*
N,
unsigned OpNo);
1076 SDValue WidenVecOp_MGATHER(SDNode*
N,
unsigned OpNo);
1077 SDValue WidenVecOp_MSCATTER(SDNode*
N,
unsigned OpNo);
1078 SDValue WidenVecOp_VP_SCATTER(SDNode*
N,
unsigned OpNo);
1079 SDValue WidenVecOp_VP_SPLAT(SDNode *
N,
unsigned OpNo);
1080 SDValue WidenVecOp_SETCC(SDNode*
N);
1081 SDValue WidenVecOp_STRICT_FSETCC(SDNode*
N);
1082 SDValue WidenVecOp_VSELECT(SDNode *
N);
1084 SDValue WidenVecOp_Convert(SDNode *
N);
1085 SDValue WidenVecOp_FP_TO_XINT_SAT(SDNode *
N);
1086 SDValue WidenVecOp_UnrollVectorOp(SDNode *
N);
1087 SDValue WidenVecOp_IS_FPCLASS(SDNode *
N);
1088 SDValue WidenVecOp_VECREDUCE(SDNode *
N);
1089 SDValue WidenVecOp_VECREDUCE_SEQ(SDNode *
N);
1090 SDValue WidenVecOp_VP_REDUCE(SDNode *
N);
1091 SDValue WidenVecOp_ExpOp(SDNode *
N);
1092 SDValue WidenVecOp_VP_CttzElements(SDNode *
N);
1097 SDValue UnrollVectorOp_StrictFP(SDNode *
N,
unsigned ResNE);
1107 SDValue GenWidenVectorLoads(SmallVectorImpl<SDValue> &LdChain,
1115 SDValue GenWidenVectorExtLoads(SmallVectorImpl<SDValue> &LdChain,
1116 LoadSDNode *LD, ISD::LoadExtType ExtType);
1122 bool GenWidenVectorStores(SmallVectorImpl<SDValue> &StChain, StoreSDNode *ST);
1128 SDValue ModifyToType(SDValue InOp, EVT NVT,
bool FillWithZeroes =
false);
1132 SDValue convertMask(SDValue InMask, EVT MaskVT, EVT ToMaskVT);
1142 void GetSplitOp(SDValue Op, SDValue &
Lo, SDValue &
Hi) {
1143 if (
Op.getValueType().isVector())
1144 GetSplitVector(Op,
Lo,
Hi);
1145 else if (
Op.getValueType().isInteger())
1146 GetExpandedInteger(Op,
Lo,
Hi);
1148 GetExpandedFloat(Op,
Lo,
Hi);
1153 void GetPairElements(SDValue Pair, SDValue &
Lo, SDValue &
Hi);
1156 void SplitRes_MERGE_VALUES(SDNode *
N,
unsigned ResNo,
1157 SDValue &
Lo, SDValue &
Hi);
1158 void SplitVecRes_AssertZext (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1159 void SplitRes_ARITH_FENCE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1160 void SplitRes_Select (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1161 void SplitRes_SELECT_CC (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1162 void SplitRes_UNDEF (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1163 void SplitRes_FREEZE (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1174 void GetExpandedOp(SDValue Op, SDValue &
Lo, SDValue &
Hi) {
1175 if (
Op.getValueType().isInteger())
1176 GetExpandedInteger(Op,
Lo,
Hi);
1178 GetExpandedFloat(Op,
Lo,
Hi);
1184 void IntegerToVector(SDValue Op,
unsigned NumElements,
1185 SmallVectorImpl<SDValue> &Ops, EVT EltVT);
1188 void ExpandRes_MERGE_VALUES (SDNode *
N,
unsigned ResNo,
1189 SDValue &
Lo, SDValue &
Hi);
1190 void ExpandRes_BITCAST (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1191 void ExpandRes_BUILD_PAIR (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1192 void ExpandRes_EXTRACT_ELEMENT (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1193 void ExpandRes_EXTRACT_VECTOR_ELT(SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1194 void ExpandRes_NormalLoad (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1195 void ExpandRes_VAARG (SDNode *
N, SDValue &
Lo, SDValue &
Hi);
1198 SDValue ExpandOp_BITCAST (SDNode *
N);
1199 SDValue ExpandOp_BUILD_VECTOR (SDNode *
N);
1200 SDValue ExpandOp_EXTRACT_ELEMENT (SDNode *
N);
1201 SDValue ExpandOp_INSERT_VECTOR_ELT(SDNode *
N);
1202 SDValue ExpandOp_SCALAR_TO_VECTOR (SDNode *
N);
1203 SDValue ExpandOp_NormalStore (SDNode *
N,
unsigned OpNo);
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
BlockVerifier::State From
#define LLVM_LIBRARY_VISIBILITY
This file defines the DenseMap class.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file describes how to lower LLVM code to machine code.
support::ulittle16_t & Lo
support::ulittle16_t & Hi
This takes an arbitrary SelectionDAG as input and hacks on it until only value types the target machi...
DAGTypeLegalizer(SelectionDAG &dag)
void NoteDeletion(SDNode *Old, SDNode *New)
SelectionDAG & getDAG() const
NodeIdFlags
This pass uses the NodeId on the SDNodes to hold information about the state of the node.
This class represents an Operation in the Expression.
Represents one node in the SelectionDAG.
unsigned getNumValues() const
Return the number of values defined/returned by this operator.
Unlike LLVM values, Selection DAG nodes may return multiple values as the result of a computation.
SDNode * getNode() const
get the SDNode which holds the desired result
This is used to represent a portion of an LLVM function in a low-level Data Dependence DAG representa...
SDValue getVPZeroExtendInReg(SDValue Op, SDValue Mask, SDValue EVL, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value.
SDValue getShiftAmountConstant(uint64_t Val, EVT VT, const SDLoc &DL)
SDValue getZeroExtendInReg(SDValue Op, const SDLoc &DL, EVT VT)
Return the expression required to zero extend the Op value assuming it was the smaller SrcTy value.
const DataLayout & getDataLayout() const
SDValue getValueType(EVT)
SDValue getNode(unsigned Opcode, const SDLoc &DL, EVT VT, ArrayRef< SDUse > Ops)
Gets or creates the specified node.
LLVMContext * getContext() const
LegalizeTypeAction getTypeAction(MVT VT) const
LegalizeTypeAction
This enum indicates whether a types are legal for a target, and if not, what action should be used to...
This class defines information used to lower LLVM code to legal SelectionDAG operators that the targe...
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.
This is an optimization pass for GlobalISel generic memory operations.