This is an archive of the discontinued LLVM Phabricator instance.

[mips] Change the machine verifier to allow nested call sequences.
AbandonedPublic

Authored by slthakur on Apr 13 2017, 11:22 PM.

Details

Reviewers
sdardis
Summary

The call to the function f2 in the test largeimmprinting.ll has a large size argument passed by value. This causes the lowering implementation to create a call to memcpy for coping the large sized argument in the argument build area.

This results in a nested call sequence which was not allowed by the machine verifier before. This patch adds a stack to save the sizes of the stack adjustments and checks if there is any mismatch.

Diff Detail

Repository
rL LLVM

Event Timeline

slthakur created this revision.Apr 13 2017, 11:22 PM
sdardis edited edge metadata.Apr 19 2017, 6:01 AM

Hi Sagar,

I don't think this is the correct fix. The issue arising is that the call to memcpy is being generated inside the callseq_start, callseq_end nodes in the DAG. Instead, when we encounter a byval argument, we need to call memcpy outside the sequence. If you check this test with xcore/x86_64/i386/aarch64 you'll see that those targets also call out to memcpy as well. We should look at changing how the arguments are setup for a call in MipsISelLowering.cpp.

The ISD also notes that those callseq nodes are not to be nested.

Thanks,
Simon

slthakur abandoned this revision.Apr 26 2017, 2:13 AM