[PATCH] D85053: [InstSimplify] Fold abs(abs(x)) -> abs(x)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 1 07:03:12 PDT 2020
spatel added a comment.
Will need update after:
rG04b99a4d18cf <https://reviews.llvm.org/rG04b99a4d18cf13c13f1d76c5698696bcaef4e4b6>
================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:5262
+ // on the outer abs.
+ if (auto *II = dyn_cast<IntrinsicInst>(Op0))
+ if (II->getIntrinsicID() == IID)
----------------
Could use match here to make this slightly more obvious:
if (match(Op0, m_Intrinsic<Intrinsic::abs>(m_Value(), m_Value())))
return Op0;
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85053/new/
https://reviews.llvm.org/D85053
More information about the llvm-commits
mailing list