================
@@ -32,6 +33,68 @@ namespace mlir {
namespace {
+/// Find the `cir.store` operation that stores to the given alloca and
dominates
+/// the given load operation. Dominance calculation is done through the given
+/// DominanceInfo object.
+///
+/// Return nullptr if no such store operation exists. If multiple store
+/// operations satisfy the criteria, any of them may be returned.
----------------
Lancern wrote:
I would say that it's basically UB if you store multiple times to an alloca
slot marked with `const`. We could be nice here and fold the load to the "last"
store, but to determine which store is the "last" one needs extra processing
time (and I remember that the dominance check on MLIR is rather costly).
I'm also fine to give up the optimization under such cases.
https://github.com/llvm/llvm-project/pull/212284
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits