[llvm-bugs] [Bug 15200] alloca scalarization with dynamic indexing into vectors deletes stores

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 24 02:31:54 PST 2019


https://bugs.llvm.org/show_bug.cgi?id=15200

Florian Hahn <florian_hahn at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |florian_hahn at apple.com
         Resolution|---                         |FIXED

--- Comment #7 from Florian Hahn <florian_hahn at apple.com> ---
Looks fixed in SROA in current master.

Keeps all 4 stores for the modernized LL file

;target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128;-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024--a64:64:64-f80:128:128-n8:16:32:64"
target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v96:128:128-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024"

define void @test_fn(<2 x i32>* %src, <2 x i32>* %results, i32
%alignmentOffsets) nounwind alwaysinline {
entry:
  %sPrivateStorage = alloca [3 x <2 x i32>], align 8
  %0 = load <2 x i32>, <2 x i32>* %src, align 8
  %arrayidx1 = getelementptr inbounds [3 x <2 x i32>], [3 x <2 x i32>]*
%sPrivateStorage, i64 0, i64 0
  store <2 x i32> %0, <2 x i32>* %arrayidx1, align 8
  %arrayidx2 = getelementptr inbounds <2 x i32>, <2 x i32>* %src, i64 1
  %1 = load <2 x i32>, <2 x i32>* %arrayidx2, align 8
  %arrayidx3 = getelementptr inbounds [3 x <2 x i32>], [3 x <2 x i32>]*
%sPrivateStorage, i64 0, i64 1
  store <2 x i32> %1, <2 x i32>* %arrayidx3, align 8
  %arrayidx4 = getelementptr inbounds <2 x i32>, <2 x i32>* %src, i64 2
  %2 = load <2  x i32>, <2 x i32>* %arrayidx4, align 8
  %arrayidx5 = getelementptr inbounds [3 x <2 x i32>], [3 x <2 x i32>]*
%sPrivateStorage, i64 0, i64 2
  store <2 x i32> %2, <2 x i32>* %arrayidx5, align 8
  %idx.ext = zext i32 %alignmentOffsets to i64
  %add.ptr = getelementptr inbounds [3 x <2 x i32>], [3 x <2 x i32>]*
%sPrivateStorage, i64 0, i64 0, i64 %idx.ext
  %3 = load i32, i32* %add.ptr, align 4
  %4 = insertelement <2 x i32> undef, i32 %3, i32 0
  %splat = shufflevector <2 x i32> %4, <2 x i32> undef, <2 x i32>
zeroinitializer
  store <2 x i32> %splat, <2 x i32>* %results, align 8
  ret void
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190124/98722696/attachment.html>


More information about the llvm-bugs mailing list