[LegalizeTypes] Only expand CTLZ/CTTZ/CTPOP during type promotion if the new type...
authorCraig Topper <craig.topper@sifive.com>
Fri, 22 Oct 2021 17:38:53 +0000 (10:38 -0700)
committerCraig Topper <craig.topper@sifive.com>
Fri, 22 Oct 2021 18:02:35 +0000 (11:02 -0700)
commit93139a3c32660bc29ac91dea616aa2501f37c8cc
tree8327ed0e45476b5032267391a75b9dd44985aeba
parentd5074c7166647ea1abd78f5bb7fd876cbf0bb7d1
[LegalizeTypes] Only expand CTLZ/CTTZ/CTPOP during type promotion if the new type is legal.

We might be promoting a large non-power of 2 type and the new type
may need to be split. Once we split it we may have a ctlz/cttz/ctpop
instruction for the split type.

I'm also concerned that we may create large shifts with shift amounts
that are too small.
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp