This is an archive of the discontinued LLVM Phabricator instance.

Remove TargetBaseAlign. Keep alignment for stack adjustments.
ClosedPublic

Authored by asbirlea on Jul 28 2016, 2:05 PM.

Details

Summary

TargetBaseAlign is no longer required since LSV checks if target allows misaligned accesses.
A constant defining a base alignment is still needed for stack accesses where alignment can be adjusted.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea updated this revision to Diff 65992.Jul 28 2016, 2:05 PM
asbirlea retitled this revision from to Remove TargetBaseAlign. Keep alignment for stack adjustments..
asbirlea updated this object.
asbirlea added reviewers: llvm-commits, jlebar.
asbirlea added a subscriber: arsenm.
jlebar added inline comments.Jul 28 2016, 2:17 PM
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
43 ↗(On Diff #65992)

I think we still want a comment here, because we're basically assuming that 4 bytes is good enough for any type.

1033 ↗(On Diff #65992)

Can we rewrite this function as

if (Alignment % SzInBytes == 0)
  return true;
bool Fast = false;
bool Allows = ...;
return !Allows || !Fast;

That would make it a lot more obvious to me.

arsenm added inline comments.Jul 28 2016, 2:20 PM
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
43 ↗(On Diff #65992)

I think this makes an easier TTI hook now that it isn't related to unaligned access

asbirlea updated this revision to Diff 66001.Jul 28 2016, 2:26 PM

Address comments.

asbirlea added inline comments.Jul 28 2016, 2:27 PM
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
1036 ↗(On Diff #66001)

I think you meant return false on the first condition. Updated.

jlebar accepted this revision.Jul 28 2016, 2:29 PM
jlebar edited edge metadata.
jlebar added inline comments.
lib/Transforms/Vectorize/LoadStoreVectorizer.cpp
1036 ↗(On Diff #66001)

Yes, "not misaligned". Sigh.

This revision is now accepted and ready to land.Jul 28 2016, 2:29 PM
This revision was automatically updated to reflect the committed changes.