summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-08-25 17:37:32 +0000
committerTim Northover <tnorthover@apple.com>2016-08-25 17:37:32 +0000
commit438c77ca1adf6ea29d25f5c53336dacff5ac5a21 (patch)
tree57bf2922a37cd74ee96e67eb31b9081ff3a7fe61 /llvm/include
parent2c4a838e241fa078b24811d81bfe87513d40d903 (diff)
downloadbcm5719-llvm-438c77ca1adf6ea29d25f5c53336dacff5ac5a21.tar.gz
bcm5719-llvm-438c77ca1adf6ea29d25f5c53336dacff5ac5a21.zip
GlobalISel: perform multi-step legalization
llvm-svn: 279758
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h11
-rw-r--r--llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizeHelper.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
index a067262bd68..cdd2c84f593 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
@@ -21,6 +21,8 @@
#include "llvm/CodeGen/LowLevelType.h"
#include "llvm/IR/DebugLoc.h"
+#include <queue>
+
namespace llvm {
// Forward declarations.
@@ -47,6 +49,8 @@ class MachineIRBuilder {
bool Before;
/// @}
+ std::function<void(MachineInstr *)> InsertedInstr;
+
const TargetInstrInfo &getTII() {
assert(TII && "TargetInstrInfo is not set");
return *TII;
@@ -86,6 +90,13 @@ public:
void setInstr(MachineInstr &MI, bool Before = true);
/// @}
+ /// Control where instructions we create are recorded (typically for
+ /// visiting again later during legalization).
+ /// @{
+ void recordInsertions(std::function<void(MachineInstr *)> InsertedInstr);
+ void stopRecordingInsertions();
+ /// @}
+
/// Set the debug location to \p DL for all the next build instructions.
void setDebugLoc(const DebugLoc &DL) { this->DL = DL; }
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizeHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizeHelper.h
index 9252dd94f0d..d2b1d88d530 100644
--- a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizeHelper.h
+++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizeHelper.h
@@ -55,6 +55,9 @@ public:
///
/// Considered as an opaque blob, the legal code will use and define the same
/// registers as \p MI.
+ LegalizeResult legalizeInstrStep(MachineInstr &MI,
+ const MachineLegalizer &Legalizer);
+
LegalizeResult legalizeInstr(MachineInstr &MI,
const MachineLegalizer &Legalizer);
OpenPOWER on IntegriCloud