[PATCH] Teach SROA about addrspacecast.

Chandler Carruth chandlerc at google.com
Mon Jun 15 17:29:02 PDT 2015


If this is actually still missing, please just start a fresh review thread
with a rebased form of the patch. This one is a year old and doesn't seem
to be particularly useful context.

On Mon, Jun 15, 2015 at 5:07 PM Xuetian Weng <xweng at google.com> wrote:

> So this is a case that we currently want to handle in nvptx, which is not
> covered instcombine/sroa right now.
>
>   ; ModuleID = '<stdin>'
>   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-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"
>   target triple = "nvptx64-unknown-unknown"
>
>   %struct.S = type { i32, i32, i32 }
>
>   ; Function Attrs: nounwind
>   define void @_Z11TakesStruct1SPi(%struct.S* byval nocapture readonly
> %input, i32* nocapture %output) #0 {
>   entry:
>     %input1 = alloca %struct.S, align 8
>     %0 = addrspacecast %struct.S* %input1 to %struct.S addrspace(5)*
>     %input2 = addrspacecast %struct.S* %input to %struct.S addrspace(101)*
>     %input3 = load %struct.S, %struct.S addrspace(101)* %input2, align 4
>     store %struct.S %input3, %struct.S addrspace(5)* %0, align 8
>     %1 = getelementptr inbounds %struct.S, %struct.S addrspace(5)* %0, i64
> 0, i32 1
>     %2 = load i32, i32 addrspace(5)* %1, align 4
>     store i32 %2, i32* %output, align 4
>     ret void
>   }
>
>
> http://reviews.llvm.org/D4501
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150616/4d20cdbc/attachment.html>


More information about the llvm-commits mailing list