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

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 6 09:47:08 PST 2020


jyknight 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());
----------------
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?


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:14785-14789
+  if ((isPPC64 && VT != S64 && VT != S32) ||
+      (!isPPC64 && VT != S32))
     report_fatal_error("Invalid register global variable type");
 
+  bool is64Bit = isPPC64 && VT == S64;
----------------
This seems weirdly-worded. How about:
```
bool is64Bit = isPPC64 && VT == LLT::scalar(64);
if (!is64Bit && VT != LLT::scalar(32)) report_fatal_error...;
```


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

https://reviews.llvm.org/D72001





More information about the llvm-commits mailing list