LLVM 24.0.0git
HexagonMCInstrInfo.cpp
Go to the documentation of this file.
1//===- HexagonMCInstrInfo.cpp - Hexagon sub-class of MCInst ---------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This class extends MCInstrInfo to allow Hexagon specific MCInstr queries
10//
11//===----------------------------------------------------------------------===//
12
21#include "llvm/MC/MCContext.h"
22#include "llvm/MC/MCExpr.h"
23#include "llvm/MC/MCInst.h"
24#include "llvm/MC/MCInstrInfo.h"
29#include <cassert>
30#include <cstdint>
31#include <limits>
32
33using namespace llvm;
34
36 return Register != Hexagon::NoRegister;
37}
38
40 MCInst const &Inst)
41 : MCII(MCII), BundleCurrent(Inst.begin() +
43 BundleEnd(Inst.end()), DuplexCurrent(Inst.end()), DuplexEnd(Inst.end()) {}
44
46 MCInst const &Inst, std::nullptr_t)
47 : MCII(MCII), BundleCurrent(Inst.end()), BundleEnd(Inst.end()),
48 DuplexCurrent(Inst.end()), DuplexEnd(Inst.end()) {}
49
51 if (DuplexCurrent != DuplexEnd) {
52 ++DuplexCurrent;
53 if (DuplexCurrent == DuplexEnd) {
54 DuplexCurrent = BundleEnd;
55 DuplexEnd = BundleEnd;
56 ++BundleCurrent;
57 }
58 return *this;
59 }
60 ++BundleCurrent;
61 if (BundleCurrent != BundleEnd) {
62 MCInst const &Inst = *BundleCurrent->getInst();
63 if (HexagonMCInstrInfo::isDuplex(MCII, Inst)) {
64 DuplexCurrent = Inst.begin();
65 DuplexEnd = Inst.end();
66 }
67 }
68 return *this;
69}
70
72 if (DuplexCurrent != DuplexEnd)
73 return *DuplexCurrent->getInst();
74 return *BundleCurrent->getInst();
75}
76
78 return BundleCurrent == Other.BundleCurrent && BundleEnd == Other.BundleEnd &&
79 DuplexCurrent == Other.DuplexCurrent && DuplexEnd == Other.DuplexEnd;
80}
81
83 MCContext &Context) {
85}
86
88 MCInstrInfo const &MCII, MCInst &MCB,
89 MCInst const &MCI) {
91 MCOperand const &exOp =
93
94 // Create the extender.
95 MCInst *XMCI =
96 new (Context) MCInst(HexagonMCInstrInfo::deriveExtender(MCII, MCI, exOp));
97 XMCI->setLoc(MCI.getLoc());
98
100}
101
104 MCInst const &MCI) {
105 assert(isBundle(MCI));
106 return make_range(Hexagon::PacketIterator(MCII, MCI),
107 Hexagon::PacketIterator(MCII, MCI, nullptr));
108}
109
115
118 return (MCI.size() - bundleInstructionsOffset);
119 else
120 return (1);
121}
122
123namespace {
124bool canonicalizePacketImpl(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
125 MCContext &Context, MCInst &MCB,
127 // Check the bundle for errors.
128 bool CheckOk = Check ? Check->check(false) : true;
129 if (!CheckOk)
130 return false;
131
132 // Examine the packet and convert pairs of instructions to compound
133 // instructions when possible.
135 HexagonMCInstrInfo::tryCompound(MCII, STI, Context, MCB);
136 HexagonMCShuffle(Context, false, MCII, STI, MCB);
137
138 const SmallVector<DuplexCandidate, 8> possibleDuplexes =
139 (STI.hasFeature(Hexagon::FeatureDuplex))
142
143 // Examine the packet and convert pairs of instructions to duplex
144 // instructions when possible.
145 HexagonMCShuffle(Context, MCII, STI, MCB, possibleDuplexes);
146
147 // Examines packet and pad the packet, if needed, when an
148 // end-loop is in the bundle.
149 HexagonMCInstrInfo::padEndloop(MCB, Context);
150
151 // If compounding and duplexing didn't reduce the size below
152 // 4 or less we have a packet that is too big.
154 if (Check)
155 Check->reportError("invalid instruction packet: out of slots");
156 return false;
157 }
158 // Check the bundle for errors.
159 CheckOk = Check ? Check->check(true) : true;
160 if (!CheckOk)
161 return false;
162
163 HexagonMCShuffle(Context, true, MCII, STI, MCB);
164
165 return true;
166}
167} // namespace
168
170 MCSubtargetInfo const &STI,
171 MCContext &Context, MCInst &MCB,
173 bool AttemptCompatibility) {
174 auto ArchSTI = Hexagon_MC::getArchSubtarget(&STI);
175 if (!AttemptCompatibility || ArchSTI == nullptr)
176 return canonicalizePacketImpl(MCII, STI, Context, MCB, Check);
177
178 const MCRegisterInfo *RI = Context.getRegisterInfo();
179 HexagonMCChecker DefaultCheck(Context, MCII, STI, MCB, *RI, false);
180 HexagonMCChecker *BaseCheck = (Check == nullptr) ? &DefaultCheck : Check;
181 HexagonMCChecker PerfCheck(*BaseCheck, STI, false);
182 if (canonicalizePacketImpl(MCII, STI, Context, MCB, &PerfCheck))
183 return true;
184
185 HexagonMCChecker ArchCheck(*BaseCheck, *ArchSTI, true);
186 return canonicalizePacketImpl(MCII, *ArchSTI, Context, MCB, &ArchCheck);
187}
188
190 MCInst const &Inst,
191 MCOperand const &MO) {
194
195 MCInst XMI;
196 XMI.setOpcode(Hexagon::A4_ext);
197 if (MO.isImm())
198 XMI.addOperand(MCOperand::createImm(MO.getImm() & (~0x3f)));
199 else if (MO.isExpr())
201 else
202 llvm_unreachable("invalid extendable operand");
203 return XMI;
204}
205
207 MCInst const &inst0,
208 MCInst const &inst1) {
209 assert((iClass <= 0xf) && "iClass must have range of 0 to 0xf");
210 MCInst *duplexInst = new (Context) MCInst;
211 duplexInst->setOpcode(Hexagon::DuplexIClass0 + iClass);
212
213 MCInst *SubInst0 = new (Context) MCInst(deriveSubInst(inst0));
214 MCInst *SubInst1 = new (Context) MCInst(deriveSubInst(inst1));
215 duplexInst->addOperand(MCOperand::createInst(SubInst0));
216 duplexInst->addOperand(MCOperand::createInst(SubInst1));
217 return duplexInst;
218}
219
221 size_t Index) {
222 assert(Index <= bundleSize(MCB));
223 if (Index == 0)
224 return nullptr;
225 MCInst const *Inst =
227 if (isImmext(*Inst))
228 return Inst;
229 return nullptr;
230}
231
233 MCInstrInfo const &MCII, MCInst &MCB,
234 MCInst const &MCI) {
235 if (isConstExtended(MCII, MCI))
236 addConstExtender(Context, MCII, MCB, MCI);
237}
238
245
247 MCInst const &MCI) {
248 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
249 return static_cast<unsigned>((F >> HexagonII::AddrModePos) &
251}
252
254 MCInst const &MCI) {
255 return MCII.get(MCI.getOpcode());
256}
257
259 using namespace Hexagon;
260
261 switch (Reg.id()) {
262 default:
263 llvm_unreachable("unknown duplex register");
264 // Rs Rss
265 case R0:
266 case D0:
267 return 0;
268 case R1:
269 case D1:
270 return 1;
271 case R2:
272 case D2:
273 return 2;
274 case R3:
275 case D3:
276 return 3;
277 case R4:
278 case D8:
279 return 4;
280 case R5:
281 case D9:
282 return 5;
283 case R6:
284 case D10:
285 return 6;
286 case R7:
287 case D11:
288 return 7;
289 case R16:
290 return 8;
291 case R17:
292 return 9;
293 case R18:
294 return 10;
295 case R19:
296 return 11;
297 case R20:
298 return 12;
299 case R21:
300 return 13;
301 case R22:
302 return 14;
303 case R23:
304 return 15;
305 }
306}
307
309 const auto &HExpr = cast<HexagonMCExpr>(Expr);
310 assert(HExpr.getExpr());
311 return *HExpr.getExpr();
312}
313
315 MCInst const &MCI) {
316 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
318}
319
320MCOperand const &
322 MCInst const &MCI) {
323 unsigned O = HexagonMCInstrInfo::getExtendableOp(MCII, MCI);
324 MCOperand const &MO = MCI.getOperand(O);
325
327 HexagonMCInstrInfo::isExtended(MCII, MCI)) &&
328 (MO.isImm() || MO.isExpr()));
329 return (MO);
330}
331
333 MCInst const &MCI) {
334 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
336}
337
339 MCInst const &MCI) {
340 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
342}
343
345 MCInst const &MCI) {
346 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
348}
349
350/// Return the maximum value of an extendable operand.
352 MCInst const &MCI) {
355
356 if (HexagonMCInstrInfo::isExtentSigned(MCII, MCI)) // if value is signed
357 return (1 << (HexagonMCInstrInfo::getExtentBits(MCII, MCI) - 1)) - 1;
358 return (1 << HexagonMCInstrInfo::getExtentBits(MCII, MCI)) - 1;
359}
360
361/// Return the minimum value of an extendable operand.
363 MCInst const &MCI) {
366
367 if (HexagonMCInstrInfo::isExtentSigned(MCII, MCI)) // if value is signed
368 return -(1 << (HexagonMCInstrInfo::getExtentBits(MCII, MCI) - 1));
369 return 0;
370}
371
373 MCInst const &MCI) {
374 return MCII.getName(MCI.getOpcode());
375}
376
378 MCInst const &MCI) {
379 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
381}
382
384 MCInst const &MCI) {
385 if (HexagonMCInstrInfo::hasTmpDst(MCII, MCI)) {
386 // VTMP doesn't actually exist in the encodings for these 184
387 // 3 instructions so go ahead and create it here.
388 static MCOperand MCO = MCOperand::createReg(Hexagon::VTMP);
389 return (MCO);
390 } else {
391 unsigned O = HexagonMCInstrInfo::getNewValueOp(MCII, MCI);
392 MCOperand const &MCO = MCI.getOperand(O);
393
396 MCO.isReg());
397 return (MCO);
398 }
399}
400
401/// Return the new value or the newly produced value.
403 MCInst const &MCI) {
404 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
406}
407
408MCOperand const &
410 MCInst const &MCI) {
411 unsigned O = HexagonMCInstrInfo::getNewValueOp2(MCII, MCI);
412 MCOperand const &MCO = MCI.getOperand(O);
413
416 MCO.isReg());
417 return (MCO);
418}
419
420/// Return the Hexagon ISA class for the insn.
422 MCInst const &MCI) {
423 const uint64_t F = MCII.get(MCI.getOpcode()).TSFlags;
425}
426
427/// Return the resources used by this instruction
429 MCSubtargetInfo const &STI,
430 MCInst const &MCI) {
431
433 int SchedClass = HexagonMCInstrInfo::getDesc(MCII, MCI).getSchedClass();
434 int Size = II[SchedClass].LastStage - II[SchedClass].FirstStage;
435
436 // HVX resources used are currently located at the second to last stage.
437 // This could also be done with a linear search of the stages looking for:
438 // CVI_ALL, CVI_MPY01, CVI_XLSHF, CVI_MPY0, CVI_MPY1, CVI_SHIFT, CVI_XLANE,
439 // CVI_ZW
440 unsigned Stage = II[SchedClass].LastStage - 1;
441
442 if (Size < 2)
443 return 0;
444 return ((Stage + HexagonStages)->getUnits());
445}
446
447/// Return the slots this instruction can execute out of
449 MCSubtargetInfo const &STI,
450 MCInst const &MCI) {
452 int SchedClass = HexagonMCInstrInfo::getDesc(MCII, MCI).getSchedClass();
453 return ((II[SchedClass].FirstStage + HexagonStages)->getUnits());
454}
455
456/// Return the slots this instruction consumes in addition to
457/// the slot(s) it can execute out of
458
460 MCSubtargetInfo const &STI,
461 MCInst const &MCI) {
463 int SchedClass = HexagonMCInstrInfo::getDesc(MCII, MCI).getSchedClass();
464 unsigned Slots = 0;
465
466 // FirstStage are slots that this instruction can execute in.
467 // FirstStage+1 are slots that are also consumed by this instruction.
468 // For example: vmemu can only execute in slot 0 but also consumes slot 1.
469 for (unsigned Stage = II[SchedClass].FirstStage + 1;
470 Stage < II[SchedClass].LastStage; ++Stage) {
471 unsigned Units = (Stage + HexagonStages)->getUnits();
472 if (Units > HexagonGetLastSlot())
473 break;
474 // fyi: getUnits() will return 0x1, 0x2, 0x4 or 0x8
475 Slots |= Units;
476 }
477
478 // if 0 is returned, then no additional slots are consumed by this inst.
479 return Slots;
480}
481
482bool HexagonMCInstrInfo::hasDuplex(MCInstrInfo const &MCII, MCInst const &MCI) {
484 return false;
485
486 for (auto const &I : HexagonMCInstrInfo::bundleInstructions(MCI)) {
487 if (HexagonMCInstrInfo::isDuplex(MCII, *I.getInst()))
488 return true;
489 }
490
491 return false;
492}
493
494bool HexagonMCInstrInfo::hasExtenderForIndex(MCInst const &MCB, size_t Index) {
495 return extenderForIndex(MCB, Index) != nullptr;
496}
497
500 return false;
501
502 for (const auto &I : HexagonMCInstrInfo::bundleInstructions(MCI)) {
503 if (isImmext(*I.getInst()))
504 return true;
505 }
506
507 return false;
508}
509
510/// Return whether the insn produces a value.
512 MCInst const &MCI) {
513 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
515}
516
517/// Return whether the insn produces a second value.
519 MCInst const &MCI) {
520 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
522}
523
524MCInst const &HexagonMCInstrInfo::instruction(MCInst const &MCB, size_t Index) {
525 assert(isBundle(MCB));
527 return *MCB.getOperand(bundleInstructionsOffset + Index).getInst();
528}
529
530/// Return where the instruction is an accumulator.
532 MCInst const &MCI) {
533 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
535}
536
538 auto Result = Hexagon::BUNDLE == MCI.getOpcode();
539 assert(!Result || (MCI.size() > 0 && MCI.getOperand(0).isImm()));
540 return Result;
541}
542
544 MCInst const &MCI) {
545 if (HexagonMCInstrInfo::isExtended(MCII, MCI))
546 return true;
547 if (!HexagonMCInstrInfo::isExtendable(MCII, MCI))
548 return false;
550 if (isa<HexagonMCExpr>(MO.getExpr()) &&
552 return true;
553 // Branch insns are handled as necessary by relaxation.
554 if ((HexagonMCInstrInfo::getType(MCII, MCI) == HexagonII::TypeJ) ||
559 return false;
560 // Otherwise loop instructions and other CR insts are handled by relaxation
561 else if ((HexagonMCInstrInfo::getType(MCII, MCI) == HexagonII::TypeCR) &&
562 (MCI.getOpcode() != Hexagon::C4_addipc))
563 return false;
564
565 assert(!MO.isImm());
566 if (isa<HexagonMCExpr>(MO.getExpr()) &&
568 return false;
569
570 int64_t Value;
571 if (!MO.getExpr()->evaluateAsAbsolute(Value))
572 return true;
573 if (HexagonMCInstrInfo::isExtentSigned(MCII, MCI)) {
574 int32_t SValue = Value;
575 int32_t MinValue = HexagonMCInstrInfo::getMinValue(MCII, MCI);
576 int32_t MaxValue = HexagonMCInstrInfo::getMaxValue(MCII, MCI);
577 return SValue < MinValue || SValue > MaxValue;
578 }
579 uint32_t UValue = Value;
580 uint32_t MinValue = HexagonMCInstrInfo::getMinValue(MCII, MCI);
581 uint32_t MaxValue = HexagonMCInstrInfo::getMaxValue(MCII, MCI);
582 return UValue < MinValue || UValue > MaxValue;
583}
584
585bool HexagonMCInstrInfo::isCanon(MCInstrInfo const &MCII, MCInst const &MCI) {
586 return !HexagonMCInstrInfo::getDesc(MCII, MCI).isPseudo() &&
588}
589
590bool HexagonMCInstrInfo::isCofMax1(MCInstrInfo const &MCII, MCInst const &MCI) {
591 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
593}
594
596 MCInst const &MCI) {
597 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
599}
600
602 MCInst const &MCI) {
603 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
605}
606
608 MCInst const &MCI) {
609 return (getType(MCII, MCI) == HexagonII::TypeCJ);
610}
611
612bool HexagonMCInstrInfo::isCVINew(MCInstrInfo const &MCII, MCInst const &MCI) {
613 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
615}
616
618 MCInst const &MCI) {
619 const auto &MID = HexagonMCInstrInfo::getDesc(MCII, MCI);
621}
622
624 MCInst const &MCI) {
625 const auto &MID = HexagonMCInstrInfo::getDesc(MCII, MCI);
627}
628
630 return ((Reg >= Hexagon::D0 && Reg <= Hexagon::D3) ||
631 (Reg >= Hexagon::D8 && Reg <= Hexagon::D11));
632}
633
634bool HexagonMCInstrInfo::isDuplex(MCInstrInfo const &MCII, MCInst const &MCI) {
636}
637
639 MCInst const &MCI) {
640 uint64_t const F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
642}
643
645 MCInst const &MCI) {
646 uint64_t const F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
648}
649
650bool HexagonMCInstrInfo::isFloat(MCInstrInfo const &MCII, MCInst const &MCI) {
651 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
652 return ((F >> HexagonII::FPPos) & HexagonII::FPMask);
653}
654
655bool HexagonMCInstrInfo::isHVX(MCInstrInfo const &MCII, MCInst const &MCI) {
656 const uint64_t V = getType(MCII, MCI);
658}
659
660bool HexagonMCInstrInfo::isHLX(MCInstrInfo const &MCII, MCInst const &MCI) {
661 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
663}
664
666 return MCI.getOpcode() == Hexagon::A4_ext;
667}
668
670 assert(isBundle(MCI));
671 int64_t Flags = MCI.getOperand(0).getImm();
672 return (Flags & innerLoopMask) != 0;
673}
674
676 return (Reg >= Hexagon::R0 && Reg <= Hexagon::R31);
677}
678
680 return ((Reg >= Hexagon::R0 && Reg <= Hexagon::R7) ||
681 (Reg >= Hexagon::R16 && Reg <= Hexagon::R23));
682}
683
684/// Return whether the insn expects newly produced value.
686 MCInst const &MCI) {
687 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
689}
690
692 MCInst const &MCI) {
693 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
695}
696
697/// Return whether the operand is extendable.
699 MCInst const &MCI, unsigned short O) {
700 return (O == HexagonMCInstrInfo::getExtendableOp(MCII, MCI));
701}
702
704 assert(isBundle(MCI));
705 int64_t Flags = MCI.getOperand(0).getImm();
706 return (Flags & outerLoopMask) != 0;
707}
708
710 return (VecReg >= Hexagon::W0 && VecReg <= Hexagon::W15) ||
711 (VecReg >= Hexagon::WR0 && VecReg <= Hexagon::WR15);
712}
713
715 return (VecReg >= Hexagon::WR0 && VecReg <= Hexagon::WR15);
716}
717
719 return (VecReg >= Hexagon::V0 && VecReg <= Hexagon::V31);
720}
721
722std::pair<unsigned, unsigned>
724 assert(IsVecRegPair(VecRegPair) &&
725 "VecRegPair must be a vector register pair");
726
727 const bool IsRev = IsReverseVecRegPair(VecRegPair);
728 const unsigned PairIndex =
729 2 * (IsRev ? VecRegPair - Hexagon::WR0 : VecRegPair - Hexagon::W0);
730
731 return IsRev ? std::make_pair(PairIndex, PairIndex + 1)
732 : std::make_pair(PairIndex + 1, PairIndex);
733}
734
736 MCRegister Consumer) {
737 if (IsVecRegPair(Producer) && IsVecRegSingle(Consumer)) {
738 const unsigned ProdPairIndex = IsReverseVecRegPair(Producer)
739 ? Producer - Hexagon::WR0
740 : Producer - Hexagon::W0;
741 const unsigned ConsumerSingleIndex = (Consumer - Hexagon::V0) >> 1;
742
743 return ConsumerSingleIndex == ProdPairIndex;
744 }
745 return false;
746}
747
749 MCInst const &MCI) {
750 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
752}
753
754bool HexagonMCInstrInfo::isPrefix(MCInstrInfo const &MCII, MCInst const &MCI) {
756}
757
759 MCInst const &MCI) {
760 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
762}
763
764/// Return whether the insn is newly predicated.
766 MCInst const &MCI) {
767 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
769}
770
772 MCInst const &MCI) {
773 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
774 return (
776}
777
779 auto &PredRegClass = MRI.getRegClass(Hexagon::PredRegsRegClassID);
780 return PredRegClass.contains(Reg);
781}
782
784 MCInst const &Inst, unsigned I) {
785 MCInstrDesc const &Desc = HexagonMCInstrInfo::getDesc(MCII, Inst);
786
787 return Inst.getOperand(I).isReg() &&
788 Desc.operands()[I].RegClass == Hexagon::PredRegsRegClassID;
789}
790
791/// Return whether the insn can be packaged only with A and X-type insns.
792bool HexagonMCInstrInfo::isSoloAX(MCInstrInfo const &MCII, MCInst const &MCI) {
793 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
795}
796
797/// Return whether the insn can be packaged only with an A-type insn in slot #1.
799 MCInst const &MCI) {
800 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
801 return ((F >> HexagonII::RestrictSlot1AOKPos) &
803}
804
811
812/// Return whether the insn is solo, i.e., cannot be in a packet.
813bool HexagonMCInstrInfo::isSolo(MCInstrInfo const &MCII, MCInst const &MCI) {
814 const uint64_t F = MCII.get(MCI.getOpcode()).TSFlags;
816}
817
819 assert(isBundle(MCI));
820 auto Flags = MCI.getOperand(0).getImm();
821 return (Flags & memReorderDisabledMask) != 0;
822}
823
825 switch (MCI.getOpcode()) {
826 default:
827 return false;
828 case Hexagon::SA1_addi:
829 case Hexagon::SA1_addrx:
830 case Hexagon::SA1_addsp:
831 case Hexagon::SA1_and1:
832 case Hexagon::SA1_clrf:
833 case Hexagon::SA1_clrfnew:
834 case Hexagon::SA1_clrt:
835 case Hexagon::SA1_clrtnew:
836 case Hexagon::SA1_cmpeqi:
837 case Hexagon::SA1_combine0i:
838 case Hexagon::SA1_combine1i:
839 case Hexagon::SA1_combine2i:
840 case Hexagon::SA1_combine3i:
841 case Hexagon::SA1_combinerz:
842 case Hexagon::SA1_combinezr:
843 case Hexagon::SA1_dec:
844 case Hexagon::SA1_inc:
845 case Hexagon::SA1_seti:
846 case Hexagon::SA1_setin1:
847 case Hexagon::SA1_sxtb:
848 case Hexagon::SA1_sxth:
849 case Hexagon::SA1_tfr:
850 case Hexagon::SA1_zxtb:
851 case Hexagon::SA1_zxth:
852 case Hexagon::SL1_loadri_io:
853 case Hexagon::SL1_loadrub_io:
854 case Hexagon::SL2_deallocframe:
855 case Hexagon::SL2_jumpr31:
856 case Hexagon::SL2_jumpr31_f:
857 case Hexagon::SL2_jumpr31_fnew:
858 case Hexagon::SL2_jumpr31_t:
859 case Hexagon::SL2_jumpr31_tnew:
860 case Hexagon::SL2_loadrb_io:
861 case Hexagon::SL2_loadrd_sp:
862 case Hexagon::SL2_loadrh_io:
863 case Hexagon::SL2_loadri_sp:
864 case Hexagon::SL2_loadruh_io:
865 case Hexagon::SL2_return:
866 case Hexagon::SL2_return_f:
867 case Hexagon::SL2_return_fnew:
868 case Hexagon::SL2_return_t:
869 case Hexagon::SL2_return_tnew:
870 case Hexagon::SS1_storeb_io:
871 case Hexagon::SS1_storew_io:
872 case Hexagon::SS2_allocframe:
873 case Hexagon::SS2_storebi0:
874 case Hexagon::SS2_storebi1:
875 case Hexagon::SS2_stored_sp:
876 case Hexagon::SS2_storeh_io:
877 case Hexagon::SS2_storew_sp:
878 case Hexagon::SS2_storewi0:
879 case Hexagon::SS2_storewi1:
880 return true;
881 }
882}
883
884bool HexagonMCInstrInfo::isVector(MCInstrInfo const &MCII, MCInst const &MCI) {
885 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
887}
888
889int64_t HexagonMCInstrInfo::minConstant(MCInst const &MCI, size_t Index) {
890 auto Sentinel = static_cast<int64_t>(std::numeric_limits<uint32_t>::max())
891 << 8;
892 if (MCI.size() <= Index)
893 return Sentinel;
894 MCOperand const &MCO = MCI.getOperand(Index);
895 if (!MCO.isExpr())
896 return Sentinel;
897 int64_t Value;
898 if (!MCO.getExpr()->evaluateAsAbsolute(Value))
899 return Sentinel;
900 return Value;
901}
902
903void HexagonMCInstrInfo::setMustExtend(MCExpr const &Expr, bool Val) {
904 HexagonMCExpr &HExpr = const_cast<HexagonMCExpr &>(cast<HexagonMCExpr>(Expr));
905 HExpr.setMustExtend(Val);
906}
907
909 HexagonMCExpr const &HExpr = cast<HexagonMCExpr>(Expr);
910 return HExpr.mustExtend();
911}
912void HexagonMCInstrInfo::setMustNotExtend(MCExpr const &Expr, bool Val) {
913 HexagonMCExpr &HExpr = const_cast<HexagonMCExpr &>(cast<HexagonMCExpr>(Expr));
914 HExpr.setMustNotExtend(Val);
915}
917 HexagonMCExpr const &HExpr = cast<HexagonMCExpr>(Expr);
918 return HExpr.mustNotExtend();
919}
920void HexagonMCInstrInfo::setS27_2_reloc(MCExpr const &Expr, bool Val) {
921 HexagonMCExpr &HExpr =
922 const_cast<HexagonMCExpr &>(*cast<HexagonMCExpr>(&Expr));
923 HExpr.setS27_2_reloc(Val);
924}
926 HexagonMCExpr const *HExpr = dyn_cast<HexagonMCExpr>(&Expr);
927 if (!HExpr)
928 return false;
929 return HExpr->s27_2_reloc();
930}
931
933 const bool IsTiny = STI.hasFeature(Hexagon::ProcTinyCore);
934
935 return IsTiny ? (HEXAGON_PACKET_SIZE - 1) : HEXAGON_PACKET_SIZE;
936}
937
940 .Case("hexagonv67t", 3)
941 .Default(4);
942}
943
945 MCInst Nop;
946 Nop.setOpcode(Hexagon::A2_nop);
947 assert(isBundle(MCB));
948 while (LoopNeedsPadding(MCB))
949 MCB.addOperand(MCOperand::createInst(new (Context) MCInst(Nop)));
950}
951
954 if (!isPredicated(MCII, MCI))
955 return {0, 0, false};
956 MCInstrDesc const &Desc = getDesc(MCII, MCI);
957 for (auto I = Desc.getNumDefs(), N = Desc.getNumOperands(); I != N; ++I)
958 if (Desc.operands()[I].RegClass == Hexagon::PredRegsRegClassID)
959 return {MCI.getOperand(I).getReg(), I, isPredicatedTrue(MCII, MCI)};
960 return {0, 0, false};
961}
962
964 MCInst const &MCI) {
965 const uint64_t F = HexagonMCInstrInfo::getDesc(MCII, MCI).TSFlags;
967}
968
969bool HexagonMCInstrInfo::hasTmpDst(MCInstrInfo const &MCII, MCInst const &MCI) {
970 switch (MCI.getOpcode()) {
971 default:
972 return false;
973 case Hexagon::V6_vgathermh:
974 case Hexagon::V6_vgathermhq:
975 case Hexagon::V6_vgathermhw:
976 case Hexagon::V6_vgathermhwq:
977 case Hexagon::V6_vgathermw:
978 case Hexagon::V6_vgathermwq:
979 return true;
980 }
981 return false;
982}
983
985 MCInst const &MCI) {
986 const auto &MID = HexagonMCInstrInfo::getDesc(MCII, MCI);
988}
989
991 MCInst const &MCI) {
992 const unsigned OpCode = MCI.getOpcode();
993 const bool IsTiny = STI.getFeatureBits() [Hexagon::ProcTinyCore];
994 const bool NoSlotReqd = Hexagon::A4_ext == OpCode ||
995 (IsTiny && Hexagon::A2_nop == OpCode) ||
996 (IsTiny && Hexagon::J4_hintjumpr == OpCode);
997
998 return !NoSlotReqd;
999}
1000
1002 MCSubtargetInfo const &STI,
1003 MCInst const &MCI) {
1004 unsigned slotsUsed = 0;
1005 for (auto HMI : bundleInstructions(MCI)) {
1006 MCInst const &MCI = *HMI.getInst();
1007 if (!requiresSlot(STI, MCI))
1008 continue;
1009 if (isDuplex(MCII, MCI))
1010 slotsUsed += 2;
1011 else
1012 ++slotsUsed;
1013 }
1014 return slotsUsed;
1015}
1016
1018 DuplexCandidate Candidate) {
1019 assert(Candidate.packetIndexI < MCB.size());
1020 assert(Candidate.packetIndexJ < MCB.size());
1021 assert(isBundle(MCB));
1022 MCInst *Duplex =
1023 deriveDuplex(Context, Candidate.iClass,
1024 *MCB.getOperand(Candidate.packetIndexJ).getInst(),
1025 *MCB.getOperand(Candidate.packetIndexI).getInst());
1026 assert(Duplex != nullptr);
1027 MCB.getOperand(Candidate.packetIndexI).setInst(Duplex);
1028 MCB.erase(MCB.begin() + Candidate.packetIndexJ);
1029}
1030
1032 assert(isBundle(MCI));
1033 MCOperand &Operand = MCI.getOperand(0);
1034 Operand.setImm(Operand.getImm() | innerLoopMask);
1035}
1036
1038 assert(isBundle(MCI));
1039 MCOperand &Operand = MCI.getOperand(0);
1040 Operand.setImm(Operand.getImm() | memReorderDisabledMask);
1042}
1043
1045 assert(isBundle(MCI));
1046 MCOperand &Operand = MCI.getOperand(0);
1047 Operand.setImm(Operand.getImm() | outerLoopMask);
1048}
1049
1051 MCRegister Producer,
1052 MCRegister Producer2) {
1053 // If we're a single vector consumer of a double producer, set subreg bit
1054 // based on if we're accessing the lower or upper register component
1055 if (IsVecRegPair(Producer) && IsVecRegSingle(Consumer)) {
1056 unsigned Rev = IsReverseVecRegPair(Producer);
1057 return ((Consumer - Hexagon::V0) & 0x1) ^ Rev;
1058 }
1059 if (Producer2 != Hexagon::NoRegister)
1060 return Consumer == Producer;
1061 return 0;
1062}
1063
1065 MCInst const &MCI) {
1066 const auto &MID = HexagonMCInstrInfo::getDesc(MCII, MCI);
1068}
1069
1071 MCInst const &MCI) {
1072 const auto &MID = HexagonMCInstrInfo::getDesc(MCII, MCI);
1074}
1075
1083
1085 MCSubtargetInfo const &STI,
1086 MCInst const &I) {
1089 return (Desc.isBranch() || Desc.isCall() || Desc.isReturn());
1090}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define Check(C,...)
#define HEXAGON_PACKET_OUTER_SIZE
#define HEXAGON_PACKET_INNER_SIZE
#define HEXAGON_PACKET_SIZE
#define HEXAGON_PRESHUFFLE_PACKET_SIZE
IRTranslator LLVM IR MI
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
#define R4(n)
#define R2(n)
#define R6(n)
uint64_t IntrinsicInst * II
static bool isBranch(unsigned Opcode)
MachineRegisterInfo & MRI
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static SymbolRef::Type getType(const Symbol *Sym)
Definition TapiFile.cpp:39
Check for a valid bundle.
void setMustNotExtend(bool Val=true)
bool mustNotExtend() const
bool mustExtend() const
bool s27_2_reloc() const
void setMustExtend(bool Val=true)
void setS27_2_reloc(bool Val=true)
bool operator==(PacketIterator const &Other) const
PacketIterator(MCInstrInfo const &MCII, MCInst const &Inst)
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition MCExpr.cpp:212
Context object for machine code objects.
Definition MCContext.h:84
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
void erase(iterator I)
Definition MCInst.h:224
SMLoc getLoc() const
Definition MCInst.h:208
void setLoc(SMLoc loc)
Definition MCInst.h:207
unsigned getOpcode() const
Definition MCInst.h:202
void addOperand(const MCOperand Op)
Definition MCInst.h:215
iterator begin()
Definition MCInst.h:227
iterator end()
Definition MCInst.h:229
size_t size() const
Definition MCInst.h:226
void setOpcode(unsigned Op)
Definition MCInst.h:201
const MCOperand & getOperand(unsigned i) const
Definition MCInst.h:210
Describe properties that are true of each instruction in the target description file.
unsigned getSchedClass() const
Return the scheduling class for this instruction.
bool isPseudo() const
Return true if this is a pseudo instruction that doesn't correspond to a real machine instruction.
Interface to description of machine instruction set.
Definition MCInstrInfo.h:27
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode.
Definition MCInstrInfo.h:89
StringRef getName(unsigned Opcode) const
Returns the name for the instructions with the given opcode.
Definition MCInstrInfo.h:96
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:40
void setImm(int64_t Val)
Definition MCInst.h:89
static MCOperand createExpr(const MCExpr *Val)
Definition MCInst.h:166
int64_t getImm() const
Definition MCInst.h:84
static MCOperand createReg(MCRegister Reg)
Definition MCInst.h:138
static MCOperand createImm(int64_t Val)
Definition MCInst.h:145
bool isImm() const
Definition MCInst.h:66
bool isReg() const
Definition MCInst.h:65
void setInst(const MCInst *Val)
Definition MCInst.h:133
MCRegister getReg() const
Returns the register number.
Definition MCInst.h:73
const MCInst * getInst() const
Definition MCInst.h:128
const MCExpr * getExpr() const
Definition MCInst.h:118
bool isExpr() const
Definition MCInst.h:69
static MCOperand createInst(const MCInst *Val)
Definition MCInst.h:173
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const FeatureBitset & getFeatureBits() const
const MCSchedModel & getSchedModel() const
Get the machine model for this subtarget's CPU.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
LLVM Value Representation.
Definition Value.h:75
A range adaptor for a pair of iterators.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned const TypeCVI_LAST
static unsigned getMemAccessSizeInBytes(MemAccessSize S)
unsigned const TypeCVI_FIRST
bool getTSFlag(const MCInstrDesc &MID, HexagonTSFlagsVal Pos)
bool isTmpWrite(MCInstrInfo const &MCII, MCInst const &MCI)
bool isHMXWeight(MCInstrInfo const &MCII, MCInst const &MCI)
std::pair< unsigned, unsigned > GetVecRegPairIndices(MCRegister VecRegPair)
Returns an ordered pair of the constituent register ordinals for each of the elements of VecRegPair.
bool isExtentSigned(MCInstrInfo const &MCII, MCInst const &MCI)
MCInst deriveSubInst(MCInst const &Inst)
bool isRestrictSlot1AOK(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn can be packaged only with an A-type insn in slot #1.
bool isConstExtended(MCInstrInfo const &MCII, MCInst const &MCI)
bool isIntReg(MCRegister Reg)
void addConstant(MCInst &MI, uint64_t Value, MCContext &Context)
unsigned getMemAccessSize(MCInstrInfo const &MCII, MCInst const &MCI)
bool isHVXVS3SRC(MCInstrInfo const &MCII, MCInst const &MCI)
bool isSolo(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn is solo, i.e., cannot be in a packet.
SmallVector< DuplexCandidate, 8 > getDuplexPossibilties(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCB)
bool isPredicatedNew(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn is newly predicated.
bool IsReverseVecRegPair(MCRegister VecReg)
bool isOuterLoop(MCInst const &MCI)
MCInst * deriveDuplex(MCContext &Context, unsigned iClass, MCInst const &inst0, MCInst const &inst1)
bool isHVXALU2SRC(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned getAddrMode(MCInstrInfo const &MCII, MCInst const &MCI)
size_t bundleSize(MCInst const &MCI)
bool IsABranchingInst(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &I)
bool isDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned getCVIResources(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the resources used by this instruction.
void padEndloop(MCInst &MCI, MCContext &Context)
constexpr int64_t memReorderDisabledMask
bool isPrefix(MCInstrInfo const &MCII, MCInst const &MCI)
bool IsSingleConsumerRefPairProducer(MCRegister Producer, MCRegister Consumer)
bool isPredicateLate(MCInstrInfo const &MCII, MCInst const &MCI)
void setS27_2_reloc(MCExpr const &Expr, bool Val=true)
unsigned getExtentBits(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned short getNewValueOp2(MCInstrInfo const &MCII, MCInst const &MCI)
Return the new value or the newly produced value.
bool isSoloAX(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn can be packaged only with A and X-type insns.
bool isNewValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn expects newly produced value.
unsigned short getNewValueOp(MCInstrInfo const &MCII, MCInst const &MCI)
bool isHVX(MCInstrInfo const &MCII, MCInst const &MCI)
bool isHLX(MCInstrInfo const &MCII, MCInst const &MCI)
bool isMemReorderDisabled(MCInst const &MCI)
unsigned short getExtendableOp(MCInstrInfo const &MCII, MCInst const &MCI)
bool isCompound(MCInstrInfo const &MCII, MCInst const &MCI)
bool IsVecRegPair(MCRegister VecReg)
bool mustNotExtend(MCExpr const &Expr)
bool isNewValueStore(MCInstrInfo const &MCII, MCInst const &MCI)
Return true if the operand is a new-value store insn.
MCInstrDesc const & getDesc(MCInstrInfo const &MCII, MCInst const &MCI)
iterator_range< Hexagon::PacketIterator > bundleInstructions(MCInstrInfo const &MCII, MCInst const &MCI)
bool IsVecRegSingle(MCRegister VecReg)
bool LoopNeedsPadding(MCInst const &MCB)
void tryCompound(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCContext &Context, MCInst &MCI)
tryCompound - Given a bundle check for compound insns when one is found update the contents of the bu...
void setMemReorderDisabled(MCInst &MCI)
bool isBundle(MCInst const &MCI)
int64_t minConstant(MCInst const &MCI, size_t Index)
bool isCofRelax1(MCInstrInfo const &MCII, MCInst const &MCI)
bool isDblRegForSubInst(MCRegister Reg)
MCExpr const & getExpr(MCExpr const &Expr)
bool isOpExtendable(MCInstrInfo const &MCII, MCInst const &MCI, unsigned short)
Return whether the operand is extendable.
int getMinValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return the minimum value of an extendable operand.
bool prefersSlot3(MCInstrInfo const &MCII, MCInst const &MCI)
bool hasDuplex(MCInstrInfo const &MCII, MCInst const &MCI)
bool isExtendable(MCInstrInfo const &MCII, MCInst const &MCI)
bool isIntRegForSubInst(MCRegister Reg)
unsigned getUnits(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots used by the insn.
MCInst const * extenderForIndex(MCInst const &MCB, size_t Index)
unsigned getType(MCInstrInfo const &MCII, MCInst const &MCI)
Return the Hexagon ISA class for the insn.
bool isImmext(MCInst const &MCI)
void addConstExtender(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB, MCInst const &MCI)
MCOperand const & getNewValueOperand(MCInstrInfo const &MCII, MCInst const &MCI)
bool isPredRegister(MCInstrInfo const &MCII, MCInst const &Inst, unsigned I)
bool isPredicated(MCInstrInfo const &MCII, MCInst const &MCI)
constexpr int64_t innerLoopMask
bool isCofMax1(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned SubregisterBit(MCRegister Consumer, MCRegister Producer, MCRegister Producer2)
constexpr size_t bundleInstructionsOffset
bool s27_2_reloc(MCExpr const &Expr)
bool hasImmExt(MCInst const &MCI)
bool isInnerLoop(MCInst const &MCI)
bool hasNewValue2(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn produces a second value.
PredicateInfo predicateInfo(MCInstrInfo const &MCII, MCInst const &MCI)
bool canonicalizePacket(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCContext &Context, MCInst &MCB, HexagonMCChecker *Checker, bool AttemptCompatibility=false)
unsigned getOtherReservedSlots(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
Return the slots this instruction consumes in addition to the slot(s) it can execute out of.
bool isCanon(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned slotsConsumed(MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst const &MCI)
int getMaxValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return the maximum value of an extendable operand.
void replaceDuplex(MCContext &Context, MCInst &MCI, DuplexCandidate Candidate)
void setMustNotExtend(MCExpr const &Expr, bool Val=true)
bool requiresSlot(MCSubtargetInfo const &STI, MCInst const &MCI)
unsigned getExtentAlignment(MCInstrInfo const &MCII, MCInst const &MCI)
void extendIfNeeded(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB, MCInst const &MCI)
bool hasTmpDst(MCInstrInfo const &MCII, MCInst const &MCI)
StringRef getName(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned packetSizeSlots(MCSubtargetInfo const &STI)
bool isPredReg(MCRegisterInfo const &MRI, MCRegister Reg)
bool isPredicatedTrue(MCInstrInfo const &MCII, MCInst const &MCI)
bool hasExtenderForIndex(MCInst const &MCB, size_t Index)
bool isRestrictNoSlot1Store(MCInstrInfo const &MCII, MCInst const &MCI)
constexpr int64_t outerLoopMask
MCInst const & instruction(MCInst const &MCB, size_t Index)
bool isAccumulator(MCInstrInfo const &MCII, MCInst const &MCI)
Return where the instruction is an accumulator.
bool mustExtend(MCExpr const &Expr)
bool isVector(MCInstrInfo const &MCII, MCInst const &MCI)
MCOperand const & getExtendableOperand(MCInstrInfo const &MCII, MCInst const &MCI)
bool isSubInstruction(MCInst const &MCI)
MCOperand const & getNewValueOperand2(MCInstrInfo const &MCII, MCInst const &MCI)
void setMustExtend(MCExpr const &Expr, bool Val=true)
bool isHMXActivation(MCInstrInfo const &MCII, MCInst const &MCI)
unsigned getDuplexRegisterNumbering(MCRegister Reg)
bool isExtended(MCInstrInfo const &MCII, MCInst const &MCI)
bool isCVINew(MCInstrInfo const &MCII, MCInst const &MCI)
bool isFloat(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether it is a floating-point insn.
bool hasNewValue(MCInstrInfo const &MCII, MCInst const &MCI)
Return whether the insn produces a value.
unsigned packetSize(StringRef CPU)
bool isCofRelax2(MCInstrInfo const &MCII, MCInst const &MCI)
MCInst deriveExtender(MCInstrInfo const &MCII, MCInst const &Inst, MCOperand const &MO)
MCSubtargetInfo const * getArchSubtarget(MCSubtargetInfo const *STI)
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
Definition STLExtras.h:316
cl::opt< bool > HexagonDisableCompound
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
bool HexagonMCShuffle(MCContext &Context, bool ReportErrors, MCInstrInfo const &MCII, MCSubtargetInfo const &STI, MCInst &MCB)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Op::Description Desc
unsigned HexagonGetLastSlot()
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
@ Other
Any other memory.
Definition ModRef.h:68
const InstrStage HexagonStages[]
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
#define N
An itinerary represents the scheduling information for an instruction.
const InstrItinerary * InstrItineraries
Definition MCSchedule.h:341