Repository navigation
Done
Description
The LLVM profile reports two recurring false positives on clang patches; both
come from projects/llvm/prompts/false-positive-guide.md and both survive
re-runs.
- Pre-existing defects in untouched functions are raised as
High.
Rule 8 currently says to report them with"preexisting": true, which
brings them into the severity summary. cgm.errorNYI()+return {}/return nullptris raised as a null
dereference. The diagnostic already fails the compilation and stops code
generation after the current statement; returning a nullmlir::Valueis
the established pattern inCIRGenExprScalar.cppand other CodeGen files.
These are LLVM-convention judgement errors, so the fix belongs in the prompt
bundle, not in Rust-side filtering.
Reproduction
- repo:
llvm/llvm-project - patch:
93526cc712d4([clang][CIR] Address review comments) - model:
deepseek-flash(cheapest model, to test where false positives are
most frequent) - setup: sashiko 0.9.5, LLVM profile from llvm: add ProjectId::Llvm and patch review workflow #948
Proposed change
Rewrite rule 8 so a defect in a function the patch does not modify is never a
finding of this review, and add rule 9:
8. **Existing upstream behaviour**: a defect that predates the patch is not a
regression of this patch, so do not report it as one. Do not drop it either,
but keep it out of the severity summary: mention it in a short
"pre-existing, out of scope" note. If the patch does not modify the function
at all, it is never a finding of this review.
9. **`errorNYI()` and other fatal diagnostics**: clang's CIRGen and CodeGen
use `cgm.errorNYI()` (or `error()`) for paths that are deliberately not
implemented; the diagnostic marks the compilation as failed and code
generation stops after the current statement. Returning a null
`mlir::Value` or `nullptr` from such a path is the established convention in
the same file (see `CIRGenExprScalar.cpp` around lines 144 and 195). A
report that "the null value propagates to a caller and is dereferenced" is
not a valid finding unless you can point at a caller that continues code
generation after such a diagnostic. Do not report it.Measured effect
Same commit, model, and base:
| prompt | Critical | High | Low | notes |
|---|---|---|---|---|
| shipped | 0 | 2 | 2 | both false positives present |
| + rules 8/9 | 0 | 2 | 1 | untouched-defect FP gone; errorNYI FP remains |
| + rule 9 anchors | 0 | 1 | 1 | both false positives gone |
The remaining High is a real gap in the non-atomic -- path (tracked in
#247673), so leaving it reported is correct.
Metadata
Metadata
Assignees
Labels
No labels
Activity
llvm prompts: avoid two recurring false positives
llvm prompts: avoid two recurring false positives
llvm prompts: avoid two recurring false positives
llvm prompts: avoid two recurring false positives
llvm prompts: avoid two recurring false positives