This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Use preferred alignment for constants in promoteToConstantPool.
ClosedPublic

Authored by efriedma on Aug 29 2018, 5:14 PM.

Details

Summary

This mostly affects IR generated by non-clang frontends because clang generally sets the alignment of globals explicitly.

Fixes https://bugs.llvm.org//show_bug.cgi?id=32394 .

(-arm-promote-constant is currently off by default, and it stays off with this patch. I'll look into turning it on again when all the known issues are fixed.)

Diff Detail

Repository
rL LLVM

Event Timeline

efriedma created this revision.Aug 29 2018, 5:14 PM
dmgreen added a subscriber: dmgreen.Sep 2 2018, 9:11 AM
dmgreen accepted this revision.Sep 7 2018, 11:21 AM

This looks fine to me, if like you say the over aligning to 16 thing is not something that should come up a lot.

Do we check anywhere that the global is not in a section?

This revision is now accepted and ready to land.Sep 7 2018, 11:21 AM

Do we check anywhere that the global is not in a section?

Looks like no? It's not particularly like to come up, I would guess: a constant with a section marking would usually also either have external linkage or be marked used (which would both suppress the transform). But I'll write a followup patch.

This revision was automatically updated to reflect the committed changes.