Add const to CanBeFoldedBy, CheckAndMask, and CheckOrMask.
authorDan Gohman <gohman@apple.com>
Tue, 24 Jul 2007 23:00:27 +0000 (23:00 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 24 Jul 2007 23:00:27 +0000 (23:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40480 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAGISel.h
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp

index 497040d55b6b86f7d49202e9cbae5c7001cadb62..047da7c92d94e2235ed4c2a7c8debc1648cf8973 100644 (file)
@@ -74,7 +74,9 @@ public:
 
   /// CanBeFoldedBy - Returns true if the specific operand node N of U can be
   /// folded during instruction selection that starts at Root?
-  virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) { return true;}
+  virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const {
+    return true;
+  }
   
   /// CreateTargetHazardRecognizer - Return a newly allocated hazard recognizer
   /// to use for this target when scheduling the DAG.
@@ -164,8 +166,10 @@ protected:
                                      SelectionDAG &DAG);
 
   // Calls to these predicates are generated by tblgen.
-  bool CheckAndMask(SDOperand LHS, ConstantSDNode *RHS, int64_t DesiredMaskS);  
-  bool CheckOrMask(SDOperand LHS, ConstantSDNode *RHS, int64_t DesiredMaskS);  
+  bool CheckAndMask(SDOperand LHS, ConstantSDNode *RHS,
+                    int64_t DesiredMaskS) const;
+  bool CheckOrMask(SDOperand LHS, ConstantSDNode *RHS,
+                    int64_t DesiredMaskS) const;
   
 private:
   void SelectBasicBlock(BasicBlock *BB, MachineFunction &MF,
index 9256faabeb1548e6baa2b3e08c32fa73bef3d667..05578fe31cdebb91c9249f01bececd0c9742aca8 100644 (file)
@@ -4799,7 +4799,7 @@ HazardRecognizer *SelectionDAGISel::CreateTargetHazardRecognizer() {
 /// actual value in the DAG on the RHS of an AND, and DesiredMaskS is the value
 /// specified in the .td file (e.g. 255).
 bool SelectionDAGISel::CheckAndMask(SDOperand LHS, ConstantSDNode *RHS, 
-                                    int64_t DesiredMaskS) {
+                                    int64_t DesiredMaskS) const {
   uint64_t ActualMask = RHS->getValue();
   uint64_t DesiredMask =DesiredMaskS & MVT::getIntVTBitMask(LHS.getValueType());
   
@@ -4828,7 +4828,7 @@ bool SelectionDAGISel::CheckAndMask(SDOperand LHS, ConstantSDNode *RHS,
 /// actual value in the DAG on the RHS of an OR, and DesiredMaskS is the value
 /// specified in the .td file (e.g. 255).
 bool SelectionDAGISel::CheckOrMask(SDOperand LHS, ConstantSDNode *RHS, 
-                                    int64_t DesiredMaskS) {
+                                    int64_t DesiredMaskS) const {
   uint64_t ActualMask = RHS->getValue();
   uint64_t DesiredMask =DesiredMaskS & MVT::getIntVTBitMask(LHS.getValueType());
   
index 8b1690c05f58923f33fa32435196aee600435785..5eb51361b8f4e1c8419344f8eab2a68c9f895642 100644 (file)
@@ -132,7 +132,7 @@ namespace {
 
     virtual void EmitFunctionEntryCode(Function &Fn, MachineFunction &MF);
 
-    virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root);
+    virtual bool CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const;
 
 // Include the pieces autogenerated from the target description.
 #include "X86GenDAGISel.inc"
@@ -272,7 +272,7 @@ static inline bool isNonImmUse(SDNode *Root, SDNode *Def, SDNode *ImmedUse,
 }
 
 
-bool X86DAGToDAGISel::CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) {
+bool X86DAGToDAGISel::CanBeFoldedBy(SDNode *N, SDNode *U, SDNode *Root) const {
   if (FastISel) return false;
 
   // If U use can somehow reach N through another path then U can't fold N or