llcasserts with message X", and you have a very useful tool for reducing test cases. Unfortunately, its documentation isn't the greatest, so let me briefly dump how I have used it in the past.
I have a little script called
run_llc.shthat looks like this:
#!/bin/bash if ! llc -mtriple=amdgcn-- -verify-machineinstrs "$@" 2>&1 | grep "error message here"; then exit 0 else exit $? fiWhen I encounter a compiler assertion, I first make sure to collect the offending shader from our driver using
R600_DEBUG=ps,vs,gs,tcs,tesand extract it into a file like
bug.ll. (In very rare cases, one may need the
R600_DEBUG.) Then I edit
run_llc.shwith the correct error message and run
bugpoint -compile-custom -compile-command ./run_llc.sh bug.llIt'll churn for some time and produce a hopefully much smaller
.bcfile that one can use the usual tools on, such as
Occasionally, it can be useful to run the result through
opt -instnameror to simplify it further by hand, but usually, bugpoint provides a good starting point.