llc asserts 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.sh that 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,tes and extract it into a file like bug.ll. (In very rare cases, one may need the preoptir option in R600_DEBUG.) Then I edit run_llc.sh with 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
.bc file that one can use the usual tools on, such as llc, opt, and llvm-dis.
Occasionally, it can be useful to run the result through
opt -instnamer or to simplify it further by hand, but usually, bugpoint provides a good starting point.
Keine Kommentare:
Kommentar veröffentlichen