[Align] Remove operations on MaybeAlign that asserted that it had a defined value.
authorCraig Topper <craig.topper@gmail.com>
Sat, 23 May 2020 04:45:09 +0000 (21:45 -0700)
committerCraig Topper <craig.topper@gmail.com>
Sat, 23 May 2020 04:54:28 +0000 (21:54 -0700)
commit7392820f989048000562b8fa7dade023dddacb37
tree3fd0f6aeda57a51d278fdce779e8af6c8dc63b05
parent0f6bd9cda6c002050b610b886a43c282e4ca2807
[Align] Remove operations on MaybeAlign that asserted that it had a defined value.

If the caller needs to reponsible for making sure the MaybeAlign
has a value, then we should just make the caller convert it to an Align
with operator*.

I explicitly deleted the relational comparison operators that
were being inherited from Optional. It's unclear what the meaning
of two MaybeAligns were one is defined and the other isn't
should be. So make the caller reponsible for defining the behavior.

I left the ==/!= operators from Optional. But now that exposed a
weird quirk that ==/!= between Align and MaybeAlign required the
MaybeAlign to be defined. But now we use the operator== from
Optional that takes an Optional and the Value.

Differential Revision: https://reviews.llvm.org/D80455
12 files changed:
llvm/include/llvm/IR/DataLayout.h
llvm/include/llvm/Support/Alignment.h
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/IR/Globals.cpp
llvm/lib/LTO/LTO.cpp
llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/unittests/Support/AlignmentTest.cpp