Sirraide wrote:

Does this sort of warning make sense for inline assembly? There are valid use 
cases for having an asm operand that is never used, e.g. [Google Benchmark’s 
`DoNotOptimize`](https://github.com/google/benchmark/blob/04b5f41ec7e3b68b28a2379bc19804a48953117d/include/benchmark/utils.h#L53-L60):

```c++
template <class Tp>
inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp& value) {
#if defined(__clang__)
  asm volatile("" : "+r,m"(value) : : "memory");
#else
  asm volatile("" : "+m,r"(value) : : "memory");
#endif
}
```

https://github.com/llvm/llvm-project/pull/220577
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to