[PATCH] D108408: [InstCombine] Transform X == 0 ? 0 : X * Y --> X * freeze(Y).
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 25 11:51:41 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:744
+ !match(Constant::mergeUndefsWith(TrueValC, CmpRHS), m_Zero()) ||
+ !match(FalseVal, m_Mul(m_Value(X), m_Value(Y))))
+ return nullptr;
----------------
Should either check that the mul only has one use, or else make sure that other mul users get replaced with the new frozen form as well, to avoid having two muls.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108408/new/
https://reviews.llvm.org/D108408
More information about the llvm-commits
mailing list