[PATCH] D122268: Add PointerType analysis for DirectX backend

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 10:10:43 PDT 2022


nhaehnle added inline comments.


================
Comment at: llvm/lib/Target/DirectX/PointerTypeAnalysis.cpp:47
+      else if (PointeeTy != NewPointeeTy)
+        PointeeTy = Type::getInt8Ty(V->getContext());
+    }
----------------
beanz wrote:
> nhaehnle wrote:
> > I imagine this should be a TypedPointerType?
> It is meant to be the pointee type. In cases where the analysis detects more than one element type it falls back to an `i8*`, and relies on bitcasts being inserted.
Gotcha, thanks.


================
Comment at: llvm/lib/Target/DirectX/PointerTypeAnalysis.h:31
+/// migrated to a custom Type if PointerType loses typed support.
+namespace PointerTypeAnalysis {
+
----------------
beanz wrote:
> nhaehnle wrote:
> > Should the namespace be DxilPointerTypeAnalysis since it's target-specific? Also, given that a namespace is used, should the using declaration above be part of the namespace? I don't feel particularly strongly on either point.
> I put `TypedPointerType` in the `dxil` namespace, maybe that makes sense here too.
Yeah, that would make sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122268



More information about the llvm-commits mailing list