[PATCH] D37348: Tighten conditions for converting ISD::CTTZ_ZERO_UNDEF to ISD::CTTZ

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 09:53:14 PDT 2017


craig.topper added a comment.

If v_ffbl is able to produce a defined answer of bit width for 0, then you want to match it with cttz and have the operation action for cttz_zero_undef set to Expand. That will turn all cttz_zero_undef calls into cttz.

If v_ffbl is not capable of handling zero, then you want cttz_zero_undef set to Legal, and cttz set to Expand which will make use of cttz_zero_undef and a select. Or you can make cttz Custom and do your own lowering.


Repository:
  rL LLVM

https://reviews.llvm.org/D37348





More information about the llvm-commits mailing list