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 origin/main HEAD --extensions cpp,h,c --
clang/test/CodeGen/attr-counted-by-with-sanitizers.c
llvm/include/llvm/Transforms/Scalar/GVN.h llvm/lib/Transforms/Scalar/GVN.cpp
--diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Transforms/Scalar/GVN.h
b/llvm/include/llvm/Transforms/Scalar/GVN.h
index dd0fbcee1..938bb5e79 100644
--- a/llvm/include/llvm/Transforms/Scalar/GVN.h
+++ b/llvm/include/llvm/Transforms/Scalar/GVN.h
@@ -332,12 +332,12 @@ private:
Instruction *ElseI = nullptr;
WeakVH ElseB = nullptr;
};
-
+
/// A mapping from value numbers to a pair of instructions. This map
/// stores pairs of instructions with the same value number, from two blocks
/// having a single common predecessor, for the duration of a single top
level
/// iteration in `performHoist`.
- using HoistMap = DenseMap<uint32_t, HoistPair>;
+ using HoistMap = DenseMap<uint32_t, HoistPair>;
HoistMap HoistPairs;
public:
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp
b/llvm/lib/Transforms/Scalar/GVN.cpp
index 7a5764ccc..3363196ff 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -3726,7 +3726,8 @@ bool GVNPass::performPRE(Function &F) {
// Won't reorder above these instructions.
static bool isHoistBarrier(const Instruction &I) {
- return I.mayWriteToMemory() || I.mayHaveSideEffects() ||
!isGuaranteedToTransferExecutionToSuccessor(&I);
+ return I.mayWriteToMemory() || I.mayHaveSideEffects() ||
+ !isGuaranteedToTransferExecutionToSuccessor(&I);
}
static bool isHoistCandidate(const Instruction &I) {
@@ -3804,7 +3805,8 @@ void GVNPass::replaceInstruction(Instruction *I,
Instruction *Repl) {
// Each hoisted instruction must be paired with an instruction from the "else"
// block.
std::pair<bool, bool> GVNPass::hoistPair(BasicBlock *DestBB, BasicBlock
*ThenBB,
- BasicBlock *ElseBB, Instruction
*ThenI) {
+ BasicBlock *ElseBB,
+ Instruction *ThenI) {
// If the instruction is moved out of the "then" block there's nothing to do.
if (ThenI->getParent() != ThenBB)
return {false, false};
@@ -3828,11 +3830,11 @@ std::pair<bool, bool> GVNPass::hoistPair(BasicBlock
*DestBB, BasicBlock *ThenBB,
"Memory read/write instructions must not be hoisted.");
bool Change = false;
-
+
// Hoist the `Then` barrier, if any.
Instruction *ThenB = It->second.ThenB;
if (ThenB != nullptr && ThenB->getParent() == ThenBB) {
- auto [LocalChange, StopHoisting] = hoistPair(DestBB, ThenBB, ElseBB,
ThenB);
+ auto [LocalChange, StopHoisting] = hoistPair(DestBB, ThenBB, ElseBB,
ThenB);
Change |= LocalChange;
if (StopHoisting)
return {Change, true};
@@ -3842,7 +3844,7 @@ std::pair<bool, bool> GVNPass::hoistPair(BasicBlock
*DestBB, BasicBlock *ThenBB,
// block as a result of a previous hoisting.
if (dyn_cast_or_null<Instruction>(It->second.ElseB) != nullptr)
return {Change, true};
-
+
// Hoist operands. Begin by hoisting all of the operands of the "then"
// instruction, then check that all of the operands of the "else" instruction
// strictly dominate its block.
@@ -3947,7 +3949,6 @@ bool GVNPass::performHoist(Function &F) {
return Change;
}
-
/// runOnFunction - This is the main transformation entry point for a function.
bool GVNPass::runImpl(Function &F, AssumptionCache &RunAC, DominatorTree
&RunDT,
const TargetLibraryInfo &RunTLI, AAResults &RunAA,
``````````
</details>
https://github.com/llvm/llvm-project/pull/210330
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits