[PATCH] D76753: [CorrelatedValuePropagation] Remove redundant if statement in processSelect()

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 01:35:34 PDT 2020


nikic accepted this revision.
nikic added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp:139
   if (!CI->isOne()) std::swap(ReplaceWith, Other);
-  if (ReplaceWith == S) ReplaceWith = UndefValue::get(S->getType());
 
----------------
Not really related to your change, but the use of swap here is pretty awkward, I'd write this as `Value *ReplaceWith = CI->isOne() ? S->getTrueValue() : S->getFalseValue()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76753





More information about the llvm-commits mailing list