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

Jeffrey Yasskin jyasskin at google.com
Sat Jan 9 11:05:45 PST 2010


Committed as r93065.

Your Mandelbrot test seems to work now. Let me know what's still broken.

On Sat, Jan 9, 2010 at 9:05 AM, Jeffrey Yasskin <jyasskin at google.com> wrote:
> On Sat, Jan 9, 2010 at 7:39 AM, Jon Harrop <jon at ffconsultancy.com> wrote:
>> On Saturday 09 January 2010 01:53:17 Jeffrey Yasskin wrote:
>>> Bug: http://llvm.org/PR5729
>>> Patch: http://llvm.org/bugs/attachment.cgi?id=4017
>>> Review at: http://codereview.appspot.com/185044
>>>
>>> Dan's probably the right person to double-check my tests.
>>>
>>> Jon and Albert, this probably won't unbreak things for you guys yet
>>> since it doesn't change any behavior in -Asserts mode. I'll look for
>>> your runtime problems next.
>>
>> Thanks for trying! I'm still seeing lots of bugs that seem to be TCO related
>> and some (on x86) that seem to appear only with TCO and JIT at the same time
>> (but not standalone compilation).
>
> The JIT codegens more closely to `llc -code-model=large` than to the
> default llc. Which have you tested with?
>
>> I just noticed an LLVM bug in TCO on x86-64 recently that was doing this:
>>
>> $ ./hlvm
>> 8x 8-queens
>> Queens
>> Queens
>> Queens
>> Queens
>> hlvm: X86ISelLowering.cpp:2006: virtual llvm::SDValue
>> llvm::X86TargetLowering::LowerCall(llvm::SDValue, llvm::SDValue, unsigned
>> int, bool, bool, const llvm::SmallVectorImpl<llvm::ISD::OutputArg>&, const
>> llvm::SmallVectorImpl<llvm::ISD::InputArg>&, llvm::DebugLoc,
>> llvm::SelectionDAG&, llvm::SmallVectorImpl<llvm::SDValue>&): Assertion
>> `((Callee.getOpcode() == ISD::Register &&
>> (cast<RegisterSDNode>(Callee)->getReg() == X86::EAX ||
>> cast<RegisterSDNode>(Callee)->getReg() == X86::R9)) || Callee.getOpcode() ==
>> ISD::TargetExternalSymbol || Callee.getOpcode() == ISD::TargetGlobalAddress)
>> && "Expecting an global address, external symbol, or register"' failed.
>> Stack dump:
>> 0.      Segmentation fault
>>
>> I just upgraded to the latest LLVM SVN that I assume contains your fix but now
>> I get this:
>
> This thread is about a _patch_ to fix that assertion. It hasn't gone in yet.
>
>> I do think the situation is getting worse, probably because there are no TCO
>> tests in the LLVM test suite so people don't know when they're breaking it.
>> Can I give you the LLVM IR from some tests to put into LLVM's test suite?
>
> That'd be awesome. Please do check that they still crash or behave
> badly with this patch applied, or that they're uncovered variations on
> the test/CodeGen/X86/tailcall*.ll tests
> (http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/).
>




More information about the llvm-commits mailing list