[llvm] [GVN] Permit load PRE to happen in more cases (PR #79324)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 10:30:06 PST 2024


================
@@ -1143,34 +1143,100 @@ static void reportMayClobberedLoad(LoadInst *Load, MemDepResult DepInfo,
   ORE->emit(R);
 }
 
+static bool findDominatingValueInBlock(const MemoryLocation &Loc, Type *LoadTy,
----------------
paulwalker-arm wrote:

The function could do with a comment.  For example, returning `true` when you've not found what you're looking for is confusing and thus worth documenting.

That said, perhaps having the function return an `optional<Instuction*>` would be cleaner? with `none` meaning block entry has been reached (i.e. keep looking).

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


More information about the llvm-commits mailing list