[PATCH] D29478: [GlobalISel] Generate selector with predicates; use it for FP binops.

Ahmed Bougacha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 10:04:31 PST 2017


ab added a comment.

In https://reviews.llvm.org/D29478#667093, @dsanders wrote:

> In https://reviews.llvm.org/D29478#666554, @ab wrote:
>
> > In the meantime, what do you folks think?
>
>
> IIRC, SelectionDAG only uses the Predicate class and the MC layer only uses AssemblerPredicate. It's probably safest to stick to that but there's some advantages to the AssemblerPredicate way so it makes sense to make use that approach in GlobalISel where possible. The main one I see is that it's possible to test multiple predicates simultaneously. If we do use AssemblerPredicates in GlobalISel, we shouldn't continue to call it AssemblerPredicate though.


You're right on all points.  I was thinking we could split AssemblerPredicate into something like SubtargetFeaturePredicate and AssemblerPredicate:  what's interesting to us is that AssemblerPredicates only need an MCSubtargetInfo.  SDAG Predicates have arbitrarily weird code that we will never be able to support in the general case.

> I should mention that AArch64 has a few Predicates (e.g. IsLE) that don't have an AssemblerPredicate. We'll need to fix that. Also, Mips has an AssemblerPredicate that lacks a Predicate because it only makes sense to the assembly (UseTCCInDiv).

These Predicates should probably also have a way of defining GISel equivalence.


https://reviews.llvm.org/D29478





More information about the llvm-commits mailing list