28#define DEBUG_TYPE "riscv-vl-optimizer"
29#define PASS_NAME "RISC-V VL Optimizer"
60char RISCVVLOptimizer::ID = 0;
66 return new RISCVVLOptimizer();
72 return RISCV::VRRegClass.contains(R);
87 std::optional<std::pair<unsigned, bool>>
EMUL;
104 assert(
A.isKnown() &&
B.isKnown() &&
"Both operands must be known");
106 return A.Log2EEW ==
B.Log2EEW &&
A.EMUL->first ==
B.EMUL->first &&
107 A.EMUL->second ==
B.EMUL->second;
115 assert(
EMUL &&
"Expected EMUL to have value");
131namespace RISCVVType {
156static std::pair<unsigned, bool>
168 unsigned MISEW = 1 << MILog2SEW;
170 unsigned EEW = 1 << Log2EEW;
173 unsigned Num = EEW, Denom = MISEW;
174 int GCD = MILMULIsFractional ? std::gcd(Num, Denom * MILMUL)
175 : std::gcd(Num * MILMUL, Denom);
176 Num = MILMULIsFractional ? Num / GCD : Num * MILMUL / GCD;
177 Denom = MILMULIsFractional ? Denom * MILMUL / GCD : Denom / GCD;
178 return std::make_pair(Num > Denom ? Num : Denom, Denom > Num);
195 unsigned MISEW = 1 << MILog2SEW;
196 unsigned EEW = MISEW / Factor;
197 unsigned Log2EEW =
Log2_32(EEW);
211 return Desc.operands()[MO.
getOperandNo()].RegClass == RISCV::VMV0RegClassID;
219 RISCVVPseudosTable::getPseudoInfo(
MI.getOpcode());
220 assert(
RVV &&
"Could not find MI in PseudoTable");
234 if (HasPassthru && MO.
getOperandNo() ==
MI.getNumExplicitDefs() &&
235 (MO.
getReg() != RISCV::NoRegister))
246 switch (
RVV->BaseInstr) {
250 case RISCV::VSETIVLI:
264 case RISCV::VSSE16_V:
267 case RISCV::VSSE32_V:
270 case RISCV::VSSE64_V:
277 case RISCV::VLUXEI8_V:
278 case RISCV::VLOXEI8_V:
279 case RISCV::VSUXEI8_V:
280 case RISCV::VSOXEI8_V: {
285 case RISCV::VLUXEI16_V:
286 case RISCV::VLOXEI16_V:
287 case RISCV::VSUXEI16_V:
288 case RISCV::VSOXEI16_V: {
293 case RISCV::VLUXEI32_V:
294 case RISCV::VLOXEI32_V:
295 case RISCV::VSUXEI32_V:
296 case RISCV::VSOXEI32_V: {
301 case RISCV::VLUXEI64_V:
302 case RISCV::VLOXEI64_V:
303 case RISCV::VSUXEI64_V:
304 case RISCV::VSOXEI64_V: {
317 case RISCV::VRSUB_VI:
318 case RISCV::VRSUB_VX:
342 case RISCV::VMINU_VV:
343 case RISCV::VMINU_VX:
346 case RISCV::VMAXU_VV:
347 case RISCV::VMAXU_VX:
354 case RISCV::VMULH_VV:
355 case RISCV::VMULH_VX:
356 case RISCV::VMULHU_VV:
357 case RISCV::VMULHU_VX:
358 case RISCV::VMULHSU_VV:
359 case RISCV::VMULHSU_VX:
362 case RISCV::VDIVU_VV:
363 case RISCV::VDIVU_VX:
366 case RISCV::VREMU_VV:
367 case RISCV::VREMU_VX:
372 case RISCV::VMACC_VV:
373 case RISCV::VMACC_VX:
374 case RISCV::VNMSAC_VV:
375 case RISCV::VNMSAC_VX:
376 case RISCV::VMADD_VV:
377 case RISCV::VMADD_VX:
378 case RISCV::VNMSUB_VV:
379 case RISCV::VNMSUB_VX:
384 case RISCV::VMERGE_VIM:
385 case RISCV::VMERGE_VVM:
386 case RISCV::VMERGE_VXM:
387 case RISCV::VADC_VIM:
388 case RISCV::VADC_VVM:
389 case RISCV::VADC_VXM:
390 case RISCV::VSBC_VVM:
391 case RISCV::VSBC_VXM:
400 case RISCV::VSADDU_VI:
401 case RISCV::VSADDU_VV:
402 case RISCV::VSADDU_VX:
403 case RISCV::VSADD_VI:
404 case RISCV::VSADD_VV:
405 case RISCV::VSADD_VX:
406 case RISCV::VSSUBU_VV:
407 case RISCV::VSSUBU_VX:
408 case RISCV::VSSUB_VV:
409 case RISCV::VSSUB_VX:
410 case RISCV::VAADDU_VV:
411 case RISCV::VAADDU_VX:
412 case RISCV::VAADD_VV:
413 case RISCV::VAADD_VX:
414 case RISCV::VASUBU_VV:
415 case RISCV::VASUBU_VX:
416 case RISCV::VASUB_VV:
417 case RISCV::VASUB_VX:
420 case RISCV::VSSRL_VI:
421 case RISCV::VSSRL_VV:
422 case RISCV::VSSRL_VX:
423 case RISCV::VSSRA_VI:
424 case RISCV::VSSRA_VV:
425 case RISCV::VSSRA_VX:
432 case RISCV::VFMV_F_S:
433 case RISCV::VFMV_S_F:
436 case RISCV::VSLIDEUP_VI:
437 case RISCV::VSLIDEUP_VX:
438 case RISCV::VSLIDEDOWN_VI:
439 case RISCV::VSLIDEDOWN_VX:
440 case RISCV::VSLIDE1UP_VX:
441 case RISCV::VFSLIDE1UP_VF:
442 case RISCV::VSLIDE1DOWN_VX:
443 case RISCV::VFSLIDE1DOWN_VF:
446 case RISCV::VRGATHER_VI:
447 case RISCV::VRGATHER_VV:
448 case RISCV::VRGATHER_VX:
451 case RISCV::VCOMPRESS_VM:
458 case RISCV::VWADDU_VV:
459 case RISCV::VWADDU_VX:
460 case RISCV::VWSUBU_VV:
461 case RISCV::VWSUBU_VX:
462 case RISCV::VWADD_VV:
463 case RISCV::VWADD_VX:
464 case RISCV::VWSUB_VV:
465 case RISCV::VWSUB_VX:
466 case RISCV::VWSLL_VI:
469 case RISCV::VWMUL_VV:
470 case RISCV::VWMUL_VX:
471 case RISCV::VWMULSU_VV:
472 case RISCV::VWMULSU_VX:
473 case RISCV::VWMULU_VV:
474 case RISCV::VWMULU_VX:
480 case RISCV::VWMACCU_VV:
481 case RISCV::VWMACCU_VX:
482 case RISCV::VWMACC_VV:
483 case RISCV::VWMACC_VX:
484 case RISCV::VWMACCSU_VV:
485 case RISCV::VWMACCSU_VX:
486 case RISCV::VWMACCUS_VX: {
487 unsigned Log2EEW = IsMODef ? MILog2SEW + 1 : MILog2SEW;
494 case RISCV::VWADDU_WV:
495 case RISCV::VWADDU_WX:
496 case RISCV::VWSUBU_WV:
497 case RISCV::VWSUBU_WX:
498 case RISCV::VWADD_WV:
499 case RISCV::VWADD_WX:
500 case RISCV::VWSUB_WV:
501 case RISCV::VWSUB_WX: {
503 bool TwoTimes = IsMODef || IsOp1;
504 unsigned Log2EEW = TwoTimes ? MILog2SEW + 1 : MILog2SEW;
511 case RISCV::VZEXT_VF2:
512 case RISCV::VSEXT_VF2:
514 case RISCV::VZEXT_VF4:
515 case RISCV::VSEXT_VF4:
517 case RISCV::VZEXT_VF8:
518 case RISCV::VSEXT_VF8:
524 case RISCV::VNSRL_WX:
525 case RISCV::VNSRL_WI:
526 case RISCV::VNSRL_WV:
527 case RISCV::VNSRA_WI:
528 case RISCV::VNSRA_WV:
529 case RISCV::VNSRA_WX:
532 case RISCV::VNCLIPU_WI:
533 case RISCV::VNCLIPU_WV:
534 case RISCV::VNCLIPU_WX:
535 case RISCV::VNCLIP_WI:
536 case RISCV::VNCLIP_WV:
537 case RISCV::VNCLIP_WX: {
539 bool TwoTimes = IsOp1;
540 unsigned Log2EEW = TwoTimes ? MILog2SEW + 1 : MILog2SEW;
555 case RISCV::VMAND_MM:
556 case RISCV::VMNAND_MM:
557 case RISCV::VMANDN_MM:
558 case RISCV::VMXOR_MM:
560 case RISCV::VMNOR_MM:
561 case RISCV::VMORN_MM:
562 case RISCV::VMXNOR_MM:
565 case RISCV::VMSOF_M: {
572 case RISCV::VIOTA_M: {
580 case RISCV::VMSEQ_VI:
581 case RISCV::VMSEQ_VV:
582 case RISCV::VMSEQ_VX:
583 case RISCV::VMSNE_VI:
584 case RISCV::VMSNE_VV:
585 case RISCV::VMSNE_VX:
586 case RISCV::VMSLTU_VV:
587 case RISCV::VMSLTU_VX:
588 case RISCV::VMSLT_VV:
589 case RISCV::VMSLT_VX:
590 case RISCV::VMSLEU_VV:
591 case RISCV::VMSLEU_VI:
592 case RISCV::VMSLEU_VX:
593 case RISCV::VMSLE_VV:
594 case RISCV::VMSLE_VI:
595 case RISCV::VMSLE_VX:
596 case RISCV::VMSGTU_VI:
597 case RISCV::VMSGTU_VX:
598 case RISCV::VMSGT_VI:
599 case RISCV::VMSGT_VX:
603 case RISCV::VMADC_VIM:
604 case RISCV::VMADC_VVM:
605 case RISCV::VMADC_VXM:
606 case RISCV::VMSBC_VVM:
607 case RISCV::VMSBC_VXM:
609 case RISCV::VMADC_VV:
610 case RISCV::VMADC_VI:
611 case RISCV::VMADC_VX:
612 case RISCV::VMSBC_VV:
613 case RISCV::VMSBC_VX: {
629 RISCVVPseudosTable::getPseudoInfo(
MI.getOpcode());
634 switch (
RVV->BaseInstr) {
641 case RISCV::VRSUB_VI:
642 case RISCV::VRSUB_VX:
664 case RISCV::VWADDU_VV:
665 case RISCV::VWADDU_VX:
666 case RISCV::VWSUBU_VV:
667 case RISCV::VWSUBU_VX:
668 case RISCV::VWADD_VV:
669 case RISCV::VWADD_VX:
670 case RISCV::VWSUB_VV:
671 case RISCV::VWSUB_VX:
672 case RISCV::VWADDU_WV:
673 case RISCV::VWADDU_WX:
674 case RISCV::VWSUBU_WV:
675 case RISCV::VWSUBU_WX:
676 case RISCV::VWADD_WV:
677 case RISCV::VWADD_WX:
678 case RISCV::VWSUB_WV:
679 case RISCV::VWSUB_WX:
681 case RISCV::VZEXT_VF2:
682 case RISCV::VSEXT_VF2:
683 case RISCV::VZEXT_VF4:
684 case RISCV::VSEXT_VF4:
685 case RISCV::VZEXT_VF8:
686 case RISCV::VSEXT_VF8:
689 case RISCV::VMADC_VV:
690 case RISCV::VMADC_VI:
691 case RISCV::VMADC_VX:
692 case RISCV::VMSBC_VV:
693 case RISCV::VMSBC_VX:
695 case RISCV::VNSRL_WX:
696 case RISCV::VNSRL_WI:
697 case RISCV::VNSRL_WV:
698 case RISCV::VNSRA_WI:
699 case RISCV::VNSRA_WV:
700 case RISCV::VNSRA_WX:
702 case RISCV::VMSEQ_VI:
703 case RISCV::VMSEQ_VV:
704 case RISCV::VMSEQ_VX:
705 case RISCV::VMSNE_VI:
706 case RISCV::VMSNE_VV:
707 case RISCV::VMSNE_VX:
708 case RISCV::VMSLTU_VV:
709 case RISCV::VMSLTU_VX:
710 case RISCV::VMSLT_VV:
711 case RISCV::VMSLT_VX:
712 case RISCV::VMSLEU_VV:
713 case RISCV::VMSLEU_VI:
714 case RISCV::VMSLEU_VX:
715 case RISCV::VMSLE_VV:
716 case RISCV::VMSLE_VI:
717 case RISCV::VMSLE_VX:
718 case RISCV::VMSGTU_VI:
719 case RISCV::VMSGTU_VX:
720 case RISCV::VMSGT_VI:
721 case RISCV::VMSGT_VX:
723 case RISCV::VMINU_VV:
724 case RISCV::VMINU_VX:
727 case RISCV::VMAXU_VV:
728 case RISCV::VMAXU_VX:
734 case RISCV::VMULH_VV:
735 case RISCV::VMULH_VX:
736 case RISCV::VMULHU_VV:
737 case RISCV::VMULHU_VX:
738 case RISCV::VMULHSU_VV:
739 case RISCV::VMULHSU_VX:
741 case RISCV::VDIVU_VV:
742 case RISCV::VDIVU_VX:
745 case RISCV::VREMU_VV:
746 case RISCV::VREMU_VX:
750 case RISCV::VWMUL_VV:
751 case RISCV::VWMUL_VX:
752 case RISCV::VWMULSU_VV:
753 case RISCV::VWMULSU_VX:
754 case RISCV::VWMULU_VV:
755 case RISCV::VWMULU_VX:
757 case RISCV::VMACC_VV:
758 case RISCV::VMACC_VX:
759 case RISCV::VNMSAC_VV:
760 case RISCV::VNMSAC_VX:
761 case RISCV::VMADD_VV:
762 case RISCV::VMADD_VX:
763 case RISCV::VNMSUB_VV:
764 case RISCV::VNMSUB_VX:
766 case RISCV::VWMACCU_VV:
767 case RISCV::VWMACCU_VX:
768 case RISCV::VWMACC_VV:
769 case RISCV::VWMACC_VX:
770 case RISCV::VWMACCSU_VV:
771 case RISCV::VWMACCSU_VX:
772 case RISCV::VWMACCUS_VX:
782 case RISCV::VWSLL_VI:
791 case RISCV::VMAND_MM:
792 case RISCV::VMNAND_MM:
793 case RISCV::VMANDN_MM:
794 case RISCV::VMXOR_MM:
796 case RISCV::VMNOR_MM:
797 case RISCV::VMORN_MM:
798 case RISCV::VMXNOR_MM:
814 RISCVVPseudosTable::getPseudoInfo(
MI->getOpcode());
819 switch (
RVV->BaseInstr) {
821 case RISCV::VREDAND_VS:
822 case RISCV::VREDMAX_VS:
823 case RISCV::VREDMAXU_VS:
824 case RISCV::VREDMIN_VS:
825 case RISCV::VREDMINU_VS:
826 case RISCV::VREDOR_VS:
827 case RISCV::VREDSUM_VS:
828 case RISCV::VREDXOR_VS:
829 case RISCV::VWREDSUM_VS:
830 case RISCV::VWREDSUMU_VS:
831 case RISCV::VFREDMAX_VS:
832 case RISCV::VFREDMIN_VS:
833 case RISCV::VFREDOSUM_VS:
834 case RISCV::VFREDUSUM_VS:
835 case RISCV::VFWREDOSUM_VS:
836 case RISCV::VFWREDUSUM_VS:
846 RISCVVPseudosTable::getPseudoInfo(
MI.getOpcode());
850 switch (
RVV->BaseInstr) {
853 case RISCV::VSLIDEDOWN_VI:
854 case RISCV::VSLIDEDOWN_VX:
855 case RISCV::VSLIDE1DOWN_VX:
856 case RISCV::VFSLIDE1DOWN_VF:
860 case RISCV::VRGATHER_VI:
861 case RISCV::VRGATHER_VV:
862 case RISCV::VRGATHER_VX:
863 case RISCV::VRGATHEREI16_VV:
875 if (
MI.getNumDefs() != 1)
890 unsigned PassthruOpIdx =
MI.getNumExplicitDefs();
892 MI.getOperand(PassthruOpIdx).getReg() != RISCV::NoRegister) {
894 dbgs() <<
" Not a candidate because it uses non-undef passthru"
895 " with non-VLMAX VL\n");
903 LLVM_DEBUG(
dbgs() <<
" Not a candidate because VL is already 1\n");
920 LLVM_DEBUG(
dbgs() <<
"Not a candidate due to unsupported instruction\n");
934 bool CanReduceVL =
true;
935 for (
auto &UserOp :
MRI->use_operands(
MI.getOperand(0).getReg())) {
949 LLVM_DEBUG(
dbgs() <<
" Abort because used by unsafe instruction\n");
955 if (UserOp.isTied()) {
956 LLVM_DEBUG(
dbgs() <<
" Abort because user used as tied operand\n");
963 LLVM_DEBUG(
dbgs() <<
" Abort due to lack of VL or SEW, assume that"
974 "Did not expect X0 VL");
982 LLVM_DEBUG(
dbgs() <<
" Abort because cannot determine a common VL\n");
993 "information for EMUL or EEW.\n");
994 LLVM_DEBUG(
dbgs() <<
" ConsumerInfo is: " << ConsumerInfo <<
"\n");
995 LLVM_DEBUG(
dbgs() <<
" ProducerInfo is: " << ProducerInfo <<
"\n");
1003bool RISCVVLOptimizer::tryReduceVL(
MachineInstr &OrigMI) {
1005 Worklist.
insert(&OrigMI);
1007 bool MadeChange =
false;
1008 while (!Worklist.
empty()) {
1013 bool CanReduceVL =
true;
1015 CanReduceVL = checkUsers(CommonVL,
MI);
1017 if (!CanReduceVL || !CommonVL)
1021 "Expected VL to be an Imm or virtual Reg");
1031 if (CommonVL->
isImm()) {
1033 << CommonVL->
getImm() <<
" for " <<
MI <<
"\n");
1037 if (!MDT->dominates(VLMI, &
MI))
1040 dbgs() <<
" Reduce VL from " << VLOp <<
" to "
1042 <<
" for " <<
MI <<
"\n");
1051 for (
auto &
Op :
MI.operands()) {
1052 if (!
Op.isReg() || !
Op.isUse() || !
Op.getReg().isVirtual())
1075 MDT = &getAnalysis<MachineDominatorTreeWrapperPass>().getDomTree();
1078 if (!
ST.hasVInstructions())
1081 bool MadeChange =
false;
1088 MadeChange |= tryReduceVL(
MI);
unsigned const MachineRegisterInfo * MRI
MachineInstrBuilder MachineInstrBuilder & DefMI
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
#define LLVM_ATTRIBUTE_UNUSED
static bool isCandidate(const MachineInstr *MI, Register &DefedReg, Register FrameReg)
#define INITIALIZE_PASS_DEPENDENCY(depName)
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
static bool mayReadPastVL(const MachineInstr &MI)
Return true if MI may read elements past VL.
static OperandInfo getOperandInfo(const MachineOperand &MO, const MachineRegisterInfo *MRI)
Return the OperandInfo for MO.
static LLVM_ATTRIBUTE_UNUSED raw_ostream & operator<<(raw_ostream &OS, const OperandInfo &OI)
static bool isVectorOpUsedAsScalarOp(MachineOperand &MO)
Return true if MO is a vector operand but is used as a scalar operand.
static bool isVectorRegClass(Register R, const MachineRegisterInfo *MRI)
Return true if R is a physical or virtual vector register, false otherwise.
static bool isSupportedInstr(const MachineInstr &MI)
Return true if this optimization should consider MI for VL reduction.
static OperandInfo getIntegerExtensionOperandInfo(unsigned Factor, const MachineInstr &MI, const MachineOperand &MO)
Dest has EEW=SEW and EMUL=LMUL.
static bool isMaskOperand(const MachineInstr &MI, const MachineOperand &MO, const MachineRegisterInfo *MRI)
Check whether MO is a mask operand of MI.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file implements a set that has insertion order iteration characteristics.
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
void setPreservesCFG()
This function should be called by the pass, iff they do not:
This class represents an Operation in the Expression.
FunctionPass class - This class is used to implement most global optimizations.
Describe properties that are true of each instruction in the target description file.
reverse_iterator rbegin()
Analysis pass which computes a MachineDominatorTree.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual bool runOnMachineFunction(MachineFunction &MF)=0
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
const MachineBasicBlock * getParent() const
const MCInstrDesc & getDesc() const
Returns the target instruction descriptor of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
MachineOperand class - Representation of each machine instruction operand.
unsigned getOperandNo() const
Returns the index of this operand in the instruction that it belongs to.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
void ChangeToImmediate(int64_t ImmVal, unsigned TargetFlags=0)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value.
void ChangeToRegister(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
Register getReg() const
getReg - Returns the register number.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
virtual StringRef getPassName() const
getPassName - Return a nice clean name for a pass.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
A vector that has set insertion semantics.
bool empty() const
Determine if the SetVector is empty or not.
bool insert(const value_type &X)
Insert a new element into the SetVector.
value_type pop_back_val()
StringRef - Represent a constant reference to a string, i.e.
const uint8_t TSFlags
Configurable target specific flags.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
static unsigned getVLOpNum(const MCInstrDesc &Desc)
static VLMUL getLMul(uint64_t TSFlags)
static bool hasVLOp(uint64_t TSFlags)
static unsigned getSEWOpNum(const MCInstrDesc &Desc)
static bool hasSEWOp(uint64_t TSFlags)
static bool isFirstDefTiedToFirstUse(const MCInstrDesc &Desc)
static bool isVRegClass(uint64_t TSFlags)
static std::pair< unsigned, bool > getEMULEqualsEEWDivSEWTimesLMUL(unsigned Log2EEW, const MachineInstr &MI)
Return EMUL = (EEW / SEW) * LMUL where EEW comes from Log2EEW and LMUL and SEW are from the TSFlags o...
std::pair< unsigned, bool > decodeVLMUL(RISCVII::VLMUL VLMUL)
static RISCVII::VLMUL twoTimesVLMUL(RISCVII::VLMUL VLMul)
Return the RISCVII::VLMUL that is two times VLMul.
bool isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS)
Given two VL operands, do we know that LHS <= RHS?
static constexpr int64_t VLMaxSentinel
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
FunctionPass * createRISCVVLOptimizerPass()
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Printable printReg(Register Reg, const TargetRegisterInfo *TRI=nullptr, unsigned SubIdx=0, const MachineRegisterInfo *MRI=nullptr)
Prints virtual and physical registers with or without a TRI instance.
Represents the EMUL and EEW of a MachineOperand.
OperandInfo(std::pair< unsigned, bool > EMUL, unsigned Log2EEW)
void print(raw_ostream &OS) const
static bool EMULAndEEWAreEqual(const OperandInfo &A, const OperandInfo &B)
OperandInfo(RISCVII::VLMUL EMUL, unsigned Log2EEW)
std::optional< std::pair< unsigned, bool > > EMUL
enum OperandInfo::State S
Description of the encoding of one expression Op.