<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hi,<br>
I have the llvm loop vectorizer to complie the following sample:<br>
//=================<br>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=ISO-8859-1">
<p align="LEFT">int test(int *a, int n) {
</p>
<p align="LEFT"> for(int i = 0; i < n; i++) {
</p>
<p align="LEFT"> a[i] += i;
</p>
<p align="LEFT"> }
</p>
<p align="LEFT">
</p>
<p align="LEFT"> return 0;
</p>
<p align="LEFT">} <br>
</p>
<p align="LEFT">//================<br>
The corresponded .ll file has a loop preheader:<br>
//================<br>
</p>
<p align="LEFT">for.body.lr.ph: ;
preds = %entry<br>
%cnt.cast = zext i32 %n to i64<br>
%0 = and i32 %n, 7<br>
%n.mod.vf = zext i32 %0 to i64<br>
%n.vec = sub i64 %cnt.cast, %n.mod.vf<br>
%cmp.zero = icmp eq i32 %0, %n<br>
br i1 %cmp.zero, label %middle.block, label %vector.body<br>
//================<br>
</p>
<p align="LEFT"> That is , if n <=7, the program will skip
the vector.body. In LoopVectorize.cpp , I see the following code:<br>
//================ <br>
</p>
<p align="LEFT"> static cl::opt<unsigned><br>
TinyTripCountVectorThreshold("vectorizer-min-trip-count",
cl::init(16), ... );<br>
//================<br>
</p>
<p align="LEFT"> The minimal loop count is 16. What is the
"n<=7" meaning? Thanks.<br>
</p>
</body>
</html>