[PATCH] D60660: [InstCombine] Prune fshl/fshr with masked operands
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 14 03:03:32 PDT 2019
nikic added a comment.
The idea here looks reasonable to me, but this doesn't seem like the right place to make the transform. This is ultimately a demanded bits problem and as such should be handled in either BDCE or InstCombineSimplifyDemanded.
================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:2090
+ if (match(Op0, m_c_And(m_Value(), m_APInt(B)))) {
+ APInt D = dyn_cast<ConstantInt>(ShAmtC)->getValue();
+ uint64_t DLV = D.getLimitedValue();
----------------
You cannot assume that the ShAmtC is a ConstantInt here. It could also be a vector (something that should be covered in tests).
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60660/new/
https://reviews.llvm.org/D60660
More information about the llvm-commits
mailing list