Created attachment 21223
LLVM-IR test case
The following C code
typedef long long unsigned int uint64_t;
void __attribute__((noreturn)) test(uint64_t a, uint64_t b, uint64_t
__attribute__((noreturn)) (*cb)(uint64_t, uint64_t)) {
cb(a, b);
}
which generates the following LLVM-IR (clang 6)
define void @test(i64, i64, i64 (i64, i64)* nocapture) local_unnamed_addr #0 {
%4 = tail call i64 %2(i64 %0, i64 %1) #1
unreachable
}
results in unnecessary instructions after the call when ppc64le is targeted:
mtctr 5
mr 12, 5
std 2, 24(1) /* what for? */
bctrl
ld 2, 24(1) /* what for? */
The full LLVM-IR is attached.
test.ll
(1085 bytes, text/plain)