This is an archive of the discontinued LLVM Phabricator instance.

LowerTypeTests: Teach the pass to respect global alignments.
ClosedPublic

Authored by pcc on Jul 19 2019, 5:49 PM.

Details

Summary

We were previously ignoring alignment entirely when combining globals
together in this pass. There are two main things that we need to do here:
add additional padding before each global to meet the alignment requirements,
and set the combined global's alignment to the maximum of all of the original
globals' alignments.

Since we now need to calculate layout as we go anyway, use the calculated
layout to produce GlobalLayout instead of using StructLayout.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc created this revision.Jul 19 2019, 5:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2019, 5:50 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
vitalybuka accepted this revision.Jul 22 2019, 11:28 AM
vitalybuka added inline comments.
llvm/lib/Transforms/IPO/LowerTypeTests.cpp
767 ↗(On Diff #210942)

could you make it declaration per line?

This revision is now accepted and ready to land.Jul 22 2019, 11:28 AM
This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.