[PATCH] D60793: [Evaluator] Walk initial elements when handling load through bitcast

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 01:31:05 PDT 2019


evgeny777 added a comment.

> what's wrong with keeping it like it is?

Well, if it were possible to avoid the same computation for load I'd like to avoid it. However your patch seems to also handle cases when store is using GEP and load is using bitcast:

  define linkonce_odr dso_local void @_ZN1AC2Ex(%union.A* %this, i64 %ll) unnamed_addr comdat align 2 {
    %l = inttoptr i64 %ll to i8*
    %p = getelementptr inbounds %union.A, %union.A* %this, i64 0, i32 0
    store i8* %l, i8** %p
    ret void
  }
  
  define internal void @__cxx_global_var_init.1() section ".text.startup" {
    %1 = load i64, i64* bitcast (%union.A* @u to i64*), align 8
    store i64 %1, i64* @l, align 8
    ret void
  }

So let's stick with current approach. I'd probably include the example above as a test case.


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

https://reviews.llvm.org/D60793





More information about the llvm-commits mailing list