Skip to content

Commit c73d2a3

Browse files
committed
[DirectX] Drop dx.Layout extension type
TODO: This must go in after the frontend changes
1 parent 29843c0 commit c73d2a3

File tree

3 files changed

+0
-116
lines changed

3 files changed

+0
-116
lines changed

llvm/include/llvm/Analysis/DXILResource.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -222,27 +222,6 @@ class AnyResourceExtType : public TargetExtType {
222222
}
223223
};
224224

225-
/// The dx.Layout target extension type
226-
///
227-
/// `target("dx.Layout", <Type>, <size>, [offsets...])`
228-
class LayoutExtType : public TargetExtType {
229-
public:
230-
LayoutExtType() = delete;
231-
LayoutExtType(const LayoutExtType &) = delete;
232-
LayoutExtType &operator=(const LayoutExtType &) = delete;
233-
234-
Type *getWrappedType() const { return getTypeParameter(0); }
235-
uint32_t getSize() const { return getIntParameter(0); }
236-
uint32_t getOffsetOfElement(int I) const { return getIntParameter(I + 1); }
237-
238-
static bool classof(const TargetExtType *T) {
239-
return T->getName() == "dx.Layout";
240-
}
241-
static bool classof(const Type *T) {
242-
return isa<TargetExtType>(T) && classof(cast<TargetExtType>(T));
243-
}
244-
};
245-
246225
/// The dx.Padding target extension type
247226
///
248227
/// `target("dx.Padding", NumBytes)`

llvm/lib/Analysis/DXILResource.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -380,13 +380,6 @@ StructType *ResourceTypeInfo::createElementStruct(StringRef CBufferName) {
380380
Name.append(CBufferName);
381381
}
382382

383-
// TODO: Remove this when we update the frontend to use explicit padding.
384-
if (LayoutExtType *LayoutType =
385-
dyn_cast<LayoutExtType>(RTy->getResourceType())) {
386-
StructType *Ty = cast<StructType>(LayoutType->getWrappedType());
387-
return StructType::create(Ty->elements(), Name);
388-
}
389-
390383
return getOrCreateElementStruct(
391384
getTypeWithoutPadding(RTy->getResourceType()), Name);
392385
}
@@ -498,13 +491,7 @@ ResourceTypeInfo::UAVInfo ResourceTypeInfo::getUAV() const {
498491

499492
uint32_t ResourceTypeInfo::getCBufferSize(const DataLayout &DL) const {
500493
assert(isCBuffer() && "Not a CBuffer");
501-
502494
Type *ElTy = cast<CBufferExtType>(HandleTy)->getResourceType();
503-
504-
// TODO: Remove this when we update the frontend to use explicit padding.
505-
if (auto *LayoutTy = dyn_cast<LayoutExtType>(ElTy))
506-
return LayoutTy->getSize();
507-
508495
return DL.getTypeAllocSize(ElTy);
509496
}
510497

llvm/test/CodeGen/DirectX/Metadata/cbuffer-layouttype.ll

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)