Only PPC seems to be using it, and only checks some simple cases and
doesn't distinguish between FP. Just switch to using LLT to simplify
use from GlobalISel.
Details
Diff Detail
Event Timeline
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
2255–2257 | 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? | |
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
14802–14806 | This seems weirdly-worded. How about: bool is64Bit = isPPC64 && VT == LLT::scalar(64); if (!is64Bit && VT != LLT::scalar(32)) report_fatal_error...; |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
2255–2257 | 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. |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
2255–2257 | 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 |
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | ||
---|---|---|
2255–2257 | Well, it didn't force me to think about it...how would I have recognized that as a potential problem by reading the series of calls getLLTForType(getTypeForEVT(...))? It would be more obvious if the nonexistent function "getLLTForEVT" had a docstring noting that it cannot return a pointer LLT, since EVT doesn't represent those, and that if you might need one, you'll need to do something else. (here it's of course fine, since this function can only be called with integral types.) |
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?