[PATCH] D64713: [InstCombine] X *fast (C ? 1.0 : 0.0) -> C ? X : 0.0
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 04:41:07 PDT 2019
lebedev.ri resigned from this revision.
lebedev.ri added a comment.
(i'm not touching fp folds)
================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:787
+ }
+ } else if (LHSIsSelect) {
+ // (A ? B : C) op Y -> A ? (B op Y) : (C op Y)
----------------
foad wrote:
> Question to reviewers: should I make this condition `LHSIsSelect && LHS->hasOneUse()` (and the same for RHS on line 792)? I am tempted to do so just to be conservative, to make sure that this instcombine actually removes all uses of the original select.
Presumably you'd want to add all the necessary variation of tests with extra uses, and see which ones need
restrictions to one-use cases.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64713/new/
https://reviews.llvm.org/D64713
More information about the llvm-commits
mailing list