llvm-project
6ea7a2c4 - [clang][OpenMP] Fix assertion in the debug wrapper of CPU target kernels (#239580)

Commit
12 hours ago
[clang][OpenMP] Fix assertion in the debug wrapper of CPU target kernels (#239580) Fixes #188535 Any `omp target` region compiled for a CPU offload target with `-g` hit the `Argument count mismatch` assert in `GenerateOpenMPCapturedStmtFunctionAggregate`. It compared the field count plus one against `F->getNumOperands()`, which on an `llvm::Function` counts the hung-off operands (personality, prefix, prologue data), not the parameters. That is zero here, so it fired on every region. The IR emitted after it was fine, so release builds never noticed. Compare against `F->arg_size()` instead, which is what the code below relies on: one parameter per captured field plus the implicit `dyn_ptr`. AI assisted!
Parents
Loading