[llvm] [DirectX] Add Resource uses to Resource Handle map in DXILResourceMap (PR #112798)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 17 16:32:37 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 2b6b7f664d9c93877ce6678820255fc006d56b54 43918466eb1bc4e238154332a060167376734421 --extensions cpp,h -- llvm/include/llvm/Analysis/DXILResource.h llvm/lib/Analysis/DXILResource.cpp llvm/lib/Target/DirectX/DXILOpLowering.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Analysis/DXILResource.h b/llvm/include/llvm/Analysis/DXILResource.h
index abd0e8e918..016e45e78c 100644
--- a/llvm/include/llvm/Analysis/DXILResource.h
+++ b/llvm/include/llvm/Analysis/DXILResource.h
@@ -340,7 +340,7 @@ public:
void updateResourceMap(CallInst *origCallInst, CallInst *newCallInst);
- void updateResUseMap(CallInst* origResUse, CallInst* newResUse) {
+ void updateResUseMap(CallInst *origResUse, CallInst *newResUse) {
assert((origResUse != nullptr) && (newResUse != nullptr) &&
(origResUse != newResUse) && "Wrong Inputs");
@@ -349,13 +349,15 @@ public:
CallInst *findResHandleByUse(CallInst *resUse) {
auto Pos = ResUseToHandleMap.find(resUse);
- assert((Pos != ResUseToHandleMap.end()) && "Can't find the resource handle");
+ assert((Pos != ResUseToHandleMap.end()) &&
+ "Can't find the resource handle");
return Pos->second;
}
private:
- void updateResUseMapCommon(CallInst *origResUse, CallInst *newResUse, bool keepOrigResUseInMap) {
+ void updateResUseMapCommon(CallInst *origResUse, CallInst *newResUse,
+ bool keepOrigResUseInMap) {
ResUseToHandleMap.try_emplace(newResUse, findResHandleByUse(origResUse));
if (!keepOrigResUseInMap)
ResUseToHandleMap.erase(origResUse);
diff --git a/llvm/lib/Analysis/DXILResource.cpp b/llvm/lib/Analysis/DXILResource.cpp
index 801cb0aa98..d512cbda35 100644
--- a/llvm/lib/Analysis/DXILResource.cpp
+++ b/llvm/lib/Analysis/DXILResource.cpp
@@ -760,8 +760,7 @@ void DXILResourceMap::updateResourceMap(CallInst *origCallInst,
// Update ResUseToHandleMap since Resource Handle changed
for (auto it = origCallInst->users().begin();
- it != origCallInst->users().end();
- ++it) {
+ it != origCallInst->users().end(); ++it) {
CallInst *CI_Use = dyn_cast<CallInst>(*it);
ResUseToHandleMap[CI_Use] = newCallInst;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/112798
More information about the llvm-commits
mailing list