From 08bbd35a80bf7765fe0d3043f9eb5a2f2786b649 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 26 Jun 2017 20:32:52 +0000 Subject: Vendor import of llvm trunk r306325: https://llvm.org/svn/llvm-project/llvm/trunk@306325 --- lib/Target/Mips/MipsISelLowering.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Target/Mips/MipsISelLowering.cpp') diff --git a/lib/Target/Mips/MipsISelLowering.cpp b/lib/Target/Mips/MipsISelLowering.cpp index 68708dc4f50f..02102d6b22f4 100644 --- a/lib/Target/Mips/MipsISelLowering.cpp +++ b/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