From ed581eac6acca8048124f2e51d68e92f7c1d934b Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Tue, 2 Aug 2016 14:42:55 +0000 Subject: [PATCH] [GlobalISel] Require isSSA in GISel passes. The GISel passes don't make sense on non-SSA functions. All GISel tests already set isSSA. Enforce that. llvm-svn: 277464 --- llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h | 5 +++++ llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizePass.h | 5 +++++ llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h index 3d33e7a..fcc85b5 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h @@ -30,6 +30,11 @@ public: static char ID; const char *getPassName() const override { return "InstructionSelect"; } + MachineFunctionProperties getRequiredProperties() const override { + return MachineFunctionProperties() + .set(MachineFunctionProperties::Property::IsSSA); + } + InstructionSelect(); bool runOnMachineFunction(MachineFunction &MF) override; diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizePass.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizePass.h index e1cc32a..4bb503a 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizePass.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizePass.h @@ -43,6 +43,11 @@ public: return "MachineLegalizePass"; } + MachineFunctionProperties getRequiredProperties() const override { + return MachineFunctionProperties().set( + MachineFunctionProperties::Property::IsSSA); + } + bool runOnMachineFunction(MachineFunction &MF) override; }; } // End namespace llvm. diff --git a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h index b393744..db8d483 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/RegBankSelect.h @@ -584,6 +584,11 @@ public: void getAnalysisUsage(AnalysisUsage &AU) const override; + MachineFunctionProperties getRequiredProperties() const override { + return MachineFunctionProperties() + .set(MachineFunctionProperties::Property::IsSSA); + } + /// Walk through \p MF and assign a register bank to every virtual register /// that are still mapped to nothing. /// The target needs to provide a RegisterBankInfo and in particular -- 2.7.4