Skip to content

Commit 733e3c6

Browse files
authored
[RISCV] Update comment on -w stripping pass. NFC (#67415)
It looks like we only strip the -w suffix from addw and not addiw (because c.addiw and c.addi have the same register encoding), but the comment in the header seems to have it the other way round.
1 parent baf3903 commit 733e3c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Target/RISCV/RISCVOptWInstrs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
// extended bits aren't consumed or because the input was already sign extended
1313
// by an earlier instruction.
1414
//
15-
// Then it removes the -w suffix from each addiw and slliw instructions
15+
// Then it removes the -w suffix from addw, slliw and mulw instructions
1616
// whenever all users are dependent only on the lower word of the result of the
17-
// instruction. We do this only for addiw, slliw, and mulw because the -w forms
18-
// are less compressible.
17+
// instruction. We do this only for addw, slliw, and mulw because the -w forms
18+
// are less compressible: c.add and c.slli have a larger register encoding than
19+
// their w counterparts, and there's no compressible version of mulw.
1920
//
2021
//===---------------------------------------------------------------------===//
2122

0 commit comments

Comments
 (0)