[llvm-commits] [llvm] r94937 - in /llvm/trunk: lib/Transforms/Scalar/TailRecursionElimination.cpp test/Transforms/TailCallElim/no-return-calls.ll

Sebastian Redl sebastian.redl at getdesigned.at
Sun Jan 31 11:46:50 PST 2010


Evan Cheng wrote:
> No. But it doesn't make sense to tail call no return calls as far as I can tell.
>   
I don't know how realistic this is, but I might have a function that
looks like this:

void recurse_and_jump(int n) {
  if (n > 0) {
    // do something interesting
    recurse_and_jump(n-1);
  } else
    exit(0); // or any other noreturn thing
}

This function is technically noreturn and would benefit from a tail call
opt.

Sebastian



More information about the llvm-commits mailing list