[clang] [llvm] [EarlyCSE] Add support for writeonly call CSE (PR #145474)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 02:13:21 PDT 2025


================
@@ -1626,14 +1626,17 @@ bool EarlyCSE::processNode(DomTreeNode *Node) {
         !(MemInst.isValid() && !MemInst.mayReadFromMemory()))
       LastStore = nullptr;
 
-    // If this is a read-only call, process it.
-    if (CallValue::canHandle(&Inst)) {
+    // If this is a read-only or write-only call, process it. Skip store
+    // MemInsts, as they will be more precisely handled lateron.
----------------
dtcxzyw wrote:

```suggestion
    // MemInsts, as they will be more precisely handled later on.
```

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


More information about the llvm-commits mailing list