[llvm] 35bdcb0 - [llvm] Remove uses of isOpaqueOrPointeeTypeEquals() (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 02:41:54 PDT 2023


Author: Nikita Popov
Date: 2023-07-18T11:41:46+02:00
New Revision: 35bdcb03d91fb98f6d400505183613f6f8aa7af3

URL: https://github.com/llvm/llvm-project/commit/35bdcb03d91fb98f6d400505183613f6f8aa7af3
DIFF: https://github.com/llvm/llvm-project/commit/35bdcb03d91fb98f6d400505183613f6f8aa7af3.diff

LOG: [llvm] Remove uses of isOpaqueOrPointeeTypeEquals() (NFC)

Added: 
    

Modified: 
    llvm/lib/IR/Function.cpp
    llvm/lib/Transforms/Coroutines/Coroutines.cpp
    llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index 57163ad2e816bf..27219e89dc5f75 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -1609,12 +1609,7 @@ static bool matchIntrinsicType(
       if (!ThisArgVecTy || !ReferenceType ||
           (ReferenceType->getElementCount() != ThisArgVecTy->getElementCount()))
         return true;
-      PointerType *ThisArgEltTy =
-          dyn_cast<PointerType>(ThisArgVecTy->getElementType());
-      if (!ThisArgEltTy)
-        return true;
-      return !ThisArgEltTy->isOpaqueOrPointeeTypeMatches(
-          ReferenceType->getElementType());
+      return !ThisArgVecTy->getElementType()->isPointerTy();
     }
     case IITDescriptor::VecElementArgument: {
       if (D.getArgumentNumber() >= ArgTys.size())

diff  --git a/llvm/lib/Transforms/Coroutines/Coroutines.cpp b/llvm/lib/Transforms/Coroutines/Coroutines.cpp
index 399bff72b8ae6b..b1013262cd6b08 100644
--- a/llvm/lib/Transforms/Coroutines/Coroutines.cpp
+++ b/llvm/lib/Transforms/Coroutines/Coroutines.cpp
@@ -612,18 +612,15 @@ static void checkAsyncContextProjectFunction(const Instruction *I,
                                              Function *F) {
   auto *FunTy = cast<FunctionType>(F->getValueType());
   Type *Int8Ty = Type::getInt8Ty(F->getContext());
-  auto *RetPtrTy = dyn_cast<PointerType>(FunTy->getReturnType());
-  if (!RetPtrTy || !RetPtrTy->isOpaqueOrPointeeTypeMatches(Int8Ty))
+  if (!FunTy->getReturnType()->isPointerTy())
     fail(I,
          "llvm.coro.suspend.async resume function projection function must "
-         "return an i8* type",
+         "return a ptr type",
          F);
-  if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy() ||
-      !cast<PointerType>(FunTy->getParamType(0))
-           ->isOpaqueOrPointeeTypeMatches(Int8Ty))
+  if (FunTy->getNumParams() != 1 || !FunTy->getParamType(0)->isPointerTy())
     fail(I,
          "llvm.coro.suspend.async resume function projection function must "
-         "take one i8* type as parameter",
+         "take one ptr type as parameter",
          F);
 }
 

diff  --git a/llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp b/llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp
index 21405443706726..93992303daf092 100644
--- a/llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp
+++ b/llvm/tools/llvm-reduce/deltas/ReduceOpcodes.cpp
@@ -86,13 +86,7 @@ static bool callLooksLikeLoadStore(CallBase *CB, Value *&DataArg,
     if (!Arg->getType()->isSized())
       return false;
 
-    PointerType *PT = dyn_cast<PointerType>(Arg->getType());
-    if (!PtrArg && PT) {
-      // FIXME: Could create bitcast for typed pointers, but roll back unused
-      // replacement only erases one instruction.
-      if (!IsStore && !PT->isOpaqueOrPointeeTypeMatches(CB->getType()))
-        return false;
-
+    if (!PtrArg && Arg->getType()->isPointerTy()) {
       PtrArg = Arg;
       continue;
     }


        


More information about the llvm-commits mailing list