[PATCH] Make Scalar Replacement of Aggregates use the right opcode for converting from vector-of-int to vector-of-pointer

Tom Roeder tmroeder at google.com
Thu Sep 12 14:54:04 PDT 2013


Hi,

In the process of trying to compile Chromium with clang -flto -O3,
I've run into a crash in SROA;  the pass is trying to cast <2 x i64>
to <2 x %"struct.webrtc::WindowCapturer::Window"*> with a bitcast,
when it should be using inttoptr. I believe this patch fixes the
problem.

The problem is that convertValue in lib/Transforms/Scalar/SROA.cpp is
being called to convert the int vector into the pointer vector, and it
falls through all the cases to the bitcast at the end. So, this
patches catches that case and outputs the correct opcode.

However, I'm not really familiar with either the code itself or the
SROA algorithm, so there might be something wrong with this patch. It
fixes my build, and all tests pass in the test suite, but I haven't
yet been able to extract a minimal test case from the crash I observe
in the massive Chromium LTO build that I've been working on.

I'm hoping that this description of the crash and the fix will be
enough for someone to point me in the right direction for creating a
simple test case that triggers it.

Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sroa_vector.patch
Type: application/octet-stream
Size: 861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130912/ea2ca7a6/attachment.obj>


More information about the llvm-commits mailing list