[llvm] [HLSL] Adding DXIL Target type into `TypedInfo` (PR #164887)
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 24 15:23:01 PDT 2025
================
@@ -645,6 +647,8 @@ void ResourceTypeInfo::print(raw_ostream &OS, const DataLayout &DL) const {
} else if (isTyped()) {
TypedInfo Typed = getTyped();
OS << " Element Type: " << getElementTypeName(Typed.ElementTy) << "\n"
+ << " Storage Type: " << getElementTypeName(Typed.DXILStorageTy)
+ << "\n"
----------------
bogner wrote:
I think it'd be nicer for readability if we only include this when it's different, ie:
```c++
OS << " Element Type: " << getElementTypeName(Typed.ElementTy);
if (Typed.ElementTy != Typed.DXILStorageTy)
OS << " (stored as " << getElementTypeName(Typed.DXILStorageTy) << ")";
OS << "\n";
```
Either way, please add a case to `llvm/test/Analysis/DXILResource/buffer-frombinding.ll` that exercises this code.
https://github.com/llvm/llvm-project/pull/164887
More information about the llvm-commits
mailing list