[PATCH] D54507: [ThinLTO] Handle chains of aliases

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 12 18:08:44 PST 2018


tejohnson marked an inline comment as done.
tejohnson 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()));
----------------
pcc wrote:
> 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.
You're right. We want to look at the direct aliasee (recursively). Made that change and enhanced the test case to cover this.


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