[llvm] [llvm-mca] Add bottle-neck analysis to JSON output. (PR #90056)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 17 06:26:14 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 3b5a121a2478e586f59e3277d04d17fb63be5d76 74e3aef65d6f4c5a117697a440eaa1d9a42a53ed -- llvm/include/llvm/Transforms/Scalar/Float2Int.h llvm/lib/Transforms/Scalar/Float2Int.cpp llvm/tools/llvm-mca/Views/BottleneckAnalysis.cpp llvm/tools/llvm-mca/Views/BottleneckAnalysis.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/include/llvm/Transforms/Scalar/Float2Int.h b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
index 6922917624..ad994f6bf3 100644
--- a/llvm/include/llvm/Transforms/Scalar/Float2Int.h
+++ b/llvm/include/llvm/Transforms/Scalar/Float2Int.h
@@ -33,7 +33,8 @@ class OrderedInstruction {
unsigned int Order;
public:
- OrderedInstruction(Instruction *Inst, unsigned int Ord) : Ins(Inst), Order(Ord) {}
+ OrderedInstruction(Instruction *Inst, unsigned int Ord)
+ : Ins(Inst), Order(Ord) {}
Instruction *getInstruction() { return Ins; }
unsigned int getOrder() { return Order; }
@@ -71,7 +72,8 @@ private:
MapVector<Instruction *, ConstantRange> SeenInsts;
SmallSetVector<Instruction *, 8> Roots;
EquivalenceClasses<OrderedInstruction,
- OrderedInstructionLess<OrderedInstruction>> ECs;
+ OrderedInstructionLess<OrderedInstruction>>
+ ECs;
MapVector<Instruction *, unsigned int> InstructionOrders;
MapVector<Instruction *, Value *> ConvertedInsts;
LLVMContext *Ctx;
diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp
index cc69b78e32..a6db3ea171 100644
--- a/llvm/lib/Transforms/Scalar/Float2Int.cpp
+++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp
@@ -86,7 +86,7 @@ static Instruction::BinaryOps mapBinOpcode(unsigned Opcode) {
// Instruction order - return deterministic order suitable as set
// order for EquivalenceClasses.
-unsigned int Float2IntPass::insOrder(Instruction* I) {
+unsigned int Float2IntPass::insOrder(Instruction *I) {
static unsigned int order = 0;
if (InstructionOrders.find(I) != InstructionOrders.end())
return InstructionOrders[I];
@@ -201,7 +201,8 @@ void Float2IntPass::walkBackwards() {
for (Value *O : I->operands()) {
if (Instruction *OI = dyn_cast<Instruction>(O)) {
// Unify def-use chains if they interfere.
- ECs.unionSets(OrderedInstruction(I, insOrder(I)), OrderedInstruction(OI, insOrder(OI)));
+ ECs.unionSets(OrderedInstruction(I, insOrder(I)),
+ OrderedInstruction(OI, insOrder(OI)));
if (SeenInsts.find(I)->second != badRange())
Worklist.push_back(OI);
} else if (!isa<ConstantFP>(O)) {
@@ -403,7 +404,8 @@ bool Float2IntPass::validateAndTransform(const DataLayout &DL) {
}
}
- for (auto MI = ECs.member_begin(It), ME = ECs.member_end(); MI != ME; ++MI) {
+ for (auto MI = ECs.member_begin(It), ME = ECs.member_end(); MI != ME;
+ ++MI) {
OrderedInstruction OMI = *MI;
convert(OMI.getInstruction(), Ty);
}
@@ -497,7 +499,8 @@ void Float2IntPass::cleanup() {
bool Float2IntPass::runImpl(Function &F, const DominatorTree &DT) {
LLVM_DEBUG(dbgs() << "F2I: Looking at function " << F.getName() << "\n");
// Clear out all state.
- ECs = EquivalenceClasses<OrderedInstruction, OrderedInstructionLess<OrderedInstruction> >();
+ ECs = EquivalenceClasses<OrderedInstruction,
+ OrderedInstructionLess<OrderedInstruction>>();
SeenInsts.clear();
InstructionOrders.clear();
ConvertedInsts.clear();
``````````
</details>
https://github.com/llvm/llvm-project/pull/90056
More information about the llvm-commits
mailing list