[llvm] [Loads] Pass DominatorTree if available (PR #95752)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 01:32:02 PDT 2024


https://github.com/ruiling created https://github.com/llvm/llvm-project/pull/95752

For better dominance check inside the function.

>From a6e18d8886110704dc9e3b3454ffd7821e0f11b3 Mon Sep 17 00:00:00 2001
From: Ruiling Song <ruiling.song at amd.com>
Date: Mon, 17 Jun 2024 15:36:06 +0800
Subject: [PATCH] [Loads] Pass DominatorTree if available

For better dominance check inside the function.
---
 llvm/lib/Analysis/Loads.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 478302d687b53..2b8197066e8e9 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -165,7 +165,7 @@ static bool isDereferenceableAndAlignedPointer(
     if (getKnowledgeForValue(
             V, {Attribute::Dereferenceable, Attribute::Alignment}, AC,
             [&](RetainedKnowledge RK, Instruction *Assume, auto) {
-              if (!isValidAssumeForContext(Assume, CtxI))
+              if (!isValidAssumeForContext(Assume, CtxI, DT))
                 return false;
               if (RK.AttrKind == Attribute::Alignment)
                 AlignRK = std::max(AlignRK, RK);



More information about the llvm-commits mailing list