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

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon May 6 21:59:26 PDT 2024


dtcxzyw 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 https://github.com/dtcxzyw/llvm-opt-benchmark/pull/583#discussion_r1591786430.

BTW I find that `SimplifyDemandBits` breaks is_pow2 idioms.
See https://github.com/dtcxzyw/llvm-opt-benchmark/pull/583#discussion_r1591795230.
I will post a patch later.

There are some missed optimizations which should be handled explicitly.
See https://github.com/dtcxzyw/llvm-opt-benchmark/pull/583#discussion_r1591800638
and https://github.com/dtcxzyw/llvm-opt-benchmark/pull/583#discussion_r1591803409.



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


More information about the llvm-commits mailing list