[llvm] 30fff94 - InstCombine: Don't bother skipping over pointer bitcasts

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 10:03:52 PDT 2023


Author: Matt Arsenault
Date: 2023-08-02T13:03:47-04:00
New Revision: 30fff9480ac4f47fa7e04054f4cb60cee41755d5

URL: https://github.com/llvm/llvm-project/commit/30fff9480ac4f47fa7e04054f4cb60cee41755d5
DIFF: https://github.com/llvm/llvm-project/commit/30fff9480ac4f47fa7e04054f4cb60cee41755d5.diff

LOG: InstCombine: Don't bother skipping over pointer bitcasts

These don't really happen with opaque pointers.

Added: 
    

Modified: 
    llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
index 939ef8e5e67731..3b0d957831b00f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
@@ -1501,8 +1501,7 @@ Instruction *InstCombinerImpl::visitStoreInst(StoreInst &SI) {
     --BBI;
     // Don't count debug info directives, lest they affect codegen,
     // and we skip pointer-to-pointer bitcasts, which are NOPs.
-    if (BBI->isDebugOrPseudoInst() ||
-        (isa<BitCastInst>(BBI) && BBI->getType()->isPointerTy())) {
+    if (BBI->isDebugOrPseudoInst()) {
       ScanInsts++;
       continue;
     }
@@ -1623,8 +1622,7 @@ bool InstCombinerImpl::mergeStoreIntoSuccessor(StoreInst &SI) {
   if (OtherBr->isUnconditional()) {
     --BBI;
     // Skip over debugging info and pseudo probes.
-    while (BBI->isDebugOrPseudoInst() ||
-           (isa<BitCastInst>(BBI) && BBI->getType()->isPointerTy())) {
+    while (BBI->isDebugOrPseudoInst()) {
       if (BBI==OtherBB->begin())
         return false;
       --BBI;


        


More information about the llvm-commits mailing list