-
Notifications
You must be signed in to change notification settings - Fork 15.4k
machinebackend pass test #122487
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?
machinebackend pass test #122487
Conversation
|
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
|
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-backend-x86 Author: Kun Liu (Ryan-hub-bit) ChangesFull diff: https://github.com/llvm/llvm-project/pull/122487.diff 2 Files Affected:
diff --git a/llvm/lib/Target/X86/X86MatchJumptablePass.cpp b/llvm/lib/Target/X86/X86MatchJumptablePass.cpp
new file mode 100644
index 00000000000000..bfb6b1b7f89f18
--- /dev/null
+++ b/llvm/lib/Target/X86/X86MatchJumptablePass.cpp
@@ -0,0 +1,44 @@
+#include "X86.h"
+#include "llvm/CodeGen/MachineFunctionPass.h"
+#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/raw_ostream.h"
+
+
+using namespace llvm;
+
+namespace {
+ class X86MatchJumptablePass : public MachineFunctionPass {
+ public:
+ static char ID;
+
+ X86MatchJumptablePass() : MachineFunctionPass(ID) {}
+
+ bool runOnMachineFunction(MachineFunction &MF) override {
+ LLVM_DEBUG(dbgs() << "Running X86MyBackendPass on function: "
+ << MF.getName() << "\n");
+
+ // Example: Iterate through instructions
+ for (auto &MBB : MF) {
+ for (auto &MI : MBB) {
+ // Process instructions here
+ LLVM_DEBUG(dbgs() << "Instruction: " << MI << "\n");
+ }
+ }
+
+ return false; // Return true if the pass modifies the function
+ }
+
+ StringRef getPassName() const override {
+ return "X86 My Backend Pass";
+ }
+ };
+}
+
+char X86MatchJumptablePass::ID = 0;
+
+// Register the pass
+FunctionPass *llvm::createX86MatchJumptablePass() {
+ return new X86MatchJumptablePass();
+}
diff --git a/llvm/lib/Target/X86/X86MatchJumptablePass.h b/llvm/lib/Target/X86/X86MatchJumptablePass.h
new file mode 100644
index 00000000000000..e69de29bb2d1d6
|
|
@Ryan-hub-bit its better to only raise a PR once a patch branch is complete and ready for review - although if you're after early feedback its fine to make this a draft (as I've just done). |
a2bf26e to
9dd981b
Compare
No description provided.