[PATCH] D23282: [IR/GlobalISel] move compare predicates into lib/Support

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 12:02:41 PDT 2016


On 16 August 2016 at 11:40, Mehdi AMINI <mehdi.amini at apple.com> wrote:
> I think you are creating actually a dependency from GlobalISel to the IR as soon as you want a one-to-one mapping like that and reuse the list.

In the current view I would be, but an alternative view (taken by this
patch) is that LLVM is going to have a canonical Predicate
representation, shared by both IR and (generic) MIR. I don't think
there's anything exclusively IRish about either the predicate
representation or the operations you can do on it (ISelDAG has
developed a separate version with essentially identical
functionality).

> Just moving it in a separate library just for the purpose of not including llvm/IR/ seems like very artificial to me

What I find most suspect isn't actually the llvm/IR headers (they're
expected during ISel, as you say) but that the reference would always
be via a CmpInst in the current world, even though there may no longer
be any CmpInsts around anywhere.

If we're aiming for a world where MIR is a first-class citizen (and I
think we are), then any back-reference to IR after the IRTranslator
phase should be considered a wart.

Tim.


More information about the llvm-commits mailing list