[llvm] [InstCombine][AMDGPU] Disable PtrReplacer when select has mismatch AS. (PR #98456)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 03:10:35 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 5a20a07fce88d54cf01cafde489bfc2fc447acc0 31200c87a953eb90565851eebb61d0e319a998d2 --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 8a31512a0f..7eb8110ee0 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -296,7 +296,8 @@ bool PointerReplacer::FoundASC(const Value *Op) const {
Op = TI->getOperand(0);
else if (TI)
Op = TI->getOperand(1);
- else break;
+ else
+ break;
}
return false;
}
@@ -312,10 +313,8 @@ bool PointerReplacer::hasConflictingAS(const Instruction *I) const {
bool FoundFalseASC = FoundASC(FI);
bool HasConflictingAS = !FoundFalseASC || !FoundTrueASC;
- LLVM_DEBUG(
- dbgs() << "HasConflictingAS: " << HasConflictingAS
- << "{ False: " << FoundFalseASC
- << ", True: " << FoundTrueASC << " }\n");
+ LLVM_DEBUG(dbgs() << "HasConflictingAS: " << HasConflictingAS << "{ False: "
+ << FoundFalseASC << ", True: " << FoundTrueASC << " }\n");
return HasConflictingAS;
}
@@ -379,7 +378,8 @@ bool PointerReplacer::collectUsersRecursive(Instruction &I) {
auto *TruePtr = dyn_cast<PointerType>(SI->getTrueValue()->getType());
auto *FalsePtr = dyn_cast<PointerType>(SI->getFalseValue()->getType());
if (TruePtr && FalsePtr) {
- if (!IC.isValidAddrSpaceCast(TruePtr->getAddressSpace(), FalsePtr->getAddressSpace()))
+ if (!IC.isValidAddrSpaceCast(TruePtr->getAddressSpace(),
+ FalsePtr->getAddressSpace()))
ValuesToRevisitAS.insert(SI);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/98456
More information about the llvm-commits
mailing list