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

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 20 13:35:04 PDT 2021


aeubanks 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() &&
----------------
it'd be nice to a have a test case for this, but that might be hard to come up with


================
Comment at: llvm/test/Transforms/Inline/ephemeral.ll:29-30
 
-; TODO: The load should be considered ephemeral here, even though it is not
+; The load should be considered ephemeral here, even though it is not
 ; speculatable.
 ; CHECK: Analyzing call of inner2...
----------------
the comment doesn't really make sense, it now is considered ephemeral
ditto in the other test


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