[PATCH] D9284: Avoid double branch / conditional move for promoted cttz
Marcin KoĆcielnicki via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 20 07:17:59 PDT 2016
koriakin added a subscriber: koriakin.
koriakin added a comment.
Looks good, but there's room for a minor improvement still - see inline comment.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:4051
@@ +4050,3 @@
+ if (Node->getOpcode() == ISD::CTTZ) {
+ Tmp1 = DAG.getNode(ISD::OR, dl, NVT, Tmp1, DAG.getConstant(1 << OVT.getSizeInBits(), NVT));
+ }
----------------
Another trick that can be added here: operation can now be safely changed to CTTZ_UNDEF.
http://reviews.llvm.org/D9284
More information about the llvm-commits
mailing list