diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-08-02 11:41:03 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-08-02 11:41:03 +0000 |
commit | f49ab9af2c776465291db05a7b29b1b7f0f00241 (patch) | |
tree | 8fe89a4ec2ba312dd53a415bf6f80332e5c3155b | |
parent | da2a58dd0b261d6af2ecca61f549ab2bd8135ec6 (diff) | |
download | bcm5719-llvm-f49ab9af2c776465291db05a7b29b1b7f0f00241.tar.gz bcm5719-llvm-f49ab9af2c776465291db05a7b29b1b7f0f00241.zip |
[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.
llvm-svn: 277445
-rw-r--r-- | llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h index 1ba1a75f32f..29398e87207 100644 --- a/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h @@ -101,7 +101,7 @@ public: /// \returns a pair consisting of the kind of legalization that should be /// performed and the destination type. std::pair<LegalizeAction, LLT> getAction(unsigned Opcode, LLT) const; - std::pair<LegalizeAction, LLT> getAction(MachineInstr &MI) const; + std::pair<LegalizeAction, LLT> getAction(const MachineInstr &MI) const; /// Iterate the given function (typically something like doubling the width) /// on Ty until we find a legal type for this operation. @@ -128,7 +128,7 @@ public: return std::make_pair(Action, findLegalType(Opcode, Ty, Action)); } - bool isLegal(MachineInstr &MI) const; + bool isLegal(const MachineInstr &MI) const; private: typedef DenseMap<std::pair<unsigned, LLT>, LegalizeAction> ActionMap; diff --git a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp index 600f7bc5973..6856ed57a0b 100644 --- a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp +++ b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp @@ -94,11 +94,11 @@ MachineLegalizer::getAction(unsigned Opcode, LLT Ty) const { } std::pair<MachineLegalizer::LegalizeAction, LLT> -MachineLegalizer::getAction(MachineInstr &MI) const { +MachineLegalizer::getAction(const MachineInstr &MI) const { return getAction(MI.getOpcode(), MI.getType()); } -bool MachineLegalizer::isLegal(MachineInstr &MI) const { +bool MachineLegalizer::isLegal(const MachineInstr &MI) const { return getAction(MI).first == Legal; } |