From: Simon Pilgrim Date: Wed, 10 Apr 2019 11:09:58 +0000 (+0000) Subject: [TargetLowering] Move shouldFoldShiftPairToMask next to preferShiftsToClearExtremeBit... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=677f061542a6eb05369e0f032224ceae456a0580;p=llvm [TargetLowering] Move shouldFoldShiftPairToMask next to preferShiftsToClearExtremeBits. NFCI. 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 --- diff --git a/include/llvm/CodeGen/TargetLowering.h b/include/llvm/CodeGen/TargetLowering.h index 47ba76cbfdd..a5e41962a12 100644 --- a/include/llvm/CodeGen/TargetLowering.h +++ b/include/llvm/CodeGen/TargetLowering.h @@ -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: