[PATCH] D140974: [LICM][WIP] Transform and hoist select instructions if possible

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 07:52:30 PST 2023


spatel added a comment.

In D140974#4026218 <https://reviews.llvm.org/D140974#4026218>, @nikic wrote:

> In D140974#4026210 <https://reviews.llvm.org/D140974#4026210>, @spatel wrote:
>
>> We already have that fold?
>> https://alive2.llvm.org/ce/z/XPZL38
>>
>> There is already an undo of that or something similar for FP ops on some targets, so it may need some generalization.
>
> Ooops, you're right. I could have sworn I checked that first...
>
> So to return to the original problem here, there may be a phase ordering issue -- can you please add a PhaseOrdering test?

Aha - there's a limitation for the example with a constant, so it doesn't fold:
https://alive2.llvm.org/ce/z/QfjhJP

I think it's from this (not sure why we have it):
https://github.com/llvm/llvm-project/blob/85960043d594fc12d340ccb66a30861b023ab496/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp#L492


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140974



More information about the llvm-commits mailing list