[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:44:17 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:497
 
-      if (V == I || isSafeToSpeculativelyExecute(V)) {
+      if (V == I || (isa<Instruction>(V) &&
+                     !cast<Instruction>(V)->mayHaveSideEffects() &&
----------------
aeubanks wrote:
> it'd be nice to a have a test case for this, but that might be hard to come up with
Most likely this change doesn't have an observable effect. I mainly changed it for the sake of consistency.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112179



More information about the llvm-commits mailing list