[PATCH] D65434: [RISCV] Custom legalize i32 operations for RV64 to reduce signed extensions

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 08:06:45 PDT 2019


lenary requested changes to this revision.
lenary added a comment.
This revision now requires changes to proceed.

This does seem to simplify the code in both examples (eliminating ~5 instructions from both functions in `rv64i-w-insts-legalization.ll`, and turning others from `op; sext.w` into `op.w`, or `sext.w` into `mv`). I also think the operations in `customLegalizeToWOpWithSExt` do make sense, as a replacement.

I guess I'm slightly surprised that LLVM cannot manage to eliminate the sign extensions in these cases, but I didn't see anything in DagCombiner.cpp, so it makes sense that we have to do a custom lowering.

Some tests in `test/CodeGen/RISCV/` are no longer passing. These can be updated by running `utils/update_llc_test_checks.py`. Please update the diff with the results of updating the 6 failing tests.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65434/new/

https://reviews.llvm.org/D65434





More information about the llvm-commits mailing list