[PATCH] D128224: [DSE] Don't remove nounwind invokes

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 11:48:44 PDT 2022


aheejin marked an inline comment as done.
aheejin added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1019
+      if (isa<InvokeInst>(CB))
+        return false;
+
----------------
nikic wrote:
> I'd probably go for a `CB->isTerminator()` check here, rather than checking specifically for invokes (though i doubt this can happen with `callbr` in practice).
OK. Then I'll merge the `CB->isTerminator` check into the bottom line here:
```
return CB->use_empty() && CB->willReturn() && CB->doesNotThrow();
```
And I don't think we need a separate comment for that, because it is kind of clear that we can't remove terminators.


================
Comment at: llvm/test/Transforms/DeadStoreElimination/nounwind-invoke.ll:4
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
----------------
nikic wrote:
> Datalayout and triple are likely not relevant.
Removed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128224/new/

https://reviews.llvm.org/D128224



More information about the llvm-commits mailing list