Skip to content

Commit f12a6bf

Browse files
committed
fixup: Add comment and fix test function signature
1 parent fc7ffe1 commit f12a6bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Target/DirectX/DXILResourceAccess.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ static void replaceTypedBufferAccess(IntrinsicInst *II,
2929
assert(HandleType->getName() == "dx.TypedBuffer" &&
3030
"Unexpected typed buffer type");
3131
Type *ContainedType = HandleType->getTypeParameter(0);
32+
33+
// We need the size of an element in bytes so that we can calculate the offset
34+
// in elements given a total offset in bytes later.
3235
Type *ScalarType = ContainedType->getScalarType();
3336
uint64_t ScalarSize = DL.getTypeSizeInBits(ScalarType) / 8;
34-
int NumElements = ContainedType->getNumContainedTypes();
35-
if (!NumElements)
36-
NumElements = 1;
3737

3838
// Process users keeping track of indexing accumulated from GEPs.
3939
struct AccessAndIndex {

llvm/test/CodeGen/DirectX/ResourceAccess/load_typedbuffer.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
target triple = "dxil-pc-shadermodel6.6-compute"
44

55
declare void @use_float4(<4 x float>)
6-
declare void @use_float(<4 x float>)
6+
declare void @use_float(float)
77

88
; CHECK-LABEL: define void @load_float4
99
define void @load_float4(i32 %index, i32 %elemindex) {

0 commit comments

Comments
 (0)