[PATCH] D76550: [Attributor] Improve the alignment of the loads

omar ahmed via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 14:05:02 PDT 2020


omarahmed added a comment.

sry for late update, Hard times
Anyway I wanted to ask about a thing i noticed in AAPrivatizable attribute :

In this test :

  define internal i32 @test(i32* %X, i32* %Y) {
    %A = load i32, i32* %X
    %B = load i32, i32* %Y
    %C = add i32 %A, %B
    ret i32 %C
  }
  define internal i32 @caller(i32* %B) {
    %A = alloca i32
    store i32 1, i32* %A
    %C = call i32 @test(i32* %A, i32* %B)
    ret i32 %C
  }
  define i32 @callercaller() {
    %B = alloca i32
    store i32 2, i32* %B
    %X = call i32 @caller(i32* %B)
    ret i32 %X
  }

and when i print the base used in loads in createReplacementValues function it prints :

  %A = alloca i32
  i32* B
  %B = alloca i32

and sometimes i run again and it prints :

  %B = alloca i32
  %A = alloca i32
  %B.priv = alloca i32

and i think the base (i32* B) is wrong and it is a base that's because sometimes ACSRepairCB is invoked before FnRepairCB so the alloca instructions are not yet added so it gets the value of the base from the argument itself and not the alloca so isn't we should make sure that FnRepairCB is invoked before ACSRepairCB to make sure that not happens ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76550





More information about the llvm-commits mailing list