<div dir="ltr"><div class="gmail_extra">On Thu, Sep 12, 2013 at 2:54 PM, Tom Roeder <span dir="ltr"><<a href="mailto:tmroeder@google.com" target="_blank" class="cremed">tmroeder@google.com</a>></span> wrote:<br><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
In the process of trying to compile Chromium with clang -flto -O3,<br>
I've run into a crash in SROA;  the pass is trying to cast <2 x i64><br>
to <2 x %"struct.webrtc::WindowCapturer::Window"*> with a bitcast,<br>
when it should be using inttoptr. I believe this patch fixes the<br>
problem.<br>
<br>
The problem is that convertValue in lib/Transforms/Scalar/SROA.cpp is<br>
being called to convert the int vector into the pointer vector, and it<br>
falls through all the cases to the bitcast at the end. So, this<br>
patches catches that case and outputs the correct opcode.<br>
<br>
However, I'm not really familiar with either the code itself or the<br>
SROA algorithm, so there might be something wrong with this patch. It<br>
fixes my build, and all tests pass in the test suite, but I haven't<br>
yet been able to extract a minimal test case from the crash I observe<br>
in the massive Chromium LTO build that I've been working on.<br>
<br>
I'm hoping that this description of the crash and the fix will be<br>
enough for someone to point me in the right direction for creating a<br>
simple test case that triggers it.<br></blockquote><div><br></div><div>You should be able to create a simple test by writing code that extracts vector elements with GEPs and getting SROA to convert them to vector loads and stores. Then you just want to get one of them to use pointer types internally and the others to use integers, forcing the value conversion.</div>
<div><br></div><div>You'll likely need a corresponding change to canConvertValue to support vector types.</div><div><br></div><div>You should handle this by stripping the vector-ness first, and then handling the element type, so that non-vector types and vector element types have the same code.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
Tom<br>
</font></span><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div>