[llvm] r277445 - [GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 04:41:03 PDT 2016


Author: ab
Date: Tue Aug  2 06:41:03 2016
New Revision: 277445

URL: http://llvm.org/viewvc/llvm-project?rev=277445&view=rev
Log:
[GlobalISel] Const-ify MachineInstrs passed to MachineLegalizer.

Modified:
    llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h
    llvm/trunk/lib/CodeGen/GlobalISel/MachineLegalizer.cpp

Modified: llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h?rev=277445&r1=277444&r2=277445&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h (original)
+++ llvm/trunk/include/llvm/CodeGen/GlobalISel/MachineLegalizer.h Tue Aug  2 06:41:03 2016
@@ -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;

Modified: llvm/trunk/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/MachineLegalizer.cpp?rev=277445&r1=277444&r2=277445&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/MachineLegalizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/MachineLegalizer.cpp Tue Aug  2 06:41:03 2016
@@ -94,11 +94,11 @@ MachineLegalizer::getAction(unsigned Opc
 }
 
 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;
 }
 




More information about the llvm-commits mailing list