[PATCH] D68944: [Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 02:37:15 PDT 2019


gchatelet added inline comments.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeReader.cpp:4764
 
-      AllocaInst *AI = new AllocaInst(Ty, AS, Size, Align);
+      AllocaInst *AI = new AllocaInst(Ty, AS, Size, Align ? Align->value() : 0);
       AI->setUsedWithInAlloca(InAlloca);
----------------
courbet wrote:
> `getValueOr()` ? (here and below)
Unfortunately this doesn't work: `MaybeAlign` is a `llvm::Optional<Align>` so `getValueOr()` only accepts `Align` values which can't be `0` by definition.
The code will clean itself with the transition of `(Alloca|Load|Store)Inst` to `Align`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68944/new/

https://reviews.llvm.org/D68944





More information about the llvm-commits mailing list