[llvm-commits] [PATCH] Fix tail calls (indirect or large-code-model): PR5729

Jeffrey Yasskin jyasskin at google.com
Sat Jan 9 22:54:32 PST 2010


On Sat, Jan 9, 2010 at 11:57 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> On Saturday 09 January 2010 19:05:45 you wrote:
>> Committed as r93065.
>>
>> Your Mandelbrot test seems to work now. Let me know what's still broken.
>
> Awesome, thanks!
>
> All tests now pass with standalone compilation using "llc" and not "opt" on
> both x86 and x86-64.
>
> Optimizing with "opt -std-compile-opts" generates working code that honors the
> tail calls marked by HLVM but optimizing with "opt -tailcallelim
> -std-compile-opts" still generates broken code that segfaults on both x86 and
> x86-64. IIRC, that causes opt to mark all calls as tail calls so presumably
> LLVM is intolerant of that.

Could you send the smallest .bc file you have that generates good
output without -tailcallelim and bad output or a segfault with
-tailcallelim? Please also include the exact command lines you use to
compile it.

> With JIT compilation, both x86 and x86-64 are giving lots of wrong answers but
> only x86 segfaults (on the hash table test). If TCO is disabled in HLVM, so
> tail calls are not marked "tail" for LLVM, then the tests that do not stack
> overflow do generate the correct results with JIT compilation. So this looks
> like a JIT-specific TCO bug in LLVM.

Again, please send the smallest .bc file you have that passes without
-tailcallopt but fails with it, along with your exact command lines.
Can I run these through lli, or do they need HLVM loaded?

> I just tried "llc -code-model=large" when doing standalone compilation on
> x86-64 and it does not reproduce the erroneous results that I'm seeing with
> JIT compilation.

Was that just `llc -code-model=large` or `llc -code-model=large
-tailcallopt`? I'm just paranoid about forgetting that option because
I do it all the time.

> HTH.



More information about the llvm-commits mailing list