[llvm] r244067 - [AArch64] Register AArch64DeadRegisterDefinition pass with LLVM pass manager.
Chad Rosier
mcrosier at codeaurora.org
Wed Aug 5 10:35:34 PDT 2015
Author: mcrosier
Date: Wed Aug 5 12:35:34 2015
New Revision: 244067
URL: http://llvm.org/viewvc/llvm-project?rev=244067&view=rev
Log:
[AArch64] Register AArch64DeadRegisterDefinition pass with LLVM pass manager.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp?rev=244067&r1=244066&r2=244067&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64DeadRegisterDefinitionsPass.cpp Wed Aug 5 12:35:34 2015
@@ -26,6 +26,12 @@ using namespace llvm;
STATISTIC(NumDeadDefsReplaced, "Number of dead definitions replaced");
+namespace llvm {
+void initializeAArch64DeadRegisterDefinitionsPass(PassRegistry &);
+}
+
+#define AARCH64_DEAD_REG_DEF_NAME "AArch64 Dead register definitions"
+
namespace {
class AArch64DeadRegisterDefinitions : public MachineFunctionPass {
private:
@@ -35,11 +41,14 @@ private:
bool usesFrameIndex(const MachineInstr &MI);
public:
static char ID; // Pass identification, replacement for typeid.
- explicit AArch64DeadRegisterDefinitions() : MachineFunctionPass(ID) {}
+ explicit AArch64DeadRegisterDefinitions() : MachineFunctionPass(ID) {
+ initializeAArch64DeadRegisterDefinitionsPass(
+ *PassRegistry::getPassRegistry());
+ }
bool runOnMachineFunction(MachineFunction &F) override;
- const char *getPassName() const override { return "Dead register definitions"; }
+ const char *getPassName() const override { return AARCH64_DEAD_REG_DEF_NAME; }
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.setPreservesCFG();
@@ -49,6 +58,9 @@ public:
char AArch64DeadRegisterDefinitions::ID = 0;
} // end anonymous namespace
+INITIALIZE_PASS(AArch64DeadRegisterDefinitions, "aarch64-dead-defs",
+ AARCH64_DEAD_REG_DEF_NAME, false, false)
+
bool AArch64DeadRegisterDefinitions::implicitlyDefinesOverlappingReg(
unsigned Reg, const MachineInstr &MI) {
for (const MachineOperand &MO : MI.implicit_operands())
More information about the llvm-commits
mailing list