Skip to content

Commit 010c535

Browse files
committed
address comments
1 parent 48a0201 commit 010c535

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

llvm/include/llvm/Analysis/DXILResource.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,11 @@ class DXILBindingMap {
448448

449449
/// Resolves a resource handle into a vector of ResourceBindingInfos that
450450
/// represent the possible unique creations of the handle. Certain cases are
451-
/// ambiguous so mulitple creation instructions may be returned. The resulting
451+
/// ambiguous so multiple creation instructions may be returned. The resulting
452452
/// ResourceBindingInfo can be used to depuplicate unique handles that
453453
/// reference the same resource
454454
SmallVector<dxil::ResourceBindingInfo>
455-
findCreationInfo(const Value *Key) const;
455+
findByUse(const Value *Key) const;
456456

457457
const_iterator find(const CallInst *Key) const {
458458
auto Pos = CallMap.find(Key);

llvm/lib/Analysis/DXILResource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,11 @@ void DXILBindingMap::print(raw_ostream &OS, DXILResourceTypeMap &DRTM,
771771
}
772772

773773
SmallVector<dxil::ResourceBindingInfo>
774-
DXILBindingMap::findCreationInfo(const Value *Key) const {
774+
DXILBindingMap::findByUse(const Value *Key) const {
775775
if (const PHINode *Phi = dyn_cast<PHINode>(Key)) {
776776
SmallVector<dxil::ResourceBindingInfo> Children;
777777
for (const Value *V : Phi->operands()) {
778-
Children.append(findCreationInfo(V));
778+
Children.append(findByUse(V));
779779
}
780780
return Children;
781781
}
@@ -803,7 +803,7 @@ DXILBindingMap::findCreationInfo(const Value *Key) const {
803803
if (V->getType() != UseType)
804804
continue;
805805

806-
Children.append(findCreationInfo(V));
806+
Children.append(findByUse(V));
807807
}
808808

809809
return Children;

llvm/unittests/Target/DirectX/UniqueResourceFromUseTests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ declare void @a.func(target("dx.RawBuffer", float, 1, 0) %handle)
7373
for (const User *U : F.users()) {
7474
const CallInst *CI = cast<CallInst>(U);
7575
const Value *Handle = CI->getArgOperand(0);
76-
const auto Bindings = DBM.findCreationInfo(Handle);
76+
const auto Bindings = DBM.findByUse(Handle);
7777
ASSERT_EQ(Bindings.size(), 1u)
7878
<< "Handle should resolve into one resource";
7979

@@ -123,7 +123,7 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
123123
for (const User *U : F.users()) {
124124
const CallInst *CI = cast<CallInst>(U);
125125
const Value *Handle = CI->getArgOperand(0);
126-
const auto Bindings = DBM.findCreationInfo(Handle);
126+
const auto Bindings = DBM.findByUse(Handle);
127127
ASSERT_EQ(Bindings.size(), 1u)
128128
<< "Handle should resolve into one resource";
129129

@@ -176,7 +176,7 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
176176
for (const User *U : F.users()) {
177177
const CallInst *CI = cast<CallInst>(U);
178178
const Value *Handle = CI->getArgOperand(0);
179-
const auto Bindings = DBM.findCreationInfo(Handle);
179+
const auto Bindings = DBM.findByUse(Handle);
180180
ASSERT_EQ(Bindings.size(), 4u)
181181
<< "Handle should resolve into four resources";
182182

@@ -256,7 +256,7 @@ declare target("dx.RawBuffer", float, 1, 0) @ind.func(target("dx.RawBuffer", flo
256256
for (const User *U : F.users()) {
257257
const CallInst *CI = cast<CallInst>(U);
258258
const Value *Handle = CI->getArgOperand(0);
259-
const auto Bindings = DBM.findCreationInfo(Handle);
259+
const auto Bindings = DBM.findByUse(Handle);
260260
ASSERT_EQ(Bindings.size(), 2u)
261261
<< "Handle should resolve into four resources";
262262

0 commit comments

Comments
 (0)