[PATCH] D140858: [InstCombine]: Don't simplify bits if it causes imm32 to become imm64

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 11:20:59 PST 2023


goldstein.w.n added a comment.

In D140858#4023134 <https://reviews.llvm.org/D140858#4023134>, @spatel wrote:

> The diffs are similar to what I was going for in:
> d6498abc241b <https://reviews.llvm.org/rGd6498abc241bf86a24de973bd69eb29e2216c085>
> ...and I'm not aware of any regressions from that change.
>
> So this seems fine to try in IR even before looking at codegen (and then maybe we won't need to do anything in codegen).
> But I agree it should not be hard-coded based on i32 - avoid shrinking based on significant bits in general; possibly in combination with InstCombinerImpl::isDesirableIntType().

I don't think `InstCombinerImpl::isDesirableIntType()` is what we want. For example on `X86` 64-bit is legal (so `isDesirableIntType()` will return true) so it would never
help avoid the extra instruction incurred by `movabs`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140858



More information about the llvm-commits mailing list