From d280ea4f763786cfe037af6bc7baec0614017e97 Mon Sep 17 00:00:00 2001 From: Strahinja Petrovic Date: Wed, 21 Jun 2017 09:25:51 +0000 Subject: [MIPS] Fix for selecting of DINS/INS instruction This patch adds one more condition in selection DINS/INS instruction, which fixes MultiSource/Applications/JM/ldecod/ for mips32r2 (and mips64r2 n32 abi). Differential Revision: https://reviews.llvm.org/D33725 llvm-svn: 305888 --- llvm/lib/Target/Mips/MipsISelLowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Target') diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index 68708dc4f50..02102d6b22f 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -907,6 +907,11 @@ static SDValue performORCombine(SDNode *N, SelectionDAG &DAG, if (!(CN1 = dyn_cast(N->getOperand(1)))) return SDValue(); } + // Don't generate INS if constant OR operand doesn't fit into bits + // cleared by constant AND operand. + if (CN->getSExtValue() & CN1->getSExtValue()) + return SDValue(); + SDLoc DL(N); EVT ValTy = N->getOperand(0)->getValueType(0); SDValue Const1; -- cgit v1.2.3