[PATCH] D51664: [IR] Lazily number instructions for local dominance queries

George Burgess IV via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 11:15:57 PDT 2018


george.burgess.iv added inline comments.


================
Comment at: llvm/include/llvm/IR/BasicBlock.h:487
 
+#ifdef NDEBUG
+/// In release builds, this is a no-op. For !NDEBUG builds, the checks are
----------------
kuhar wrote:
> rnk wrote:
> > kuhar wrote:
> > > Does it make sense to disable this when EXPENSIVE_CHECKS are set?
> > I would assume EXPENSIVE_CHECKS implies !NDEBUG, and these checks are on when assertions enabled.
> I think you can use expensive checks independently of build type
Sounds to me like a bug in `EXPENSIVE_CHECKS` if it can be used without assertions.

Personally, every time I've written `#if EXPENSIVE_CHECKS` code, I've assumed that assertions are on.  Glancing at a handful of users, the most common case I can find by far is:

```
#ifdef EXPENSIVE_CHECKS
assert(...); // Or call a function that just does a lot of asserts
#endif
```

Moreover, I can't think of a case where I'd say "build an LLVM that spends as much time as it wants verifying itself, but not with assertions."


https://reviews.llvm.org/D51664





More information about the llvm-commits mailing list