summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/MSP430/MSP430ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/MSP430/MSP430ISelLowering.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
index 1ee5489f197..b6a658f30a8 100644
--- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
+++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp
@@ -37,6 +37,11 @@ using namespace llvm;
#define DEBUG_TYPE "msp430-lower"
+static cl::opt<bool>MSP430NoLegalImmediate(
+ "msp430-no-legal-immediate", cl::Hidden,
+ cl::desc("Enable non legal immediates (for testing purposes only)"),
+ cl::init(false));
+
MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
const MSP430Subtarget &STI)
: TargetLowering(TM) {
@@ -357,6 +362,15 @@ SDValue MSP430TargetLowering::LowerOperation(SDValue Op,
unsigned MSP430TargetLowering::getShiftAmountThreshold(EVT VT) const {
return 2;
}
+
+// Implemented to verify test case assertions in
+// tests/codegen/msp430/shift-amount-threshold-b.ll
+bool MSP430TargetLowering::isLegalICmpImmediate(int64_t Immed) const {
+ if (MSP430NoLegalImmediate)
+ return Immed >= -32 && Immed < 32;
+ return TargetLowering::isLegalICmpImmediate(Immed);
+}
+
//===----------------------------------------------------------------------===//
// MSP430 Inline Assembly Support
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud