@@ -1503,7 +1503,7 @@ defm VFNCVT_ROD_F_F_W : VNCVTF_FV_VS2<"vfncvt.rod.f.f.w", 0b010010, 0b10101>;
15031503let Predicates = [HasVInstructions] in {
15041504
15051505// Vector Single-Width Integer Reduction Instructions
1506- let RVVConstraint = NoConstraint in {
1506+ let RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1 in {
15071507defm VREDSUM : VRED_MV_V<"vredsum", 0b000000>;
15081508defm VREDMAXU : VREDMINMAX_MV_V<"vredmaxu", 0b000110>;
15091509defm VREDMAX : VREDMINMAX_MV_V<"vredmax", 0b000111>;
@@ -1512,23 +1512,23 @@ defm VREDMIN : VREDMINMAX_MV_V<"vredmin", 0b000101>;
15121512defm VREDAND : VRED_MV_V<"vredand", 0b000001>;
15131513defm VREDOR : VRED_MV_V<"vredor", 0b000010>;
15141514defm VREDXOR : VRED_MV_V<"vredxor", 0b000011>;
1515- } // RVVConstraint = NoConstraint
1515+ } // RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1
15161516
15171517// Vector Widening Integer Reduction Instructions
1518- let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint in {
1518+ let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1 in {
15191519// Set earlyclobber for following instructions for second and mask operands.
15201520// This has the downside that the earlyclobber constraint is too coarse and
15211521// will impose unnecessary restrictions by not allowing the destination to
15221522// overlap with the first (wide) operand.
15231523defm VWREDSUMU : VWRED_IV_V<"vwredsumu", 0b110000>;
15241524defm VWREDSUM : VWRED_IV_V<"vwredsum", 0b110001>;
1525- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
1525+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1
15261526
15271527} // Predicates = [HasVInstructions]
15281528
15291529let Predicates = [HasVInstructionsAnyF] in {
15301530// Vector Single-Width Floating-Point Reduction Instructions
1531- let RVVConstraint = NoConstraint in {
1531+ let RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1 in {
15321532let Uses = [FRM], mayRaiseFPException = true in {
15331533defm VFREDOSUM : VREDO_FV_V<"vfredosum", 0b000011>;
15341534defm VFREDUSUM : VRED_FV_V<"vfredusum", 0b000001>;
@@ -1537,13 +1537,13 @@ let mayRaiseFPException = true in {
15371537defm VFREDMAX : VREDMINMAX_FV_V<"vfredmax", 0b000111>;
15381538defm VFREDMIN : VREDMINMAX_FV_V<"vfredmin", 0b000101>;
15391539}
1540- } // RVVConstraint = NoConstraint
1540+ } // RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1
15411541
15421542def : InstAlias<"vfredsum.vs $vd, $vs2, $vs1$vm",
15431543 (VFREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
15441544
15451545// Vector Widening Floating-Point Reduction Instructions
1546- let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint in {
1546+ let Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1 in {
15471547// Set earlyclobber for following instructions for second and mask operands.
15481548// This has the downside that the earlyclobber constraint is too coarse and
15491549// will impose unnecessary restrictions by not allowing the destination to
@@ -1552,7 +1552,7 @@ let Uses = [FRM], mayRaiseFPException = true in {
15521552defm VFWREDOSUM : VWREDO_FV_V<"vfwredosum", 0b110011>;
15531553defm VFWREDUSUM : VWRED_FV_V<"vfwredusum", 0b110001>;
15541554}
1555- } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint
1555+ } // Constraints = "@earlyclobber $vd", RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1
15561556
15571557def : InstAlias<"vfwredsum.vs $vd, $vs2, $vs1$vm",
15581558 (VFWREDUSUM_VS VR:$vd, VR:$vs2, VR:$vs1, VMaskOp:$vm), 0>;
@@ -1586,7 +1586,7 @@ def : InstAlias<"vmornot.mm $vd, $vs2, $vs1",
15861586 (VMORN_MM VR:$vd, VR:$vs2, VR:$vs1), 0>;
15871587
15881588let hasSideEffects = 0, mayLoad = 0, mayStore = 0,
1589- RVVConstraint = NoConstraint in {
1589+ RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1 in {
15901590
15911591// Vector mask population count vcpop
15921592def VCPOP_M : RVInstV<0b010000, 0b10000, OPMVV, (outs GPR:$vd),
@@ -1600,12 +1600,12 @@ def VFIRST_M : RVInstV<0b010000, 0b10001, OPMVV, (outs GPR:$vd),
16001600 "vfirst.m", "$vd, $vs2$vm">,
16011601 SchedUnaryMC<"WriteVMFFSV", "ReadVMFFSV">;
16021602
1603- } // hasSideEffects = 0, mayLoad = 0, mayStore = 0
1603+ } // hasSideEffects = 0, mayLoad = 0, mayStore = 0, RVVConstraint = NoConstraint, ActiveElementsAffectResult = 1
16041604
16051605def : InstAlias<"vpopc.m $vd, $vs2$vm",
16061606 (VCPOP_M GPR:$vd, VR:$vs2, VMaskOp:$vm), 0>;
16071607
1608- let Constraints = "@earlyclobber $vd", RVVConstraint = Iota in {
1608+ let Constraints = "@earlyclobber $vd", RVVConstraint = Iota, ActiveElementsAffectResult = 1 in {
16091609
16101610// vmsbf.m set-before-first mask bit
16111611defm VMSBF_M : VMSFS_MV_V<"vmsbf.m", 0b010100, 0b00001>;
@@ -1616,7 +1616,7 @@ defm VMSOF_M : VMSFS_MV_V<"vmsof.m", 0b010100, 0b00010>;
16161616// Vector Iota Instruction
16171617defm VIOTA_M : VIOTA_MV_V<"viota.m", 0b010100, 0b10000>;
16181618
1619- } // Constraints = "@earlyclobber $vd", RVVConstraint = Iota
1619+ } // Constraints = "@earlyclobber $vd", RVVConstraint = Iota, ActiveElementsAffectResult = 1
16201620
16211621// Vector Element Index Instruction
16221622let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in {
@@ -1686,9 +1686,9 @@ def VRGATHEREI16_VV : VALUVV<0b001110, OPIVV, "vrgatherei16.vv">,
16861686} // Constraints = "@earlyclobber $vd", RVVConstraint = Vrgather
16871687
16881688// Vector Compress Instruction
1689- let Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress in {
1689+ let Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress, ActiveElementsAffectResult = 1 in {
16901690defm VCOMPRESS_V : VCPR_MV_Mask<"vcompress", 0b010111>;
1691- } // Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress
1691+ } // Constraints = "@earlyclobber $vd", RVVConstraint = Vcompress, ActiveElementsAffectResult = 1
16921692
16931693let hasSideEffects = 0, mayLoad = 0, mayStore = 0, isMoveReg = 1,
16941694 RVVConstraint = NoConstraint in {
0 commit comments