[PATCH] D48970: [DAGCombiner] extend(ifpositive(X)) -> shift-right (not X)
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 6 00:10:34 PDT 2018
lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.
Code looks good, but i can't comment on the test changes.
================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:8006
+ // Invert and smear the sign bit:
+ // sext i1 (setgt iN X, -1) --> sra (not X), (N - 1)
+ // zext i1 (setgt iN X, -1) --> srl (not X), (N - 1)
----------------
We are assuming that we won't get `setge <>, 0`, because some dagcombine already canonicalizes that?
https://reviews.llvm.org/D48970
More information about the llvm-commits
mailing list