[PATCH] D91343: [InstCombine] Optimize away the unnecessary multi-use sign-extend
Jeroen Dobbelaere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 06:46:06 PST 2020
jeroen.dobbelaere added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp:922-925
+ // If this user is only demanding bits that we know, return the known
+ // constant.
+ if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
+ return Constant::getIntegerValue(ITy, Known.One);
----------------
Maybe this should be moved between line 904 and 906 ? (After the computKnownBits, but before checking the signextend pattern). This brings it more in line how the other cases are handled, preferring to return a constant when that is possible.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91343/new/
https://reviews.llvm.org/D91343
More information about the llvm-commits
mailing list