Skip to content

Commit 235b629

Browse files
committed
Fixups
1 parent 529a94e commit 235b629

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,9 +2349,9 @@ static bool useSinCos(SDNode *Node) {
23492349
/// Issue libcalls to sincos to compute sin / cos pairs.
23502350
void SelectionDAGLegalize::ExpandSinCosLibCall(
23512351
SDNode *Node, SmallVectorImpl<SDValue> &Results) {
2352-
EVT RetVT = Node->getValueType(0);
2353-
Type *RetTy = RetVT.getTypeForEVT(*DAG.getContext());
2354-
RTLIB::Libcall LC = RTLIB::getFSINCOS(RetVT);
2352+
EVT VT = Node->getValueType(0);
2353+
Type *Ty = VT.getTypeForEVT(*DAG.getContext());
2354+
RTLIB::Libcall LC = RTLIB::getFSINCOS(VT);
23552355

23562356
// Find users of the node that store the results. The destination pointers
23572357
// can be used instead of creating stack allocations.
@@ -2363,14 +2363,14 @@ void SelectionDAGLegalize::ExpandSinCosLibCall(
23632363
if (!ISD::isNormalStore(User))
23642364
continue;
23652365
auto *ST = cast<StoreSDNode>(User);
2366-
if (!ST->isSimple() || ST->getPointerInfo().getAddrSpace() != 0 ||
2367-
ST->getAlign() < DAG.getDataLayout().getABITypeAlign(RetTy))
2366+
if (!ST->isSimple() || ST->getAddressSpace() != 0 ||
2367+
ST->getAlign() < DAG.getDataLayout().getABITypeAlign(Ty))
23682368
continue;
23692369
ResultStores[Use.getResNo()] = ST;
23702370
}
23712371

23722372
// Collect input chains (and avoid chains referring to one of the stores).
2373-
SmallVector<SDValue> InChains;
2373+
SmallVector<SDValue, 2> InChains;
23742374
for (auto [ResNum, ST] : llvm::enumerate(ResultStores)) {
23752375
unsigned OtherResNum = ResNum == 0 ? 1 : 0;
23762376
if (ST && ST->getChain().getNode() != ResultStores[OtherResNum])
@@ -2384,15 +2384,15 @@ void SelectionDAGLegalize::ExpandSinCosLibCall(
23842384

23852385
// Pass the argument.
23862386
Entry.Node = Node->getOperand(0);
2387-
Entry.Ty = RetTy;
2387+
Entry.Ty = Ty;
23882388
Args.push_back(Entry);
23892389

23902390
// Pass the output pointers for sin and cos.
23912391
SmallVector<SDValue, 2> ResultPtrs{};
23922392
for (StoreSDNode *ST : ResultStores) {
2393-
SDValue ResultPtr = ST ? ST->getBasePtr() : DAG.CreateStackTemporary(RetVT);
2393+
SDValue ResultPtr = ST ? ST->getBasePtr() : DAG.CreateStackTemporary(VT);
23942394
Entry.Node = ResultPtr;
2395-
Entry.Ty = PointerType::getUnqual(RetTy->getContext());
2395+
Entry.Ty = PointerType::getUnqual(Ty->getContext());
23962396
Args.push_back(Entry);
23972397
ResultPtrs.push_back(ResultPtr);
23982398
}
@@ -2421,7 +2421,7 @@ void SelectionDAGLegalize::ExpandSinCosLibCall(
24212421
DAG.getMachineFunction(),
24222422
cast<FrameIndexSDNode>(ResultPtr)->getIndex());
24232423
}
2424-
SDValue LoadResult = DAG.getLoad(RetVT, DL, OutChain, ResultPtr, PtrInfo);
2424+
SDValue LoadResult = DAG.getLoad(VT, DL, OutChain, ResultPtr, PtrInfo);
24252425
Results.push_back(LoadResult);
24262426
}
24272427
}

0 commit comments

Comments
 (0)