[LLVMdev] Predicate registers/condition codes question

Sebastian Pop spop at codeaurora.org
Mon Jun 4 09:41:43 PDT 2012


On Mon, Jun 4, 2012 at 11:22 AM, Sebastian Pop <spop at codeaurora.org> wrote:
>> Why don't you call it with "Promote" instead of
>> "Custom" and let the Legalizer do the job? Does it not work?
>
> I tried this, and the legalizer will happily say that i8 is a legal type
> and just return the exact same node: this is because we declared
> that Hexagon has a register for i8, that makes i8 legal for all
> promotions.

As Hal mentioned, the problem is linked to the fact that type legalization
happens before register class assignments.

One way to solve this problem would be to teach type legalization about
the predicate register class: if a processor can perform only boolean
arithmetic it would declare a type to be in the PredRegs class, whereas
a processor that can do both integer and boolean arithmetic on a type
would declare the register to be in both the IntRegs and PredRegs class,
or just in the IntRegs class.

Opinions?  How hard is it to teach type legalization about register classes?

Thanks,
Sebastian
--
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum



More information about the llvm-dev mailing list