[PATCH] D37348: Implement custom lowering for ISD::CTTZ_ZERO_UNDEF and ISD::CTTZ.

Wei Ding via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 09:07:19 PDT 2017


wdng marked 2 inline comments as done.
wdng added inline comments.


================
Comment at: lib/Target/AMDGPU/AMDGPUISelLowering.cpp:420
   if (Subtarget->hasFFBL())
-    setOperationAction(ISD::CTTZ_ZERO_UNDEF, MVT::i32, Legal);
 
----------------
arsenm wrote:
> This should definitely remain legal
I think it doesn't matter to define it as Custom, because it will be converted to FFBL_U32 during the custom lowering and then pattern matching to the ffbl instruction anyway at the end. However, if we defined it as Legal, we will have a "duplicate" or "extra" pattern (FFBL_U32 and CTTZ_ZERO_UNDEF) for generating the ffbl instruction. Is there any specific reason that I neglect here that we have to define it as Legal?


Repository:
  rL LLVM

https://reviews.llvm.org/D37348





More information about the llvm-commits mailing list