[PATCH] D87445: [InstCombine] Fix incorrect SimplifyWithOpReplaced transform (PR47322)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 01:20:08 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:1205
+      SimplifyWithOpReplaced(FalseVal, CmpRHS, CmpLHS, Q,
+                             /* AllowRefinement */ false) == TrueVal) {
     return FalseVal;
----------------
aqjune wrote:
> Is there reason why `SimplifyWithOpReplaced(TrueVal, ....) == FalseVal` is removed?
This case is now fully handled by InstSimplify, as it does the TrueVal replacement with AllowRefinement=true now. Previously this code here caught cases where TrueVal had poison flags (but would then unnecessarily drop poison flags on FalseVal, because the implementation was mixing two different transforms).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87445



More information about the llvm-commits mailing list