HomePhabricator

LoadInst should store Align, not MaybeAlign.

Authored by efriedma on Apr 3 2020, 9:56 PM.

Description

LoadInst should store Align, not MaybeAlign.

The fact that loads and stores can have the alignment missing is a
constant source of confusion: code that usually works can break down in
rare cases. So fix the LoadInst API so the alignment is never missing.

To reduce the number of changes required to make this work, IRBuilder
and certain LoadInst constructors will grab the module's datalayout and
compute the alignment automatically. This is the same alignment
instcombine would eventually apply anyway; we're just doing it earlier.
There's a minor risk that the way we're retrieving the datalayout
could break out-of-tree code, but I don't think that's likely.

This is the last in a series of patches, so most of the necessary
changes have already been merged.

Differential Revision: https://reviews.llvm.org/D77454

Details

Committed
efriedmaMay 14 2020, 1:19 PM
Differential Revision
D77454: LoadInst should store Align, not MaybeAlign.
Parents
rG2b7fe0863ac3: [WebAssembly] Added Debug Fixup pass
Branches
Unknown
Tags
Unknown