[PATCH] D103118: [SCEV] Compute exit counts for unsigned IVs using mustprogress semantics

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 31 02:57:38 PDT 2021


mkazantsev added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:6499
+
+  // A loop without side effects must be finite.
+  // TODO: The check used here is very conservative.  It's only *specific*
----------------
Is this actually true? For C++, I was able to find that
```
In a valid C++ program, every thread eventually does one of the following:

terminate
makes a call to an I/O library function
reads or modifies a volatile object [!!!]
performs an atomic operation or a synchronization operation
```

Is it different in LLVM? A loop that only reads volatile memory is non-side-effecting, but I'd be surprised if we considered it finite.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103118



More information about the llvm-commits mailing list