[PATCH] D100211: [InstCombine] Fold cmpeq/ne(and(~X,Y),0) --> cmpeq/ne(or(freeze(X),Y),X) (PR44136)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 11 10:48:49 PDT 2021
lebedev.ri added a comment.
In D100211#2681777 <https://reviews.llvm.org/D100211#2681777>, @RKSimon wrote:
> The missing middle-end fold was noted on the ticket (PR44136) - this patch is to show what would be necessary.
>
> Limiting this to isGuaranteedNotToBeUndefOrPoison would be safer, although I'm not sure how common the case is tbh. Happy to abandon and close the ticket if this is pointless extra work.
>
> @lebedev.ri any thoughts?
I'm not sure, which is why i haven't posted any patches after originally replying to the bug.
Right now i don't quite understand why we are so afraid of using `freeze`.
Can we not teach instcombine to hoist it?
Ignoring the `freeze` question, i think this is an improvement.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100211/new/
https://reviews.llvm.org/D100211
More information about the llvm-commits
mailing list