https://bugs.llvm.org/show_bug.cgi?id=45763
Bug ID: 45763
Summary: Alignment assumptions prevent SROA
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: nikita....@gmail.com
CC: llvm-bugs@lists.llvm.org, matthew.arsena...@amd.com,
stanislav.mekhanos...@amd.com
As reported in https://reviews.llvm.org/D76886#2008588:
; RUN: opt -S -O3 -preserve-alignment-assumptions-during-inlining=true < %s |
FileCheck %s
; CHECK: @caller
; CHECK-NOT: alloca
; CHECK-NEXT: ret void
target datalayout = "e-p:64:64-p5:32:32-A5"
define amdgpu_kernel void @caller() {
%alloca = alloca i64, align 8, addrspace(5)
%cast = addrspacecast i64 addrspace(5)* %alloca to i64*
call void @callee(i64* sret align 8 %cast)
ret void
}
define internal void @callee(i64* noalias sret align 8 %arg) {
store i64 0, i64* %arg, align 8
ret void
}
This results in:
target datalayout = "e-p:64:64-p5:32:32-A5"
define amdgpu_kernel void @caller() local_unnamed_addr {
%alloca = alloca i64, align 8, addrspace(5)
%cast = addrspacecast i64 addrspace(5)* %alloca to i64*
%ptrint = ptrtoint i64* %cast to i64
%maskedptr = and i64 %ptrint, 7
%maskcond = icmp eq i64 %maskedptr, 0
call void @llvm.assume(i1 %maskcond)
ret void
}
declare void @llvm.assume(i1)
The ptrtoint this introduces prevents SROA.
Likely the solution to this is not a change to SROA, but a change to the
representation of alignment assumptions (via assume bundles).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs