[llvm-commits] [PATCH] Fix bugs in promotion code for CTPOP and fiends

Eli Friedman eli.friedman at gmail.com
Sun Jul 12 10:23:58 PDT 2009


On Sun, Jul 12, 2009 at 6:26 AM, Jakob Stoklund Olesen<stoklund at 2pi.dk> wrote:
> SelectionDAGLegalize::PromoteNode() has code to promote CTPOP, CTLZ, and
> CTTZ operations. I don't think that code has ever been used, it contains
> some trivial bugs in the value types used.
>
> The attached patch fixes these issues, so the operation is performed as NVT,
> and then truncated back to OVT.
>
> The blackfin processor has a CTPOP instruction for i32 registers only. The
> promotion code is needed to support CTPOP for i16 registers as well.
>
> Please review before I commit.

Hmm... it's possible I introduced some bugs while I was refactoring
the relevant code.  In any case, looks fine.  (I would suggest adding
a testcase, but I can't think of any existing target that needs this
kind of promotion.

-Eli



More information about the llvm-commits mailing list