[PATCH] D155461: [InstCombine] Keep !unpredictable when combining select+add
Paweł Bylica via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 18 00:48:34 PDT 2023
chfast added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:540
Value *NewSel = Builder.CreateSelect(SI.getCondition(), Swapped ? C : OOp,
- Swapped ? OOp : C);
+ Swapped ? OOp : C, "", &SI);
if (isa<FPMathOperator>(&SI))
----------------
goldstein.w.n wrote:
> chfast wrote:
> > I believe there are more case in the file where metadata copy is missed. I will try to identify them and create more tests cases. Can be in this review on later, depending on reviewers' suggestion.
> Are there any other binops you want to preserve this flag for?
I think it make sense for any binop because the condition of the select in this transformation remains unchanged (i.e. `!unpredictable` is still applicable).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155461/new/
https://reviews.llvm.org/D155461
More information about the llvm-commits
mailing list