[SelectionDAG] Enable CTPOP optimization fine tuning
authorDavid Zarzycki <dave@znu.io>
Wed, 28 Oct 2020 11:18:09 +0000 (07:18 -0400)
committerDavid Zarzycki <dave@znu.io>
Mon, 9 Nov 2020 18:49:01 +0000 (13:49 -0500)
commita41ea782c8e1273af4a39a647e41d6f0f42c3411
tree46aa40b936ada1a9b13e2112cab60cba44e94b46
parent1bbf87e22a73011fdea411baf8fe768f854d497c
[SelectionDAG] Enable CTPOP optimization fine tuning

Add a TLI hook to allow SelectionDAG to fine tune the conversion of CTPOP to a chain of "x & (x - 1)" when CTPOP isn't legal.

A subsequent patch will attempt to fine tune the X86 code gen.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D89952
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp