[PATCH] D142708: Transition GlobalObject alignment from MaybeAlign to Align

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 05:02:27 PST 2023


gchatelet created this revision.
gchatelet added reviewers: courbet, efriedma.
Herald added subscribers: Enna1, ormris, steven_wu, hiraditya.
Herald added a project: All.
gchatelet requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is a follow up on https://reviews.llvm.org/D142459#4081179.
This first patch adds an overload to `GlobalObject::setAlignment` that accepts an `Align` type.
This already handles most of the calls.

This patch also converts a few call sites to the new type when this is safe.

Here is the list of the remaining call sites:

- clang/lib/CodeGen/CodeGenModule.cpp:1688 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/clang/lib/CodeGen/CodeGenModule.cpp#L1688>
- llvm/lib/AsmParser/LLParser.cpp:1309 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/AsmParser/LLParser.cpp#L1309>
- llvm/lib/AsmParser/LLParser.cpp:6050 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/AsmParser/LLParser.cpp#L6050>
- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:3871 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L3871>
- llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4030 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L4030>
- llvm/lib/IR/Core.cpp:2018 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/IR/Core.cpp#L2018>
- llvm/lib/IR/Globals.cpp:141 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/IR/Globals.cpp#L141>
- llvm/lib/Linker/IRMover.cpp:660 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Linker/IRMover.cpp#L660>
- llvm/lib/Linker/LinkModules.cpp:361 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Linker/LinkModules.cpp#L361>
- llvm/lib/Linker/LinkModules.cpp:362 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Linker/LinkModules.cpp#L362>
- llvm/lib/Transforms/IPO/MergeFunctions.cpp:782 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Transforms/IPO/MergeFunctions.cpp#L782>
- llvm/lib/Transforms/IPO/MergeFunctions.cpp:840 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Transforms/IPO/MergeFunctions.cpp#L840>
- llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp:1813 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp#L1813>
- llvm/tools/llvm-reduce/deltas/ReduceGlobalObjects.cpp:27 <https://github.com/llvm/llvm-project/blob/e195e6bad6706230a4b5fd4b5cc13de1f16f25cc/llvm/tools/llvm-reduce/deltas/ReduceGlobalObjects.cpp#L27>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142708

Files:
  llvm/include/llvm/IR/GlobalObject.h
  llvm/include/llvm/LTO/LTO.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/IR/Globals.cpp
  llvm/lib/LTO/LTO.cpp
  llvm/lib/Transforms/IPO/OpenMPOpt.cpp
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142708.492710.patch
Type: text/x-patch
Size: 4585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230127/b35e5574/attachment.bin>


More information about the llvm-commits mailing list