[PATCH] D72710: [InstCombine] Let combineLoadToNewType preserve ABI alignment of the load (PR44543)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 08:40:46 PST 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:465
 
+  unsigned align = LI.getAlignment();
+  if (!align)
----------------
`Align`


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:466
+  unsigned align = LI.getAlignment();
+  if (!align)
+    align = IC.getDataLayout().getABITypeAlignment(LI.getType());
----------------
```
// If old load did not have an explicit alignment specified,
// manually preserve the implied (ABI) alignment of the load.
// Else we may inadvertently incorrectly over-promise alignment.
```


================
Comment at: llvm/test/Transforms/InstCombine/load-bitcast64.ll:3
 
-target datalayout = "p:64:64:64"
+target datalayout = "p:64:64:64-i64:32:32"
 
----------------
Please precommit the test changes first, and please use the script to autogenerate check lines


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72710





More information about the llvm-commits mailing list