[PATCH] D83440: [InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not poison
Nuno Lopes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 9 01:13:12 PDT 2020
nlopes added inline comments.
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4124
+ // select ?, undef, X -> X
+ if (isa<UndefValue>(TrueVal) && isGuaranteedNotToBeUndefOrPoison(FalseVal))
+ return FalseVal;
----------------
craig.topper wrote:
> Should I be passing CxtI and DT here? I based this off the code in SimplifyInsertElementInst, but maybe i should have based it off of SimplifyFreezeInst?
Yes, you can; it's correct to do so.
The only issue is that `SimplifySelectInst()` doesn't seem to receive the select instruction as argument to be passed as CxtI.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83440/new/
https://reviews.llvm.org/D83440
More information about the llvm-commits
mailing list