[PATCH] D72001: CodeGen: Use LLT instead of EVT in getRegisterByName

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 10:16:37 PST 2020


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:2255-2257
+  EVT VT = Op->getValueType(0);
+  LLT Ty = getLLTForType(*VT.getTypeForEVT(*CurDAG->getContext()),
+                         CurDAG->getDataLayout());
----------------
arsenm wrote:
> jyknight wrote:
> > It feels weird to have to go up through IR Type to convert between two lower-level kinds of type representation. Shouldn't there be a function to go directly EVT->LLT?
> Well, the desired end state is for EVT to not exist so I don't really want to put in the (somewhat small) work to write a proper conversion function. I could maybe stick this in a wrapper somewhere. It feels like a layering violation anywhere I could put it, but I suppose putting it in LowLevelType.h would work.
Another problem is you can't really accurately go back from EVT to LLT, as EVT discards pointerness. This isn't solving the problem here, but the lack of a convenient conversion forces you to think about this


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72001/new/

https://reviews.llvm.org/D72001





More information about the llvm-commits mailing list