Check assert before the instruction that uses the assumption checked.
authorTobias Grosser <tobias@grosser.es>
Sat, 10 Jan 2015 07:40:39 +0000 (07:40 +0000)
committerTobias Grosser <tobias@grosser.es>
Sat, 10 Jan 2015 07:40:39 +0000 (07:40 +0000)
I did not find a good test case, as the assert should generally hold in Polly.

llvm-svn: 225582

polly/lib/CodeGen/IslCodeGeneration.cpp

index 9fc101d..4087c84 100644 (file)
@@ -245,11 +245,12 @@ IslNodeBuilder::getUpperBound(__isl_keep isl_ast_node *For,
 
   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;