[PATCH] D105423: Add support for Opaque as a LowLevelType

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 8 00:13:11 PDT 2021


pmatos added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineOperand.cpp:1055
+              ? LLT()
+              : (s == UINT64_C(0) ? LLT::opaque() : LLT::scalar(8 * s)),
+          a, AAInfo, Ranges, SSID, Ordering, FailureOrdering) {}
----------------
tlively wrote:
> If this was the problematic piece of code, I'm surprised `LLT::pointer` isn't used anywhere here. My model for `opaque` as used here is that it is a zero-sized pointer rather than a zero-sized scalar. Am I thinking about it incorrectly?
To be honest I was quite surprise as well when looked at it. I initially thought `LLT::scalar(8 * s)` should be a pointer instead. However, @arsenm added a call to the scalar constructor instead, and I followed the lead for `opaque`. My understanding here atm for the use of `LLT::scalar` for pointers is that this is the type representation of a pointer in memory - a scalar of a certain size, and not the representation of the value pointed to.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105423



More information about the llvm-commits mailing list