-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[NFC][RA] Refactor RABasic into a Separate Header #149555
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
base: main
Are you sure you want to change the base?
Conversation
This change refactors the RABasic type by moving it from RegAllocBasic.cpp to a new header file, RegAllocBasic.h. This separation of header and implementation aligns with the structure used by other register allocators, such as RegAllocGreedy. The refactoring is intended to facilitate future use of RABasic in other contexts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle I'm fine with this. What's the uses you have in mind? Will it be used upstream?
llvm/lib/CodeGen/RegAllocBasic.h
Outdated
// This file declares the RABasic class, which provides a minimal | ||
// implementation of the basic register allocator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use syntax recognized by doxygen (and possibly fix the pre-existing problem in RegAllocBasic.cpp)
// This file declares the RABasic class, which provides a minimal | |
// implementation of the basic register allocator. | |
/// \file This file declares the RABasic class, which provides a minimal | |
/// implementation of the basic register allocator. |
llvm/lib/CodeGen/RegAllocBasic.h
Outdated
#ifndef LLVM_CODEGEN_REGALLOCBAISC_H_ | ||
#define LLVM_CODEGEN_REGALLOCBAISC_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifndef LLVM_CODEGEN_REGALLOCBAISC_H_ | |
#define LLVM_CODEGEN_REGALLOCBAISC_H_ | |
#ifndef LLVM_CODEGEN_REGALLOCBASIC_H | |
#define LLVM_CODEGEN_REGALLOCBASIC_H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
most files tend to use LLVM_LIB_CODEGEN_XXXX_H
it seems...
llvm/lib/CodeGen/RegAllocBasic.h
Outdated
static char ID; | ||
}; | ||
} // namespace llvm | ||
#endif // #ifndef LLVM_CODEGEN_REGALLOCBAISC_H_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#endif // #ifndef LLVM_CODEGEN_REGALLOCBAISC_H_ | |
#endif |
llvm/lib/CodeGen/RegAllocBasic.h
Outdated
#include "llvm/CodeGen/LiveIntervals.h" | ||
#include "llvm/CodeGen/LiveRangeEdit.h" | ||
#include "llvm/CodeGen/LiveRegMatrix.h" | ||
#include "llvm/CodeGen/MachineFunctionPass.h" | ||
#include "llvm/CodeGen/Spiller.h" | ||
#include "llvm/CodeGen/VirtRegMap.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check which include files are actually needed, and which ones can be replaced with class xxx;
forward declarations. LiveRegMatrix
and VirtRegMap
seem unused at a first glance...
This change refactors the RABasic type by moving it from RegAllocBasic.cpp to a new header file, RegAllocBasic.h. This separation of header and implementation aligns with the structure used by other register allocators, such as RegAllocGreedy. The refactoring is intended to facilitate future use of RABasic in other contexts.