Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register re-allocation tweaks #340

Merged
merged 7 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions llvm/lib/Target/AIE/AIE2TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
// (c) Copyright 2023-2025 Advanced Micro Devices, Inc. or its affiliates
//
//===----------------------------------------------------------------------===//
//
Expand All @@ -27,10 +27,6 @@ cl::opt<bool>
EnableSubregRenaming("aie-subreg-renaming", cl::Hidden, cl::init(false),
cl::desc("Enable RenameIndependentSubregs pass"));

static cl::opt<bool>
EnableWAWRegRewrite("aie-wawreg-rewrite",
cl::desc("Enable the WAW Register Renaming in loops"),
cl::init(true), cl::Hidden);
static cl::opt<bool>
EnableReservedRegsLICM("aie-reserved-regs-licm", cl::Hidden, cl::init(true),
cl::desc("Enable LICM for some reserved registers"));
Expand All @@ -45,6 +41,7 @@ extern cl::opt<bool> EnableStagedRA;
extern cl::opt<bool> EnableSuperRegSplitting;
extern cl::opt<bool> AllocateMRegsFirst;
extern cl::opt<bool> EnablePreMISchedCoalescer;
extern cl::opt<bool> EnableWAWRegRewrite;

extern bool AIEDumpArtifacts;

Expand Down Expand Up @@ -161,8 +158,10 @@ bool AIE2PassConfig::addRegAssignAndRewriteOptimized() {
addPass(createAIESuperRegRewriter());
}
addPass(createGreedyRegisterAllocator());
if (EnableWAWRegRewrite)
if (EnableWAWRegRewrite) {
addPass(createAIEWawRegRewriter());
addPass(createGreedyRegisterAllocator());
martien-de-jong marked this conversation as resolved.
Show resolved Hide resolved
F-Stuckmann marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Collaborator

@F-Stuckmann F-Stuckmann Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should greedy also run after createAIEWawRegRewriter in AIE2p?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely, in general, the AIEWawRegRewriter pass does not even run for AIE2p. I assumed that the pass pipeline is shared, but that part is not. Good catch!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new commit for AIE2p

}
addPass(createVirtRegRewriter());

return true;
Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/Target/AIE/AIEBaseTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ cl::opt<bool>
EnableStagedRA("aie-staged-ra", cl::Hidden, cl::init(true),
cl::desc("Enable multi-stage register allocation"));

cl::opt<bool>
EnableWAWRegRewrite("aie-wawreg-rewrite",
cl::desc("Enable the WAW Register Renaming in loops"),
cl::init(true), cl::Hidden);

cl::opt<bool>
EnableSuperRegSplitting("aie-split-superregs", cl::Hidden, cl::init(true),
cl::desc("Enable splitting super-regs into their "
Expand Down
Loading