[PATCH] D128128: [GlobalOpt] Perform store->dominated load forwarding for stored once globals

Ting Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 20:15:02 PDT 2022


tingwang added a comment.

It seems to me following test showed unexpected result

  target datalayout = "e-m:e-i64:64-p:64:64-n32:64-S128-v256:256:256-v512:512:512"
  target triple = "powerpc64le-unknown-linux-gnu"
  
  @lwvar1 = internal global i32 0, align 4
  
  define dso_local signext i32 @main() {
  plmix5_entry:
    %T_4 = alloca i32, align 4
    %"#87" = alloca i32, align 4
    store i32 1, i32* @lwvar1, align 4
    store i32 0, i32* @lwvar1, align 4
    %_val_lwvar1_212 = load i32, i32* @lwvar1, align 4
    store i32 %_val_lwvar1_212, i32* %"#87", align 4
    unreachable
  }

Tried with D128128 <https://reviews.llvm.org/D128128>.id438853.diff: opt -globalopt -S < %s

  ; ModuleID = '<stdin>'
  source_filename = "<stdin>"
  target datalayout = "e-m:e-i64:64-p:64:64-n32:64-S128-v256:256:256-v512:512:512"
  target triple = "powerpc64le-unknown-linux-gnu"
  
  define dso_local signext i32 @main() local_unnamed_addr {
  plmix5_entry:
    %T_4 = alloca i32, align 4
    %"#87" = alloca i32, align 4
    store i32 1, i32* %"#87", align 4
    unreachable
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128128



More information about the llvm-commits mailing list