@@ -854,8 +854,7 @@ SDValue SelectionDAG::getNOT(DebugLoc DL, SDValue Val, MVT VT) {
854
854
SDValue NegOneElt =
855
855
getConstant (APInt::getAllOnesValue (EltVT.getSizeInBits ()), EltVT);
856
856
std::vector<SDValue> NegOnes (VT.getVectorNumElements (), NegOneElt);
857
- NegOne = getNode (ISD::BUILD_VECTOR, DebugLoc::getUnknownLoc (), VT,
858
- &NegOnes[0 ], NegOnes.size ());
857
+ NegOne = getNode (ISD::BUILD_VECTOR, DL, VT, &NegOnes[0 ], NegOnes.size ());
859
858
} else {
860
859
NegOne = getConstant (APInt::getAllOnesValue (VT.getSizeInBits ()), VT);
861
860
}
@@ -2150,10 +2149,11 @@ bool SelectionDAG::isVerifiedDebugInfoDesc(SDValue Op) const {
2150
2149
// / element of the result of the vector shuffle.
2151
2150
SDValue SelectionDAG::getShuffleScalarElt (const SDNode *N, unsigned i) {
2152
2151
MVT VT = N->getValueType (0 );
2152
+ DebugLoc dl = N->getDebugLoc ();
2153
2153
SDValue PermMask = N->getOperand (2 );
2154
2154
SDValue Idx = PermMask.getOperand (i);
2155
2155
if (Idx.getOpcode () == ISD::UNDEF)
2156
- return getNode (ISD::UNDEF, VT.getVectorElementType ());
2156
+ return getNode (ISD::UNDEF, dl, VT.getVectorElementType ());
2157
2157
unsigned Index = cast<ConstantSDNode>(Idx)->getZExtValue ();
2158
2158
unsigned NumElems = PermMask.getNumOperands ();
2159
2159
SDValue V = (Index < NumElems) ? N->getOperand (0 ) : N->getOperand (1 );
@@ -2167,7 +2167,7 @@ SDValue SelectionDAG::getShuffleScalarElt(const SDNode *N, unsigned i) {
2167
2167
}
2168
2168
if (V.getOpcode () == ISD::SCALAR_TO_VECTOR)
2169
2169
return (Index == 0 ) ? V.getOperand (0 )
2170
- : getNode (ISD::UNDEF, VT.getVectorElementType ());
2170
+ : getNode (ISD::UNDEF, dl, VT.getVectorElementType ());
2171
2171
if (V.getOpcode () == ISD::BUILD_VECTOR)
2172
2172
return V.getOperand (Index);
2173
2173
if (V.getOpcode () == ISD::VECTOR_SHUFFLE)
@@ -2301,7 +2301,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2301
2301
Operand.getValueType ().isFloatingPoint () && " Invalid FP cast!" );
2302
2302
if (Operand.getValueType () == VT) return Operand; // noop conversion.
2303
2303
if (Operand.getOpcode () == ISD::UNDEF)
2304
- return getNode (ISD::UNDEF, VT);
2304
+ return getNode (ISD::UNDEF, DL, VT);
2305
2305
break ;
2306
2306
case ISD::SIGN_EXTEND:
2307
2307
assert (VT.isInteger () && Operand.getValueType ().isInteger () &&
@@ -2310,7 +2310,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2310
2310
assert (Operand.getValueType ().bitsLT (VT)
2311
2311
&& " Invalid sext node, dst < src!" );
2312
2312
if (OpOpcode == ISD::SIGN_EXTEND || OpOpcode == ISD::ZERO_EXTEND)
2313
- return getNode (OpOpcode, VT, Operand.getNode ()->getOperand (0 ));
2313
+ return getNode (OpOpcode, DL, VT, Operand.getNode ()->getOperand (0 ));
2314
2314
break ;
2315
2315
case ISD::ZERO_EXTEND:
2316
2316
assert (VT.isInteger () && Operand.getValueType ().isInteger () &&
@@ -2319,7 +2319,8 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2319
2319
assert (Operand.getValueType ().bitsLT (VT)
2320
2320
&& " Invalid zext node, dst < src!" );
2321
2321
if (OpOpcode == ISD::ZERO_EXTEND) // (zext (zext x)) -> (zext x)
2322
- return getNode (ISD::ZERO_EXTEND, VT, Operand.getNode ()->getOperand (0 ));
2322
+ return getNode (ISD::ZERO_EXTEND, DL, VT,
2323
+ Operand.getNode ()->getOperand (0 ));
2323
2324
break ;
2324
2325
case ISD::ANY_EXTEND:
2325
2326
assert (VT.isInteger () && Operand.getValueType ().isInteger () &&
@@ -2329,7 +2330,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2329
2330
&& " Invalid anyext node, dst < src!" );
2330
2331
if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND)
2331
2332
// (ext (zext x)) -> (zext x) and (ext (sext x)) -> (sext x)
2332
- return getNode (OpOpcode, VT, Operand.getNode ()->getOperand (0 ));
2333
+ return getNode (OpOpcode, DL, VT, Operand.getNode ()->getOperand (0 ));
2333
2334
break ;
2334
2335
case ISD::TRUNCATE:
2335
2336
assert (VT.isInteger () && Operand.getValueType ().isInteger () &&
@@ -2338,14 +2339,14 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2338
2339
assert (Operand.getValueType ().bitsGT (VT)
2339
2340
&& " Invalid truncate node, src < dst!" );
2340
2341
if (OpOpcode == ISD::TRUNCATE)
2341
- return getNode (ISD::TRUNCATE, VT, Operand.getNode ()->getOperand (0 ));
2342
+ return getNode (ISD::TRUNCATE, DL, VT, Operand.getNode ()->getOperand (0 ));
2342
2343
else if (OpOpcode == ISD::ZERO_EXTEND || OpOpcode == ISD::SIGN_EXTEND ||
2343
2344
OpOpcode == ISD::ANY_EXTEND) {
2344
2345
// If the source is smaller than the dest, we still need an extend.
2345
2346
if (Operand.getNode ()->getOperand (0 ).getValueType ().bitsLT (VT))
2346
- return getNode (OpOpcode, VT, Operand.getNode ()->getOperand (0 ));
2347
+ return getNode (OpOpcode, DL, VT, Operand.getNode ()->getOperand (0 ));
2347
2348
else if (Operand.getNode ()->getOperand (0 ).getValueType ().bitsGT (VT))
2348
- return getNode (ISD::TRUNCATE, VT, Operand.getNode ()->getOperand (0 ));
2349
+ return getNode (ISD::TRUNCATE, DL, VT, Operand.getNode ()->getOperand (0 ));
2349
2350
else
2350
2351
return Operand.getNode ()->getOperand (0 );
2351
2352
}
@@ -2356,16 +2357,16 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2356
2357
&& " Cannot BIT_CONVERT between types of different sizes!" );
2357
2358
if (VT == Operand.getValueType ()) return Operand; // noop conversion.
2358
2359
if (OpOpcode == ISD::BIT_CONVERT) // bitconv(bitconv(x)) -> bitconv(x)
2359
- return getNode (ISD::BIT_CONVERT, VT, Operand.getOperand (0 ));
2360
+ return getNode (ISD::BIT_CONVERT, DL, VT, Operand.getOperand (0 ));
2360
2361
if (OpOpcode == ISD::UNDEF)
2361
- return getNode (ISD::UNDEF, VT);
2362
+ return getNode (ISD::UNDEF, DL, VT);
2362
2363
break ;
2363
2364
case ISD::SCALAR_TO_VECTOR:
2364
2365
assert (VT.isVector () && !Operand.getValueType ().isVector () &&
2365
2366
VT.getVectorElementType () == Operand.getValueType () &&
2366
2367
" Illegal SCALAR_TO_VECTOR node!" );
2367
2368
if (OpOpcode == ISD::UNDEF)
2368
- return getNode (ISD::UNDEF, VT);
2369
+ return getNode (ISD::UNDEF, DL, VT);
2369
2370
// scalar_to_vector(extract_vector_elt V, 0) -> V, top bits are undefined.
2370
2371
if (OpOpcode == ISD::EXTRACT_VECTOR_ELT &&
2371
2372
isa<ConstantSDNode>(Operand.getOperand (1 )) &&
@@ -2376,14 +2377,14 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL,
2376
2377
case ISD::FNEG:
2377
2378
// -(X-Y) -> (Y-X) is unsafe because when X==Y, -0.0 != +0.0
2378
2379
if (UnsafeFPMath && OpOpcode == ISD::FSUB)
2379
- return getNode (ISD::FSUB, VT, Operand.getNode ()->getOperand (1 ),
2380
+ return getNode (ISD::FSUB, DL, VT, Operand.getNode ()->getOperand (1 ),
2380
2381
Operand.getNode ()->getOperand (0 ));
2381
2382
if (OpOpcode == ISD::FNEG) // --X -> X
2382
2383
return Operand.getNode ()->getOperand (0 );
2383
2384
break ;
2384
2385
case ISD::FABS:
2385
2386
if (OpOpcode == ISD::FNEG) // abs(-X) -> abs(X)
2386
- return getNode (ISD::FABS, VT, Operand.getNode ()->getOperand (0 ));
2387
+ return getNode (ISD::FABS, DL, VT, Operand.getNode ()->getOperand (0 ));
2387
2388
break ;
2388
2389
}
2389
2390
@@ -2473,7 +2474,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT,
2473
2474
N2.getOpcode () == ISD::BUILD_VECTOR) {
2474
2475
SmallVector<SDValue, 16 > Elts (N1.getNode ()->op_begin (), N1.getNode ()->op_end ());
2475
2476
Elts.insert (Elts.end (), N2.getNode ()->op_begin (), N2.getNode ()->op_end ());
2476
- return getNode (ISD::BUILD_VECTOR, VT, &Elts[0 ], Elts.size ());
2477
+ return getNode (ISD::BUILD_VECTOR, DL, VT, &Elts[0 ], Elts.size ());
2477
2478
}
2478
2479
break ;
2479
2480
case ISD::AND:
@@ -2599,7 +2600,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT,
2599
2600
case ISD::EXTRACT_VECTOR_ELT:
2600
2601
// EXTRACT_VECTOR_ELT of an UNDEF is an UNDEF.
2601
2602
if (N1.getOpcode () == ISD::UNDEF)
2602
- return getNode (ISD::UNDEF, VT);
2603
+ return getNode (ISD::UNDEF, DL, VT);
2603
2604
2604
2605
// EXTRACT_VECTOR_ELT of CONCAT_VECTORS is often formed while lowering is
2605
2606
// expanding copies of large vectors from registers.
@@ -2608,7 +2609,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT,
2608
2609
N1.getNumOperands () > 0 ) {
2609
2610
unsigned Factor =
2610
2611
N1.getOperand (0 ).getValueType ().getVectorNumElements ();
2611
- return getNode (ISD::EXTRACT_VECTOR_ELT, VT,
2612
+ return getNode (ISD::EXTRACT_VECTOR_ELT, DL, VT,
2612
2613
N1.getOperand (N2C->getZExtValue () / Factor),
2613
2614
getConstant (N2C->getZExtValue () % Factor,
2614
2615
N2.getValueType ()));
@@ -2629,7 +2630,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, DebugLoc DL, MVT VT,
2629
2630
// the original vector.
2630
2631
else if (isa<ConstantSDNode>(N1.getOperand (2 )) &&
2631
2632
isa<ConstantSDNode>(N2))
2632
- return getNode (ISD::EXTRACT_VECTOR_ELT, VT, N1.getOperand (0 ), N2);
2633
+ return getNode (ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand (0 ), N2);
2633
2634
}
2634
2635
break ;
2635
2636
case ISD::EXTRACT_ELEMENT:
@@ -2990,7 +2991,8 @@ static SDValue getMemsetStringVal(MVT VT, SelectionDAG &DAG,
2990
2991
static SDValue getMemBasePlusOffset (SDValue Base, unsigned Offset,
2991
2992
SelectionDAG &DAG) {
2992
2993
MVT VT = Base.getValueType ();
2993
- return DAG.getNode (ISD::ADD, VT, Base, DAG.getConstant (Offset, VT));
2994
+ return DAG.getNode (ISD::ADD, Base.getNode ()->getDebugLoc (),
2995
+ VT, Base, DAG.getConstant (Offset, VT));
2994
2996
}
2995
2997
2996
2998
// / isMemSrcFromString - Returns true if memcpy source is a string constant.
@@ -4932,7 +4934,7 @@ SDNode *SelectionDAG::getTargetNode(unsigned Opcode, DebugLoc dl,
4932
4934
MVT VT1, MVT VT2, MVT VT3,
4933
4935
const SDValue *Ops, unsigned NumOps) {
4934
4936
const MVT *VTs = getNodeValueTypes (VT1, VT2, VT3);
4935
- return getNode (~Opcode, VTs, 3 , Ops, NumOps).getNode ();
4937
+ return getNode (~Opcode, dl, VTs, 3 , Ops, NumOps).getNode ();
4936
4938
}
4937
4939
4938
4940
SDNode *SelectionDAG::getTargetNode (unsigned Opcode, MVT VT1,
0 commit comments