Skip to content

Commit 35bdcb0

Browse files
committed
[llvm] Remove uses of isOpaqueOrPointeeTypeEquals() (NFC)
1 parent 3fa5ee6 commit 35bdcb0

File tree

3 files changed

+6
-20
lines changed

3 files changed

+6
-20
lines changed

llvm/lib/IR/Function.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,12 +1609,7 @@ static bool matchIntrinsicType(
16091609
if (!ThisArgVecTy || !ReferenceType ||
16101610
(ReferenceType->getElementCount() != ThisArgVecTy->getElementCount()))
16111611
return true;
1612-
PointerType *ThisArgEltTy =
1613-
dyn_cast<PointerType>(ThisArgVecTy->getElementType());
1614-
if (!ThisArgEltTy)
1615-
return true;
1616-
return !ThisArgEltTy->isOpaqueOrPointeeTypeMatches(
1617-
ReferenceType->getElementType());
1612+
return !ThisArgVecTy->getElementType()->isPointerTy();
16181613
}
16191614
case IITDescriptor::VecElementArgument: {
16201615
if (D.getArgumentNumber() >= ArgTys.size())

llvm/lib/Transforms/Coroutines/Coroutines.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -612,18 +612,15 @@ static void checkAsyncContextProjectFunction(const Instruction *I,
612612
Function *F) {
613613
auto *FunTy = cast<FunctionType>(F->getValueType());
614614
Type *Int8Ty = Type::getInt8Ty(F->getContext());
615-
auto *RetPtrTy = dyn_cast<PointerType>(FunTy->getReturnType());
616-
if (!RetPtrTy || !RetPtrTy->isOpaqueOrPointeeTypeMatches(Int8Ty))
615+
if (!FunTy->getReturnType()->isPointerTy())
617616
fail(I,
618617
"llvm.coro.suspend.async resume function projection function must "
619-
"return an i8* type",
618+
"return a ptr type",
620619
F);
621-
if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy() ||
622-
!cast<PointerType>(FunTy->getParamType(0))
623-
->isOpaqueOrPointeeTypeMatches(Int8Ty))
620+
if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy())
624621
fail(I,
625622
"llvm.coro.suspend.async resume function projection function must "
626-
"take one i8* type as parameter",
623+
"take one ptr type as parameter",
627624
F);
628625
}
629626

llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,7 @@ static bool callLooksLikeLoadStore(CallBase *CB, Value *&DataArg,
8686
if (!Arg->getType()->isSized())
8787
return false;
8888

89-
PointerType *PT = dyn_cast<PointerType>(Arg->getType());
90-
if (!PtrArg && PT) {
91-
// FIXME: Could create bitcast for typed pointers, but roll back unused
92-
// replacement only erases one instruction.
93-
if (!IsStore && !PT->isOpaqueOrPointeeTypeMatches(CB->getType()))
94-
return false;
95-
89+
if (!PtrArg && Arg->getType()->isPointerTy()) {
9690
PtrArg = Arg;
9791
continue;
9892
}

0 commit comments

Comments
 (0)