[llvm] [VPlan] Fix alias logic in canHoistOrSinkWithNoAliasCheck (PR #179504)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 01:29:35 PST 2026


================
@@ -223,7 +223,7 @@ canHoistOrSinkWithNoAliasCheck(const MemoryLocation &MemLoc,
 
       // For reads, check if they don't alias in the reverse direction and
       // skip if so.
-      if (CheckReads && R.mayReadFromMemory() &&
+      if (!(CheckReads && R.mayReadFromMemory()) ||
----------------
fhahn wrote:

The reasoning here is not entirely clear to me. We now always continue when `CheckReads` is true or writing to memory? I am not sure how this would be safe, at least it does not match the expectation of the caller any longer I think, looking at the comment for the function

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


More information about the llvm-commits mailing list