[PATCH] D30046: [globalisel] Change LLT constructor string into an LLT subclass that knows how to generate it.

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 16 09:28:03 PST 2017


dsanders added a comment.

In https://reviews.llvm.org/D30046#678788, @ab wrote:

> This is a layering violation, and that's a big no-no.  For instance, it woudln't be too hard to break the tblgen link by doing NFC changes to LLT.
>
> I think the least bad option is to move the self-contained parts of LLT to some llvm/Support/LowLevelType.h, and put the Type* <> LLT conversions in llvm/CodeGen/LowLevelType.h, which would just include llvm/Support/LowLevelType.h.
>
> And MVT isn't a good example to follow, in part because it's header-only, IIRC completely self-contained, and IIRC doesn't reference IR Type at all.


The main difficulty I'm having with splitting it is functions like:

  static LLT scalar(unsigned SizeInBits);

and other functions that return LLT. I need them to exist in both lib/CodeGen and lib/Support but I can't distribute the class declaration between the two.


https://reviews.llvm.org/D30046





More information about the llvm-commits mailing list