-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GISel]: Provide standard interface to observe changes in GISel passes
https://reviews.llvm.org/D54980 This provides a standard API across GISel passes to observe and notify passes about changes (insertions/deletions/mutations) to MachineInstrs. This patch also removes the recordInsertion method in MachineIRBuilder and instead provides method to setObserver. Reviewed by: vkeles. llvm-svn: 348406
- Loading branch information
Aditya Nandakumar
committed
Dec 5, 2018
1 parent
09415a8
commit f75d4f3
Showing
22 changed files
with
213 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
llvm/include/llvm/CodeGen/GlobalISel/GISelChangeObserver.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| //== ----- llvm/CodeGen/GlobalISel/GISelChangeObserver.h --------------------- | ||
| //== // | ||
| // | ||
| // The LLVM Compiler Infrastructure | ||
| // | ||
| // This file is distributed under the University of Illinois Open Source | ||
| // License. See LICENSE.TXT for details. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| /// This contains common code to allow clients to notify changes to machine | ||
| /// instr. | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
| #ifndef LLVM_CODEGEN_GLOBALISEL_GISELCHANGEOBSERVER_H | ||
| #define LLVM_CODEGEN_GLOBALISEL_GISELCHANGEOBSERVER_H | ||
|
|
||
| namespace llvm { | ||
| /// Abstract class that contains various methods for clients to notify about | ||
| /// changes. This should be the preferred way for APIs to notify changes. | ||
| /// Typically calling erasedInstr/createdInstr multiple times should not affect | ||
| /// the result. The observer would likely need to check if it was already | ||
| /// notified earlier (consider using GISelWorkList). | ||
| class MachineInstr; | ||
| class GISelChangeObserver { | ||
| public: | ||
| virtual ~GISelChangeObserver() {} | ||
|
|
||
| /// An instruction was erased. | ||
| virtual void erasedInstr(MachineInstr &MI) = 0; | ||
| /// An instruction was created and inserted into the function. | ||
| virtual void createdInstr(MachineInstr &MI) = 0; | ||
| /// This instruction was mutated in some way. | ||
| virtual void changedInstr(MachineInstr &MI) = 0; | ||
| }; | ||
|
|
||
| } // namespace llvm | ||
| #endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.