This is an archive of the discontinued LLVM Phabricator instance.

[ARM] The Driver does not set the +strict-align flag when targeting armv6m + netbsd
ClosedPublic

Authored by labrinea on Sep 28 2015, 10:08 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

labrinea updated this revision to Diff 35883.Sep 28 2015, 10:08 AM
labrinea retitled this revision from to The Driver does not set the +strict-align flag when targeting armv6m + netbsd.
labrinea updated this object.
labrinea added reviewers: cfe-commits, rengolin.
labrinea retitled this revision from The Driver does not set the +strict-align flag when targeting armv6m + netbsd to [ARM] The Driver does not set the +strict-align flag when targeting armv6m + netbsd.Sep 30 2015, 3:26 AM
rengolin added inline comments.Oct 2 2015, 10:46 AM
lib/Basic/Targets.cpp
4456 ↗(On Diff #35883)

Why is this not necessary any more?

labrinea added inline comments.Oct 2 2015, 7:20 PM
lib/Basic/Targets.cpp
4456 ↗(On Diff #35883)

The logic is still necessary for the back-end to emit aligned loads and stores, but it should be moved to the Driver, where +strict-align is set for all arch+OS combinations as shown below.

rengolin added inline comments.Oct 3 2015, 6:39 AM
lib/Basic/Targets.cpp
4456 ↗(On Diff #35883)

Oh, so this ended up as a work-around for the correct change that you just did, below?

labrinea added inline comments.Oct 4 2015, 12:51 PM
lib/Basic/Targets.cpp
4456 ↗(On Diff #35883)

Apparently yes. The front-end checks this flag in order to decide whether it should define the __ARM_FEATURE_UNALIGNED macro, and the back-end needs it to chose the correct instruction lowering for memory accesses. The best place to set this flag is in Driver, where all target features are handled.

rengolin accepted this revision.Oct 4 2015, 3:29 PM
rengolin edited edge metadata.

Absolutely agree. If we miss some other target, we should add it there, too, not cover later. LGTM. Thanks!

This revision is now accepted and ready to land.Oct 4 2015, 3:29 PM
This revision was automatically updated to reflect the committed changes.