[PATCH] D83179: [SCCP] Use range metadata for loads and calls

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 7 12:17:06 PDT 2020


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


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:1121
+  // as overdefined.
+  if (I.getType()->isStructTy() || I.isVolatile())
     return (void)markOverdefined(&I);
----------------
fhahn wrote:
> For volatile loads, I think we could still use the range info if present? We are just not allowed to remove the volatile operation, right?
This would be safe. I briefly tried this, but found that SCCP would zap the volatile load, because it only uses `isSafeToRemove()` to determine whether instructions can be dropped. We would have to replace that with something stronger, like `isInstructionTriviallyDead()`. Do you think that would be worthwhile?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83179





More information about the llvm-commits mailing list