Closed Blei closed 11 years ago
I think this might be an LLVM bug, because llvm.expect
seems to work fine with pointer types in an asserts-disabled build. You could work around it by hacking Clay's hints
module to overload likely
and unlikely
to bitcast pointer inputs to integers before passing them through the intrinsic.
Actually, it looks like it's the expect calls created by exception handling code in the compiler that are tripping that assertion. Those can be ripped out.
Well, the documentation of the LLVM IR here seems to say that only i32 and i64 types are legal. I guess that works out for pointers if the type is not checked at all, but doesn't hold up if it is.
The documentation seems to be incorrect, it works for any integer type, but not for pointers, at least according to the Intrinsic.td file.
Are you still on that? Because it looks like I might have a fix.
It's all yours.
Fixed by @Blei in issue #454.
Even the tiniest program fails with something like:
llvm & clang are at 3.1.