[llvm] [RISCV] Add late optimization pass for riscv (PR #133256)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 27 09:26:58 PDT 2025


michaelmaitland wrote:

> > > Can we add a test that shows the issue from real code?
> > 
> > 
> > @mikhailramalho feel free to use [this test reduced from perlbench](https://github.com/michaelmaitland/llvm-project/blob/cfb65551f148e39e33311f77d6fc364cfaca3473/llvm/test/CodeGen/RISCV/simplify-condbr.ll)
> 
> I see that #131728 has a different version with an extra function; should I use that instead?

I forgot about that one. Thats a good idea. The reason we got an extra test there is because the first one got cleaned up in BranchFolding with a call to the modified analyzeBranch. The second one didn't though, and needed the late optimizer. Without changes to analyzeBranch (the current approach we're pursuing), we will optimize both here I think.

https://github.com/llvm/llvm-project/pull/133256


More information about the llvm-commits mailing list