Craig Topper via llvm-dev
2016-Apr-25 06:08 UTC
[llvm-dev] [CodeGen] RFC Changing the default operation action for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand
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>
Chandler Carruth via llvm-dev
2016-Apr-25 06:15 UTC
[llvm-dev] [CodeGen] RFC Changing the default operation action for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand
LGTM, although I suspect others' opinions are more relevant than mine... On Mon, Apr 25, 2016 at 2:08 AM Craig Topper <craig.topper at gmail.com> wrote:> 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/20160425/e4f4d26d/attachment.html>
Renato Golin via llvm-dev
2016-Apr-25 08:51 UTC
[llvm-dev] [CodeGen] RFC Changing the default operation action for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF to Expand
On 25 April 2016 at 07:08, Craig Topper via llvm-dev <llvm-dev at lists.llvm.org> wrote:> 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.Hi Craig, I'm assuming that change will consider the legal types in the target. AArch64 sets both 32 and 64 to Expand, while ARM only sets 32, for obvious reasons. This seems like an NFC, so LGTM. :) cheers, --renato