[PATCH] D80455: [Align] Remove operations on MaybeAlign that asserted that it had a defined value.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 13:25:06 PDT 2020


craig.topper created this revision.
craig.topper added reviewers: efriedma, gchatelet.
Herald added subscribers: kuter, dexonsmith, steven_wu, kbarton, hiraditya, nemanjai.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a project: LLVM.

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 the Align will be implicitly
converted to MaybeAlign and we'll use the MaybeAlign/MaybeAlign

/!=. I don't think that's a big problem though.
-----------------------------------------------


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80455

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80455.265793.patch
Type: text/x-patch
Size: 14850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200522/719d3511/attachment.bin>


More information about the llvm-commits mailing list