[llvm] [TableGen] Split large printInstruction() for NVPTX to avoid compiler limits (PR #218530)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 23:54:29 PDT 2026


================

----------------
kazutakahirata wrote:

Start `TotalSize` at `1` and drop the `NDEBUG` return guard. Unlike `assert()`, `llvm_unreachable()` expands to `LLVM_BUILTIN_UNREACHABLE` (`__builtin_unreachable()` / `__assume(false)`) in `NDEBUG` builds rather than a no-op, so control never falls through `case 0:`:
```suggestion
  std::vector<unsigned> OpcodeToOffset(NumberedInsts.size(), 0);
  unsigned TotalSize = 1;
```

https://github.com/llvm/llvm-project/pull/218530


More information about the llvm-commits mailing list