[PATCH] D112179: [CodeMetrics] Don't require speculatability for ephemeral values

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 13:28:00 PDT 2021


nikic created this revision.
nikic added reviewers: jdoerfert, fhahn, aeubanks.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As discussed in D112016 <https://reviews.llvm.org/D112016>, our current requirement of speculatability for ephemeral is overly strict: What we really care about is that the instruction will be DCEd once the assume is dropped. For that it is sufficient that the instruction is side-effect free and not a terminator.

In particular, this allows non-dereferenceable loads to be ephemeral values.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112179

Files:
  llvm/lib/Analysis/CodeMetrics.cpp
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/Inline/ephemeral.ll
  llvm/test/Transforms/SimplifyCFG/unprofitable-pr.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112179.381082.patch
Type: text/x-patch
Size: 5248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211020/015af60f/attachment.bin>


More information about the llvm-commits mailing list