<div dir="ltr">Missing commit message? (could you provide it in a reply here - and try to include commit messages in the commit in the future (ie: don't bother reverting & recommitting this just to add a commit message unless you particularly want to - some people might appreciate it when trawling through the logs))</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 3, 2016 at 11:01 AM, Jack Liu via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: liu12295<br>
Date: Tue May 3 13:01:43 2016<br>
New Revision: 268409<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=268409&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=268409&view=rev</a><br>
Log: (empty)<br>
<br>
Modified:<br>
llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>
llvm/trunk/test/Transforms/SROA/address-spaces.ll<br>
<br>
Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=268409&r1=268408&r2=268409&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=268409&r1=268408&r2=268409&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Tue May 3 13:01:43 2016<br>
@@ -1635,8 +1635,10 @@ static bool canConvertValue(const DataLa<br>
OldTy = OldTy->getScalarType();<br>
NewTy = NewTy->getScalarType();<br>
if (NewTy->isPointerTy() || OldTy->isPointerTy()) {<br>
- if (NewTy->isPointerTy() && OldTy->isPointerTy())<br>
- return true;<br>
+ if (NewTy->isPointerTy() && OldTy->isPointerTy()) {<br>
+ return cast<PointerType>(NewTy)->getPointerAddressSpace() ==<br>
+ cast<PointerType>(OldTy)->getPointerAddressSpace();<br>
+ }<br>
if (NewTy->isIntegerTy() || OldTy->isIntegerTy())<br>
return true;<br>
return false;<br>
<br>
Modified: llvm/trunk/test/Transforms/SROA/address-spaces.ll<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SROA/address-spaces.ll?rev=268409&r1=268408&r2=268409&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SROA/address-spaces.ll?rev=268409&r1=268408&r2=268409&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/test/Transforms/SROA/address-spaces.ll (original)<br>
+++ llvm/trunk/test/Transforms/SROA/address-spaces.ll Tue May 3 13:01:43 2016<br>
@@ -52,7 +52,7 @@ define void @test_address_space_0_1(<2 x<br>
<br>
%struct.struct_test_27.0.13 = type { i32, float, i64, i8, [4 x i32] }<br>
<br>
-; Function Attrs: nounwind<br>
+; Function Attrs: nounwind<br>
define void @copy_struct([5 x i64] %in.coerce) {<br>
; CHECK-LABEL: @copy_struct(<br>
; CHECK-NOT: memcpy<br>
@@ -66,3 +66,20 @@ for.end:<br>
ret void<br>
}<br>
<br>
+%union.anon = type { i32* }<br>
+<br>
+@g = common global i32 0, align 4<br>
+@l = common addrspace(3) global i32 0, align 4<br>
+<br>
+; Make sure an illegal bitcast isn't introduced<br>
+define void @pr27557() {<br>
+; CHECK-LABEL: @pr27557(<br>
+; CHECK: %[[CAST:.*]] = bitcast i32** {{.*}} to i32 addrspace(3)**<br>
+; CHECK: store i32 addrspace(3)* @l, i32 addrspace(3)** %[[CAST]]<br>
+ %1 = alloca %union.anon, align 8<br>
+ %2 = bitcast %union.anon* %1 to i32**<br>
+ store i32* @g, i32** %2, align 8<br>
+ %3 = bitcast %union.anon* %1 to i32 addrspace(3)**<br>
+ store i32 addrspace(3)* @l, i32 addrspace(3)** %3, align 8<br>
+ ret void<br>
+}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>