@@ -19206,7 +19206,7 @@ SDValue X86TargetLowering::LowerJumpTable(SDValue Op, SelectionDAG &DAG) const {
19206
19206
// global base reg.
19207
19207
unsigned char OpFlag = Subtarget.classifyLocalReference(nullptr);
19208
19208
19209
- auto PtrVT = getPointerTy(DAG.getDataLayout() );
19209
+ EVT PtrVT = Op.getValueType( );
19210
19210
SDValue Result = DAG.getTargetJumpTable(JT->getIndex(), PtrVT, OpFlag);
19211
19211
SDLoc DL(JT);
19212
19212
Result =
@@ -19234,7 +19234,7 @@ X86TargetLowering::LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const {
19234
19234
const BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress();
19235
19235
int64_t Offset = cast<BlockAddressSDNode>(Op)->getOffset();
19236
19236
SDLoc dl(Op);
19237
- auto PtrVT = getPointerTy(DAG.getDataLayout() );
19237
+ EVT PtrVT = Op.getValueType( );
19238
19238
SDValue Result = DAG.getTargetBlockAddress(BA, PtrVT, Offset, OpFlags);
19239
19239
Result =
19240
19240
DAG.getNode(getGlobalWrapperKind(nullptr, OpFlags), dl, PtrVT, Result);
@@ -19277,7 +19277,7 @@ SDValue X86TargetLowering::LowerGlobalOrExternal(SDValue Op, SelectionDAG &DAG,
19277
19277
bool NeedsLoad = isGlobalStubReference(OpFlags);
19278
19278
19279
19279
CodeModel::Model M = DAG.getTarget().getCodeModel();
19280
- auto PtrVT = getPointerTy(DAG.getDataLayout() );
19280
+ EVT PtrVT = Op.getValueType( );
19281
19281
SDValue Result;
19282
19282
19283
19283
if (GV) {
@@ -19536,7 +19536,7 @@ X86TargetLowering::LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const {
19536
19536
return LowerToTLSEmulatedModel(GA, DAG);
19537
19537
19538
19538
const GlobalValue *GV = GA->getGlobal();
19539
- auto PtrVT = getPointerTy(DAG.getDataLayout() );
19539
+ EVT PtrVT = Op.getValueType( );
19540
19540
bool PositionIndependent = isPositionIndependent();
19541
19541
19542
19542
if (Subtarget.isTargetELF()) {
@@ -25782,7 +25782,7 @@ X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
25782
25782
Chain = DAG.getCALLSEQ_START(Chain, 0, 0, dl);
25783
25783
25784
25784
bool Is64Bit = Subtarget.is64Bit();
25785
- MVT SPTy = getPointerTy(DAG.getDataLayout() );
25785
+ MVT SPTy = Op.getValueType().getSimpleVT( );
25786
25786
25787
25787
SDValue Result;
25788
25788
if (!Lower) {
@@ -25850,7 +25850,9 @@ X86TargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
25850
25850
25851
25851
SDValue X86TargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG) const {
25852
25852
MachineFunction &MF = DAG.getMachineFunction();
25853
- auto PtrVT = getPointerTy(MF.getDataLayout());
25853
+ SDValue Ptr = Op.getOperand(1);
25854
+ EVT PtrVT = Ptr.getValueType();
25855
+
25854
25856
X86MachineFunctionInfo *FuncInfo = MF.getInfo<X86MachineFunctionInfo>();
25855
25857
25856
25858
const Value *SV = cast<SrcValueSDNode>(Op.getOperand(2))->getValue();
@@ -25861,8 +25863,7 @@ SDValue X86TargetLowering::LowerVASTART(SDValue Op, SelectionDAG &DAG) const {
25861
25863
// vastart just stores the address of the VarArgsFrameIndex slot into the
25862
25864
// memory location argument.
25863
25865
SDValue FR = DAG.getFrameIndex(FuncInfo->getVarArgsFrameIndex(), PtrVT);
25864
- return DAG.getStore(Op.getOperand(0), DL, FR, Op.getOperand(1),
25865
- MachinePointerInfo(SV));
25866
+ return DAG.getStore(Op.getOperand(0), DL, FR, Ptr, MachinePointerInfo(SV));
25866
25867
}
25867
25868
25868
25869
// __va_list_tag:
@@ -25951,7 +25952,7 @@ SDValue X86TargetLowering::LowerVAARG(SDValue Op, SelectionDAG &DAG) const {
25951
25952
DAG.getTargetConstant(ArgSize, dl, MVT::i32),
25952
25953
DAG.getTargetConstant(ArgMode, dl, MVT::i8),
25953
25954
DAG.getTargetConstant(Align, dl, MVT::i32)};
25954
- SDVTList VTs = DAG.getVTList(getPointerTy(DAG.getDataLayout() ), MVT::Other);
25955
+ SDVTList VTs = DAG.getVTList(SrcPtr.getValueType( ), MVT::Other);
25955
25956
SDValue VAARG = DAG.getMemIntrinsicNode(
25956
25957
Subtarget.isTarget64BitLP64() ? X86ISD::VAARG_64 : X86ISD::VAARG_X32, dl,
25957
25958
VTs, InstOps, MVT::i64, MachinePointerInfo(SV),
@@ -26272,9 +26273,6 @@ static SDValue recoverFramePointer(SelectionDAG &DAG, const Function *Fn,
26272
26273
MachineFunction &MF = DAG.getMachineFunction();
26273
26274
SDLoc dl;
26274
26275
26275
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
26276
- MVT PtrVT = TLI.getPointerTy(DAG.getDataLayout());
26277
-
26278
26276
// It's possible that the parent function no longer has a personality function
26279
26277
// if the exceptional code was optimized away, in which case we just return
26280
26278
// the incoming EBP.
@@ -26285,6 +26283,7 @@ static SDValue recoverFramePointer(SelectionDAG &DAG, const Function *Fn,
26285
26283
// registration, or the .set_setframe offset.
26286
26284
MCSymbol *OffsetSym = MF.getContext().getOrCreateParentFrameOffsetSymbol(
26287
26285
GlobalValue::dropLLVMManglingEscape(Fn->getName()));
26286
+ MVT PtrVT = EntryEBP.getValueType().getSimpleVT();
26288
26287
SDValue OffsetSymVal = DAG.getMCSymbol(OffsetSym, PtrVT);
26289
26288
SDValue ParentFrameOffset =
26290
26289
DAG.getNode(ISD::LOCAL_RECOVER, dl, PtrVT, OffsetSymVal);
@@ -27345,7 +27344,7 @@ SDValue X86TargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
27345
27344
case Intrinsic::thread_pointer: {
27346
27345
if (Subtarget.isTargetELF()) {
27347
27346
SDLoc dl(Op);
27348
- EVT PtrVT = getPointerTy(DAG.getDataLayout() );
27347
+ EVT PtrVT = Op.getValueType( );
27349
27348
// Get the Thread Pointer, which is %gs:0 (32-bit) or %fs:0 (64-bit).
27350
27349
Value *Ptr = Constant::getNullValue(PointerType::get(
27351
27350
*DAG.getContext(), Subtarget.is64Bit() ? X86AS::FS : X86AS::GS));
@@ -28217,7 +28216,7 @@ SDValue X86TargetLowering::LowerRETURNADDR(SDValue Op,
28217
28216
28218
28217
unsigned Depth = Op.getConstantOperandVal(0);
28219
28218
SDLoc dl(Op);
28220
- EVT PtrVT = getPointerTy(DAG.getDataLayout() );
28219
+ EVT PtrVT = Op.getValueType( );
28221
28220
28222
28221
if (Depth > 0) {
28223
28222
SDValue FrameAddr = LowerFRAMEADDR(Op, DAG);
0 commit comments