[PATCH] D54507: [ThinLTO] Handle chains of aliases
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 12 14:25:06 PST 2018
pcc added inline comments.
================
Comment at: lib/Transforms/Utils/CanonicalizeAliases.cpp:51
+ // Convert to a direct alias of base object.
+ GA.replaceUsesOfWith(
+ GA2, ConstantExpr::getBitCast(GA2->getBaseObject(), GA2->getType()));
----------------
This isn't quite right; it will rewrite
```
ga1 = alias ga2
ga2 = alias gep(gv, 0, 1)
```
as
```
ga1 = alias gv
```
i.e. you will drop the offset from the alias. The implementation in https://reviews.llvm.org/D29781#1328720 handles this case correctly.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54507/new/
https://reviews.llvm.org/D54507
More information about the llvm-commits
mailing list