[llvm] [InstCombine] Remove some of the complexity-based canonicalization (PR #91185)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 08:48:25 PDT 2024


nikic wrote:

> > > > Can you run it? Ill try and get -stats to work locally and post them here.
> > > 
> > > 
> > > I cannot run it as LLVM doesn't support the cost estimation of struct types :(
> > 
> > 
> > Err misunderstanding, I mean can you just generate your normal diffs. Ill do the cost estimation stuff locally and just post the results here.
> 
> Done. The IR diff basically looks fine to me.
> 
> The main problem is that some `icmp pred A, B` and `icmp swap(pred) B, A` pairs are not CSEed now. See [dtcxzyw/llvm-opt-benchmark#583 (comment)](https://github.com/dtcxzyw/llvm-opt-benchmark/pull/583#discussion_r1591786430).

I've put up https://github.com/llvm/llvm-project/pull/104805 to address this issue.

Another thing we could do is to add complexity canonicalization to GVN instead. GVN can do this in a principled way, by sorting by value number. Not sure this is actually needed though.

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


More information about the llvm-commits mailing list