[llvm-commits] [PATCH] Fix bugs in promotion code for CTPOP and fiends
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sun Jul 12 12:33:50 CDT 2009
On 12/07/2009, at 19.23, Eli Friedman wrote:
> 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
>> 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.
Nope, the same bugs were there before your refactoring.
> 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.
Me neither. I will soon be submitting a blackfin back-end that uses
this code. Testcases will be included.
More information about the llvm-commits