[polly] r225582 - Check assert before the instruction that uses the assumption checked.

Tobias Grosser tobias at grosser.es
Fri Jan 9 23:40:40 PST 2015


Author: grosser
Date: Sat Jan 10 01:40:39 2015
New Revision: 225582

URL: http://llvm.org/viewvc/llvm-project?rev=225582&view=rev
Log:
Check assert before the instruction that uses the assumption checked.

I did not find a good test case, as the assert should generally hold in Polly.

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=225582&r1=225581&r2=225582&view=diff
==============================================================================
--- polly/trunk/lib/CodeGen/IslCodeGeneration.cpp (original)
+++ polly/trunk/lib/CodeGen/IslCodeGeneration.cpp Sat Jan 10 01:40:39 2015
@@ -245,11 +245,12 @@ IslNodeBuilder::getUpperBound(__isl_keep
 
   Cond = isl_ast_node_for_get_cond(For);
   Iterator = isl_ast_node_for_get_iterator(For);
-  Type = isl_ast_expr_get_op_type(Cond);
-
+  isl_ast_expr_get_type(Cond);
   assert(isl_ast_expr_get_type(Cond) == isl_ast_expr_op &&
          "conditional expression is not an atomic upper bound");
 
+  Type = isl_ast_expr_get_op_type(Cond);
+
   switch (Type) {
   case isl_ast_op_le:
     Predicate = ICmpInst::ICMP_SLE;





More information about the llvm-commits mailing list