[PATCH] D62818: [InstCombine] Allow ((X << Y) & SignMask) != 0 to be optimized as (X << Y) s< 0.
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 14:22:15 PDT 2019
lebedev.ri added a comment.
In D62818#1529921 <https://reviews.llvm.org/D62818#1529921>, @huihuiz wrote:
> The other approach could be changing the order of folding. Move foldICmpBinOpEqualityWithConstant to the very beginning of foldICmpInstWithConstant.
> foldICmpBinOpEqualityWithConstant has rules to replace (and X, (1 << size(X)-1) != 0) with x s< 0.
> Let me know if this approach is more preferable?
You want (1+1*2)*2 = 6 folds: https://rise4fun.com/Alive/Y8Ct
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62818/new/
https://reviews.llvm.org/D62818
More information about the llvm-commits
mailing list