Lines Matching defs:Expr

86 bool IslExprBuilder::hasLargeInts(isl::ast_expr Expr) {
87 enum isl_ast_expr_type Type = isl_ast_expr_get_type(Expr.get());
93 isl::val Val = Expr.get_val();
101 int NumArgs = isl_ast_expr_get_op_n_arg(Expr.get());
104 isl::ast_expr Operand = Expr.get_op_arg(i);
186 Value *IslExprBuilder::createOpUnary(__isl_take isl_ast_expr *Expr) {
187 assert(isl_ast_expr_get_op_type(Expr) == isl_ast_op_minus &&
191 Type *MaxType = getType(Expr);
195 V = create(isl_ast_expr_get_op_arg(Expr, 0));
201 isl_ast_expr_free(Expr);
205 Value *IslExprBuilder::createOpNAry(__isl_take isl_ast_expr *Expr) {
206 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
208 assert(isl_ast_expr_get_op_n_arg(Expr) >= 2 &&
212 switch (isl_ast_expr_get_op_type(Expr)) {
223 Value *V = create(isl_ast_expr_get_op_arg(Expr, 0));
225 for (int i = 1; i < isl_ast_expr_get_op_n_arg(Expr); ++i) {
226 Value *OpV = create(isl_ast_expr_get_op_arg(Expr, i));
243 isl_ast_expr_free(Expr);
248 IslExprBuilder::createAccessAddress(__isl_take isl_ast_expr *Expr) {
249 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
251 assert(isl_ast_expr_get_op_type(Expr) == isl_ast_op_access &&
253 assert(isl_ast_expr_get_op_n_arg(Expr) >= 1 &&
260 BaseExpr = isl_ast_expr_get_op_arg(Expr, 0);
287 if (isl_ast_expr_get_op_n_arg(Expr) == 1) {
288 isl_ast_expr_free(Expr);
295 for (unsigned u = 1, e = isl_ast_expr_get_op_n_arg(Expr); u < e; u++) {
296 Value *NextIndex = create(isl_ast_expr_get_op_arg(Expr, u));
346 isl_ast_expr_free(Expr);
350 Value *IslExprBuilder::createOpAccess(__isl_take isl_ast_expr *Expr) {
351 auto Info = createAccessAddress(Expr);
357 Value *IslExprBuilder::createOpBin(__isl_take isl_ast_expr *Expr) {
362 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
364 assert(isl_ast_expr_get_op_n_arg(Expr) == 2 &&
367 OpType = isl_ast_expr_get_op_type(Expr);
369 LHS = create(isl_ast_expr_get_op_arg(Expr, 0));
370 RHS = create(isl_ast_expr_get_op_arg(Expr, 1));
395 MaxType = getWidestType(MaxType, getType(Expr));
460 isl_ast_expr_free(Expr);
464 Value *IslExprBuilder::createOpSelect(__isl_take isl_ast_expr *Expr) {
465 assert(isl_ast_expr_get_op_type(Expr) == isl_ast_op_select &&
468 Type *MaxType = getType(Expr);
470 Cond = create(isl_ast_expr_get_op_arg(Expr, 0));
474 LHS = create(isl_ast_expr_get_op_arg(Expr, 1));
475 RHS = create(isl_ast_expr_get_op_arg(Expr, 2));
487 isl_ast_expr_free(Expr);
491 Value *IslExprBuilder::createOpICmp(__isl_take isl_ast_expr *Expr) {
492 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
497 auto *Op0 = isl_ast_expr_get_op_arg(Expr, 0);
498 auto *Op1 = isl_ast_expr_get_op_arg(Expr, 1);
530 isl_ast_op_type OpType = isl_ast_expr_get_op_type(Expr);
547 isl_ast_expr_free(Expr);
551 Value *IslExprBuilder::createOpBoolean(__isl_take isl_ast_expr *Expr) {
552 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
558 OpType = isl_ast_expr_get_op_type(Expr);
563 LHS = create(isl_ast_expr_get_op_arg(Expr, 0));
564 RHS = create(isl_ast_expr_get_op_arg(Expr, 1));
594 isl_ast_expr_free(Expr);
599 IslExprBuilder::createOpBooleanConditional(__isl_take isl_ast_expr *Expr) {
600 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
609 OpType = isl_ast_expr_get_op_type(Expr);
630 LHS = create(isl_ast_expr_get_op_arg(Expr, 0));
641 RHS = create(isl_ast_expr_get_op_arg(Expr, 1));
653 isl_ast_expr_free(Expr);
657 Value *IslExprBuilder::createOp(__isl_take isl_ast_expr *Expr) {
658 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
660 switch (isl_ast_expr_get_op_type(Expr)) {
667 return createOpAccess(Expr);
670 return createOpNAry(Expr);
679 return createOpBin(Expr);
681 return createOpUnary(Expr);
683 return createOpSelect(Expr);
686 return createOpBoolean(Expr);
689 return createOpBooleanConditional(Expr);
695 return createOpICmp(Expr);
697 return createOpAddressOf(Expr);
703 Value *IslExprBuilder::createOpAddressOf(__isl_take isl_ast_expr *Expr) {
704 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_op &&
706 assert(isl_ast_expr_get_op_n_arg(Expr) == 1 && "Address of should be unary.");
708 isl_ast_expr *Op = isl_ast_expr_get_op_arg(Expr, 0);
716 isl_ast_expr_free(Expr);
721 Value *IslExprBuilder::createId(__isl_take isl_ast_expr *Expr) {
722 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_id &&
728 Id = isl_ast_expr_get_id(Expr);
734 V = UndefValue::get(getType(Expr));
742 isl_ast_expr_free(Expr);
747 IntegerType *IslExprBuilder::getType(__isl_keep isl_ast_expr *Expr) {
755 Value *IslExprBuilder::createInt(__isl_take isl_ast_expr *Expr) {
756 assert(isl_ast_expr_get_type(Expr) == isl_ast_expr_int &&
763 Val = isl_ast_expr_get_val(Expr);
768 T = getType(Expr);
775 isl_ast_expr_free(Expr);
779 Value *IslExprBuilder::create(__isl_take isl_ast_expr *Expr) {
780 switch (isl_ast_expr_get_type(Expr)) {
784 return createOp(Expr);
786 return createId(Expr);
788 return createInt(Expr);
794 llvm::Value *IslExprBuilder::createBool(__isl_take isl_ast_expr *Expr) {
795 Value *Result = create(Expr);