Skip to content

Commit fccbe5c

Browse files
committed
addressing bogner comments
1 parent c5bb883 commit fccbe5c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

llvm/include/llvm/Analysis/DXILResource.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ class ResourceTypeInfo {
293293

294294
struct TypedInfo {
295295
dxil::ElementType ElementTy;
296-
// Some 64 byte types are treated as 32 byte types in DXIL.
297296
dxil::ElementType DXILTargetTy;
298297
uint32_t ElementCount;
299298

llvm/lib/Analysis/DXILResource.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,11 @@ static dxil::ElementType toDXILElementType(Type *Ty, bool IsSigned) {
206206
return ElementType::Invalid;
207207
}
208208

209-
static dxil::ElementType toDXILTargetType(Type *Ty, bool IsSigned) {
209+
static dxil::ElementType toDXILTargetType(dxil::ElementType ET) {
210210
// TODO: Handle unorm, snorm, and packed.
211-
Type *ScalarTy = Ty->getScalarType();
212-
if (ScalarTy->isIntegerTy(64) || ScalarTy->isDoubleTy())
213-
return ElementType::U32;
214-
return toDXILElementType(Ty, IsSigned);
211+
if (ET == dxil::ElementType::U64 || ET == dxil::ElementType::F64)
212+
return dxil::ElementType::U32;
213+
return ET;
215214
}
216215

217216
ResourceTypeInfo::ResourceTypeInfo(TargetExtType *HandleTy,
@@ -577,7 +576,7 @@ ResourceTypeInfo::TypedInfo ResourceTypeInfo::getTyped() const {
577576

578577
auto [ElTy, IsSigned] = getTypedElementType(Kind, HandleTy);
579578
dxil::ElementType ET = toDXILElementType(ElTy, IsSigned);
580-
dxil::ElementType DXILTargetTy = toDXILTargetType(ElTy, IsSigned);
579+
dxil::ElementType DXILTargetTy = toDXILTargetType(ET);
581580
uint32_t Count = 1;
582581
if (auto *VTy = dyn_cast<FixedVectorType>(ElTy))
583582
Count = VTy->getNumElements();

0 commit comments

Comments
 (0)