]> granicus.if.org Git - llvm/commitdiff
[TargetLowering] Move shouldFoldShiftPairToMask next to preferShiftsToClearExtremeBit...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 10 Apr 2019 11:09:58 +0000 (11:09 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 10 Apr 2019 11:09:58 +0000 (11:09 +0000)
As discussed on PR41359, we're probably going to keep both of these but we need to make it more explicit how they complement each other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358071 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/TargetLowering.h

index 47ba76cbfdd5e72385b8d94b68be3b917e573694..a5e41962a12b405236c8a466246ded47e2cccc01 100644 (file)
@@ -534,6 +534,15 @@ public:
     return false;
   }
 
+  /// Return true if it is profitable to fold a pair of shifts into a mask.
+  /// This is usually true on most targets. But some targets, like Thumb1,
+  /// have immediate shift instructions, but no immediate "and" instruction;
+  /// this makes the fold unprofitable.
+  virtual bool shouldFoldShiftPairToMask(const SDNode *N,
+                                         CombineLevel Level) const {
+    return true;
+  }
+
   /// Should we tranform the IR-optimal check for whether given truncation
   /// down into KeptBits would be truncating or not:
   ///   (add %x, (1 << (KeptBits-1))) srccond (1 << KeptBits)
@@ -3138,15 +3147,6 @@ public:
     return true;
   }
 
-  /// Return true if it is profitable to fold a pair of shifts into a mask.
-  /// This is usually true on most targets. But some targets, like Thumb1,
-  /// have immediate shift instructions, but no immediate "and" instruction;
-  /// this makes the fold unprofitable.
-  virtual bool shouldFoldShiftPairToMask(const SDNode *N,
-                                         CombineLevel Level) const {
-    return true;
-  }
-
   // Return true if it is profitable to combine a BUILD_VECTOR with a stride-pattern
   // to a shuffle and a truncate.
   // Example of such a combine: