[LLVMdev] [global-isel] Simplifying the simplifier
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sun Aug 11 10:26:01 PDT 2013
On Aug 11, 2013, at 4:14 AM, "Nuno Lopes" <nunoplopes at sapo.pt> wrote:
>> This sounds promising. But we have some requirements that textbook rewriting systems can't handle:
>>
>> - Expressions are DAGs, not trees.
>> - Targets can add custom rewriting rules and override standard rules.
>> - Rules will have predicates. Some predicates are static and only depend on the subtarget, some predicates will depend on the pattern being matched.
>> - The system won't be convergent if you ignore all the predicates.
>>
>> So the question is, given those requirements, can we still prove termination?
>
> Uhm, I'm not sure about the custom target rules, since most likely a bunch of them will need to be specified in C++, and then they will be a black box to the tool..
I think that SelectionDAG forces you to drop to C++ too soon, but we'll always need that possibility.
> Regarding the predicates, how complicated are these? Aren't these expressions mostly in linear integer arithmetic? Or can you have arbitrary calls to complex C++ code?
There are too many static predicates, so it isn't feasible to enumerate all possible combinations, but we can expose their relationships to the tool as boolean expressions. For example, X86 currently has:
def HasCMov : Predicate<"Subtarget->hasCMov()">;
def NoCMov : Predicate<"!Subtarget->hasCMov()">;
It would be simple to define:
def NoCMov : Predicate<(not HasCMov)>;
And the tool would be able to infer that the predicates are disjoint. Similarly:
def : Always<(or HasSSE1, (not HasSSE2))>;
can be used to infer an implication.
Many pattern predicates could be expressed in a DSL, but we should still make it possible to use C++ code.
Thanks,
/jakob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130811/e91c18b2/attachment.html>
More information about the llvm-dev
mailing list