[PATCH] D153453: [MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 04:43:49 PDT 2023


khei4 added a comment.

@nikic Although I can conservatively add checks that confirm load/store and src/dest allocas are all in one BB, following simple load/store separated test (https://reviews.llvm.org/D155179) doesn't reproduce the error on openmp

  define void @multi_bb_load_store(i1 %b) {
    %src = alloca i32, align 4
    %dest = alloca i32, align 4
    call void @llvm.lifetime.start.p0(i64 4, ptr nocapture %src)
    call void @llvm.lifetime.start.p0(i64 4, ptr nocapture %dest)
    store i32 42, ptr %src
    %1 = call i32 @use_nocapture(ptr nocapture %src)
  
    %src.val = load i32, ptr %src
    br label %bb0
  
  bb0:
    store i32 %src.val, ptr %dest
    br label %bb1
  
  bb1:
    %2 = call i32 @use_nocapture(ptr nocapture %dest)
    call void @llvm.lifetime.end.p0(i64 4, ptr nocapture %src)
    call void @llvm.lifetime.end.p0(i64 4, ptr nocapture %dest)
    ret void
  }

I'll find `openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp` 's IR to reproduce the failure locally.

@jplehr 
Sorry, I'm pretty novice for openMP, and https://godbolt.org/z/1xq5Ta9rh 's output IR doesn't reproduce the failure we see on the build, could you kindly teach me what is a good way to obtain failed IR?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153453



More information about the llvm-commits mailing list