[llvm] 6b5b367 - [Attributor] Remove function pointer type check (NFCI)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 4 03:09:59 PST 2022


Author: Nikita Popov
Date: 2022-03-04T12:09:51+01:00
New Revision: 6b5b36785826e79c67328220c4f10ad2ca4a9e46

URL: https://github.com/llvm/llvm-project/commit/6b5b36785826e79c67328220c4f10ad2ca4a9e46
DIFF: https://github.com/llvm/llvm-project/commit/6b5b36785826e79c67328220c4f10ad2ca4a9e46.diff

LOG: [Attributor] Remove function pointer type check (NFCI)

This check is not relevant for correctness, it can only avoid
walking some recursive uses if the cast is to a non-function
pointer type. As this distinction will no longer be possible
with opaque pointers and all users will have to be walked
anyway, I'm dropping the check in advance.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 74c2d82085599..7ceb5c0f7cf86 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1325,8 +1325,7 @@ bool Attributor::checkForAllCallSites(function_ref<bool(AbstractCallSite)> Pred,
       continue;
     }
     if (ConstantExpr *CE = dyn_cast<ConstantExpr>(U.getUser())) {
-      if (CE->isCast() && CE->getType()->isPointerTy() &&
-          CE->getType()->getPointerElementType()->isFunctionTy()) {
+      if (CE->isCast() && CE->getType()->isPointerTy()) {
         LLVM_DEBUG(
             dbgs() << "[Attributor] Use, is constant cast expression, add "
                    << CE->getNumUses()


        


More information about the llvm-commits mailing list