[llvm-commits] [PATCH] Add support for promoting integer SETCC
Eli Friedman
eli.friedman at gmail.com
Fri Jul 24 00:57:06 PDT 2009
On Thu, Jul 23, 2009 at 11:13 PM, Jakob Stoklund Olesen<stoklund at 2pi.dk> wrote:
>
> On 17/07/2009, at 11.09, Jakob Stoklund Olesen wrote:
>
>> The attached patch adds support for promoting integer SETCC in
>> PromoteNode. Blackfin has i16 and i32 as legal types, but it only
>> supports i32 SETCC.
>>
>> Also add isBeforeLegalizeOps() to DAGCombinerInfo so
>> TargetLowering::SimplifySetCC() knows when it can insert illegal
>> SETCCs.
>>
>> Fix one case of a bad SETCC created by
>> TargetLowering::SimplifySetCC() after LegalizeOps. There may be
>> others, but I have not been able to tease them out in a test case. I
>> have a test case for this as part of my Blackfin back-end.
>>
>> Patch passes "make check", please review.
>
> OK to commit?
+ case ISD::SETULE: {
+ MVT newVT = N0.getOperand(0).getValueType();
+ if (DCI.isBeforeLegalizeOps() ||
+ isOperationLegalOrCustom(ISD::SETCC, newVT))
This doesn't actually guarantee that the given operation is legal... I
think you want something more like "isOperationLegal(ISD::SETCC,
newVT) && getCondCodeAction(Cond, newVT) == Legal".
The other changes look fine.
-Eli
More information about the llvm-commits
mailing list