[llvm-dev] [CodeGen] RFC Changing the default operation action for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 24 23:08:38 PDT 2016


I'd like to change the default operation action for CTLZ_ZERO_UNDEF and
CTTZ_ZERO_UNDEF to Expand in TargetLoweringBase. This will make LegalizeDAG
automatically turn them into CTLZ and CTTZ.

For the in-tree targets, only AMDGPU and X86 have cases where these
instructions should be the current default value of Legal. There a few
cases where targets set them to Custom. But most targets set them to Expand
to have LegalizeDAG convert them.

This change would allow us to remove all the setOperationAction calls to
make them Expand on most targets and adds a few calls to setOperationAction
on X86 and AMDGPU to make them Legal again for certain cases.

This could affect out of tree targets, but its easy to fix any out of tree
targets that rely on the current default Legal value. Any out of tree
targets that were already setting them to Expand will to continue to work,
but just have redundant code.

Any objections?

-- 
~Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160424/632930c0/attachment.html>


More information about the llvm-dev mailing list