<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 25, 2013, at 1:29 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">----- Original Message -----<br><blockquote type="cite">You are disabling vectorization for any extractelement. Do they all<br>not work or only the once with a vector operand? (I am not sure we<br>care whether we vectorize code with extractelement for this to be<br>important, I guess).<br><br>      // Check that the instruction return type is vectorizable.<br>-      if (!VectorType::isValidElementType(it->getType()) &&<br>-          !it->getType()->isVoidTy()) {<br>+      // Also, we can't vectorize extractelement instructions.<br>+      if ((!VectorType::isValidElementType(it->getType()) &&<br>+           !it->getType()->isVoidTy()) ||<br>isa<ExtractElementInst>(it)) {<br></blockquote><br>All valid extractelement instructions have a vector operand. Maybe you're thinking about extractvalue (which extracts from aggregates)?<br><br><blockquote type="cite"><br><br>I think if you specify a triple you must put the test in the targets<br>subdirectory:<br><br>+++ b/test/Transforms/LoopVectorize/ee-crash.ll<br>@@ -0,0 +1,35 @@<br>+; RUN: opt < %s -loop-vectorize -force-vector-unroll=1<br>-force-vector-width=4 -S | FileCheck %s<br>+<br>+target datalayout =<br>"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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"<br>+target triple = "x86_64-apple-macosx10.8.0”<br><br>Otherwise, the test might fail when llvm is not compiled with x86_64<br>support.<br></blockquote><br>I don't think that is a problem; or, if it is, then test/Transforms/LoopVectorize/vectorize-once.ll has a problem too.<br><br></div></blockquote><div><br></div><div>It is a problem for people who don’t build the x86 target.  The different targets have lit config files that require the different targets to be built.</div><div><br></div><br><blockquote type="cite"><div style="font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Thanks again,<br>Hal<br><br><blockquote type="cite"><br><br>Thanks,<br>Arnold<br><br>On Oct 25, 2013, at 3:13 PM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br><br><blockquote type="cite">[With the patch this time].<br><br>----- Original Message -----<br><blockquote type="cite">Nadav, Arnold,<br><br>The loop vectorizer does not currently understand how to vectorize<br>extractelement instructions. The existing check, which excluded<br>all<br>vector-valued instructions, did not catch extractelement<br>instructions<br>because<br>it checked only the return value. As a result, vectorization would<br>proceed,<br>producing illegal instructions like this:<br><br>%58 = extractelement <2 x i32> %15, i32 0<br>%59 = extractelement i32 %58, i32 0<br><br>where the second extractelement is illegal because its first<br>operand<br>is not a vector. Later passes (or the verifier) would then crash.<br><br>We could teach the vectorizer to handle this case when<br>vectorizing,<br>but I think that might be a task better associated with a larger<br>effort in vectorizing vectorized loops. Please review.<br><br>Thanks again,<br>Hal<br><br>--<br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<br><br></blockquote><br>--<br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<br><lv-ee-crash.patch><br></blockquote><br><br></blockquote><br>--<span class="Apple-converted-space"> </span><br>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory</div></blockquote></div><br></body></html>