[llvm] [RISCV] Combine (ADDI (ADDI X, C1), C2) -> (ADDI X, C1+C2) (PR #157416)
Piotr Fusik via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 8 03:14:13 PDT 2025
pfusik wrote:
I found three patterns:
1. [e.g. 23456b036ecbc7d0](https://github.com/dtcxzyw/llvm-codegen-benchmark/blob/24627cd223f7ca9e686a898658cabba4d4339e7e/result/rvb23u64/23456b036ecbc7d0.S)
This can be addressed by the change in RISCVISelLowering.cpp.
2. [e.g. d1e7a5db560b32a5](https://github.com/dtcxzyw/llvm-codegen-benchmark/blob/24627cd223f7ca9e686a898658cabba4d4339e7e/result/rvb23u64/d1e7a5db560b32a5.S)
Similar, but the inner ADDI is ADDIW until riscv-opt-w-instrs. How to handle?
3. [e.g. 011a43fe5b60424c](https://github.com/dtcxzyw/llvm-codegen-benchmark/blob/24627cd223f7ca9e686a898658cabba4d4339e7e/result/rvb23u64/011a43fe5b60424c.S)
This is because of an opaque constant. What are opaque constants? I cannot find any documentation.
https://github.com/llvm/llvm-project/pull/157416
More information about the llvm-commits
mailing list