Page MenuHomePhabricator

CodeGen: Reduce LValue and CallArgList memory footprint before recommitting r326946
ClosedPublic

Authored by yaxunl on Mar 13 2018, 12:54 PM.

Details

Summary

Recent change r326946 (https://reviews.llvm.org/D34367) causes regression in Eigen due to increased
memory footprint of CallArg.

This patch reduces LValue size from 112 to 96 bytes and reduces inline argument count of CallArgList
from 16 to 8.

It has been verified that this will let the added deep AST tree test pass with r326946.

In the long run, CallArg or LValue memory footprint should be further optimized.

Diff Detail

Repository
rC Clang

Event Timeline

yaxunl created this revision.Mar 13 2018, 12:54 PM
rjmccall added inline comments.Mar 13 2018, 12:58 PM
lib/CodeGen/CGValue.h
234

Please saturate Alignment here instead of allowing it to be truncated: that is, if the passed-in alignment is greater than (1U << 31), please store (1U << 31).

yaxunl updated this revision to Diff 138252.Mar 13 2018, 1:12 PM
yaxunl marked an inline comment as done.

Saturate alignment when it is too large.

rjmccall accepted this revision.Mar 13 2018, 1:38 PM

Thank you. LGTM.

This revision is now accepted and ready to land.Mar 13 2018, 1:38 PM
This revision was automatically updated to reflect the committed changes.

I have to remove the lit test since it causes failure on atom http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/15477

It seems when the lit test is running on atom, it is compiled with default CPU for x86_64, therefor atom is not defined and there is no way to detect the test is running on atom system.

Yeah, I think the test is probably a bit abusive to run unconditionally for all hosts. We can just know that we improved things, and if we regress, it will break them again.