https://bugs.freedesktop.org/show_bug.cgi?id=69897
--- Comment #2 from Grigori Goronzy greg@chown.ath.cx --- It seems to fix the initial problem, but now I'm getting something else:
PRT: /home/greg/build/llvm/include/llvm/Support/Casting.h:239: typename cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::BranchInst, Y = llvm::TerminatorInst]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed. Stack dump: 0. Running pass 'Function Pass Manager' on module 'radeon'. 1. Running pass 'Region Pass Manager' on function '@shadow_ao' 2. Running pass 'Structurize control flow' on basic block '%if.end100'