This is an archive of the discontinued LLVM Phabricator instance.

[MC] Make bundle alignment mode setting idempotent and support nested bundles
ClosedPublic

Authored by dschuff on Oct 15 2014, 9:17 AM.

Details

Summary

Currently an error is thrown if bundle alignment mode is set more than once
per module (either via the API or the .bundle_align_mode directive). This
change allows setting it multiple times as long as the alignment doesn't
change.

Also nested bundle_lock groups are currently not allowed. This change allows
them, with the effect that the group stays open until all nests are exited,
and if any of the bundle_lock directives has the align_to_end flag, the
group becomes align_to_end.

These changes make the bundle aligment simpler to use in the compiler, and
also better match the corresponding support in GNU as.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 14947.Oct 15 2014, 9:17 AM
dschuff retitled this revision from to [MC] Make bundle alignment mode setting idempotent and support nested bundles.
dschuff updated this object.
dschuff added reviewers: jvoung, eliben.
dschuff added a subscriber: Unknown Object (MLST).
eliben edited edge metadata.Oct 15 2014, 9:44 AM

LGTM, with a couple of nits

lib/MC/MCAssembler.cpp
338 ↗(On Diff #14947)

if (

346 ↗(On Diff #14947)

Can you put {...} around the contents, for consistency with other code in this method?

lib/MC/MCELFStreamer.cpp
481 ↗(On Diff #14947)

s/1/1U/ for consistency with above?

dschuff updated this revision to Diff 14952.Oct 15 2014, 9:57 AM
dschuff edited edge metadata.
  • Reviewer comments
jvoung edited edge metadata.Oct 15 2014, 10:03 AM

otherwise LGTM too

lib/MC/MCELFStreamer.cpp
483 ↗(On Diff #14952)

Would be good add a test that the error is thrown when the align modes are changed.

test/MC/X86/AlignedBundling/nesting.s
11 ↗(On Diff #14952)

isntructions -> instructions

56 ↗(On Diff #14952)

No need to say callq is 5 bytes long here too (already stated earlier)

dschuff updated this revision to Diff 14953.Oct 15 2014, 10:16 AM
dschuff edited edge metadata.
  • jvoung review comments
dschuff closed this revision.Oct 15 2014, 10:20 AM
dschuff updated this revision to Diff 14954.

Closed by commit rL219811 (authored by @dschuff).