[llvm] [AggressiveInstCombine] Ignore debug instructions when load combining (PR #70200)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 06:21:21 PDT 2023


================
@@ -701,12 +701,21 @@ static bool foldLoadsRecursive(Value *V, LoadOps &LOps, const DataLayout &DL,
       Loc = Loc.getWithNewSize(LOps.LoadSize);
   } else
     Loc = MemoryLocation::get(End);
+
+  // Ignore debug info (and other "AssumeLike" intrinsics) so that's not counted
+  // against MaxInstrsToScan. Otherwise debug info could affect codegen.
+  auto IsAssumeLikeIntr = [](const Instruction &I) {
+    if (auto *II = dyn_cast<IntrinsicInst>(&I))
+      return II->isAssumeLikeIntrinsic();
----------------
mikaelholmen wrote:

Done.

https://github.com/llvm/llvm-project/pull/70200


More information about the llvm-commits mailing list