Skip to content

Commit fd2e400

Browse files
committed
[RISCV] Add XLenVT casts in isel patterns that output 2 GPR instructions.
See #81192 for why we need to do this.
1 parent e8c07f7 commit fd2e400

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfoZb.td

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ def : Pat<(and (or (shl GPR:$rs2, (XLenVT 8)),
596596
(PACKH GPR:$rs1, GPR:$rs2)>;
597597
def : Pat<(or (shl (zexti8 (XLenVT GPR:$rs2)), (XLenVT 24)),
598598
(shl (zexti8 (XLenVT GPR:$rs1)), (XLenVT 16))),
599-
(SLLI (PACKH GPR:$rs1, GPR:$rs2), (XLenVT 16))>;
599+
(SLLI (XLenVT (PACKH GPR:$rs1, GPR:$rs2)), (XLenVT 16))>;
600600

601601
def : Pat<(binop_allhusers<or> (shl GPR:$rs2, (XLenVT 8)),
602602
(zexti8 (XLenVT GPR:$rs1))),
@@ -612,7 +612,8 @@ def : Pat<(or (or
612612
(or
613613
(shl (zexti8 (XLenVT GPR:$op0rs2)), (XLenVT 8)),
614614
(zexti8 (XLenVT GPR:$op0rs1)))),
615-
(PACK (PACKH GPR:$op0rs1, GPR:$op0rs2), (PACKH GPR:$op1rs1, GPR:$op1rs2))>;
615+
(PACK (XLenVT (PACKH GPR:$op0rs1, GPR:$op0rs2)),
616+
(XLenVT (PACKH GPR:$op1rs1, GPR:$op1rs2)))>;
616617
}
617618

618619
let Predicates = [HasStdExtZbkb, IsRV64] in {

0 commit comments

Comments
 (0)