bug 20542

Tim Northover t.p.northover at gmail.com
Tue Aug 19 05:21:19 PDT 2014


Hi Norman,

On 19 August 2014 13:09, Norman Rink <nrink at broadcom.com> wrote:
> I am not sure what you mean by "consistent with getBooleanContents()". The whole point of "isSetCCEquivalent" seems to be to check that this is the case. How do you propose to modify "isSetCCEquivalent"?

Exactly, I don't think isSetCCEquivalent is the problem (though it may
have a bug I've overlooked). Within the block, we know that's returned
true so the result must be boolean.

The only case I can think of where the existing code can produce wrong
results is if your target has ZeroOrNegativeOneContents. It can also
be optimised slightly in the UndefinedContents case.

You could probably do something cunning like this to fix it:

    if (N1C && TLI->isConstTrueValue(N1C) && isSetCCEquivalent(N0,
LHS, RHS, CC)) {

(exploiting the fact that isConstTrueValue performs precisely the
optimal checks on N1C, taking account of BooleanContents).

Cheers.

Tim.



More information about the llvm-commits mailing list