Skip to content

Extend clang/utils/creduce-clang-crash.py to reduce middle-end and backend crashes using llvm-reduce #126827

Open
@aeubanks

Description

@aeubanks

creduce-clang-crash.py takes a clang command that crashes, creates an interestingness test from it, and passes it off to creduce/cvise. Reducing at the source language level can be quite slow and doesn't produce a nice opt/llc command with reduced IR for middle-end and backend crashes.

Before deciding to run creduce/cvise, we should try running opt -On/llc -On on the output IR.

For middle-end crashes, if we see clang -On -Xclang -disable-llvm-passes -S -emit-llvm -o /tmp/a.ll; opt -On /tmp/a.ll -disable-output still reproduces the crash, we should reduce /tmp/a.ll with llvm-reduce using opt -On /tmp/a.ll as the interestingness test.

For backend crashes, if we see clang -On -Xclang -S -emit-llvm -o /tmp/a.ll; llc -On /tmp/a.ll -o /dev/null still reproduces the crash, we should reduce /tmp/a.ll with llvm-reduce using llc -On /tmp/a.ll as the interestingness test.

(we should also rename the script to reduce-clang-crash.py)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions