Skip to content

Commit d9dd5f0

Browse files
authored
[Clang][RISCV][RVV Intrinsic] Fix codegen redundant intrinsic names (#77889)
This patch avoids adding redundant vcreate_v intrinsics to the RISCV IntrinsicList. Since vcreate_v uses LFixedLog2LMUL, I believe we can simply set Log2LMUL to the smallest value (-3) to prevent the creation of redundant vcreate_v instances with the same intrinsic name and prototype in the IntrinsicList when clang creates it.
1 parent ac6f9a7 commit d9dd5f0

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

clang/include/clang/Basic/riscv_vector.td

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,9 +2479,13 @@ let HasMasked = false, HasVL = false, IRName = "" in {
24792479
}
24802480
}] in {
24812481

2482-
defm : RVVNonTupleVCreateBuiltin<1, [0]>;
2483-
defm : RVVNonTupleVCreateBuiltin<2, [0, 1]>;
2484-
defm : RVVNonTupleVCreateBuiltin<3, [0, 1, 2]>;
2482+
// Since the vcreate_v uses LFixedLog2LMUL, setting the Log2LMUL to [-3] can
2483+
// avoid creating the intrinsics which contain the same name and prototype.
2484+
let Log2LMUL = [-3] in {
2485+
defm : RVVNonTupleVCreateBuiltin<1, [0]>;
2486+
defm : RVVNonTupleVCreateBuiltin<2, [0, 1]>;
2487+
defm : RVVNonTupleVCreateBuiltin<3, [0, 1, 2]>;
2488+
}
24852489

24862490
foreach nf = NFList in {
24872491
let NF = nf in {

0 commit comments

Comments
 (0)