[polly] r193925 - IslCodegen: Do not build upper bound in vector for

Tobias Grosser tobias at grosser.es
Sat Nov 2 05:59:39 PDT 2013


Author: grosser
Date: Sat Nov  2 07:59:39 2013
New Revision: 193925

URL: http://llvm.org/viewvc/llvm-project?rev=193925&view=rev
Log:
IslCodegen: Do not build upper bound in vector for

For for-nodes that are translated to a set of vector lanes, we already know the
overall number of iterations. Calculating the upper bound is consequently not
necessary. This change removes the code for upper bound calculation, which was
probably copy/pasted from the code generation for the normal for-loop.

This issue was found by Sylvestre's scan-build server.

Modified:
    polly/trunk/lib/CodeGen/IslCodeGeneration.cpp

Modified: polly/trunk/lib/CodeGen/IslCodeGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CodeGen/IslCodeGeneration.cpp?rev=193925&r1=193924&r2=193925&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/IslCodeGeneration.cpp Sat Nov  2 07:59:39 2013
@@ -706,22 +706,16 @@ void IslNodeBuilder::createForVector(__i
   isl_ast_expr *Inc = isl_ast_node_for_get_inc(For);
   isl_ast_expr *Iterator = isl_ast_node_for_get_iterator(For);
   isl_id *IteratorID = isl_ast_expr_get_id(Iterator);
-  CmpInst::Predicate Predicate;
-  isl_ast_expr *UB = getUpperBound(For, Predicate);
 
   Value *ValueLB = ExprBuilder.create(Init);
-  Value *ValueUB = ExprBuilder.create(UB);
   Value *ValueInc = ExprBuilder.create(Inc);
 
   Type *MaxType = ExprBuilder.getType(Iterator);
   MaxType = ExprBuilder.getWidestType(MaxType, ValueLB->getType());
-  MaxType = ExprBuilder.getWidestType(MaxType, ValueUB->getType());
   MaxType = ExprBuilder.getWidestType(MaxType, ValueInc->getType());
 
   if (MaxType != ValueLB->getType())
     ValueLB = Builder.CreateSExt(ValueLB, MaxType);
-  if (MaxType != ValueUB->getType())
-    ValueUB = Builder.CreateSExt(ValueUB, MaxType);
   if (MaxType != ValueInc->getType())
     ValueInc = Builder.CreateSExt(ValueInc, MaxType);
 





More information about the llvm-commits mailing list