[NFC] Avoid unnecessary comparison for min/max expressions
llvm-svn: 271535
This commit is contained in:
parent
6631bfdd1c
commit
4cf79d4ca4
@ -186,7 +186,7 @@ Value *IslExprBuilder::createOpNAry(__isl_take isl_ast_expr *Expr) {
|
|||||||
auto Pred = IsMax ? CmpInst::ICMP_SGT : CmpInst::ICMP_SLT;
|
auto Pred = IsMax ? CmpInst::ICMP_SGT : CmpInst::ICMP_SLT;
|
||||||
auto *V = create(isl_ast_expr_get_op_arg(Expr, 0));
|
auto *V = create(isl_ast_expr_get_op_arg(Expr, 0));
|
||||||
|
|
||||||
for (int i = 0; i < isl_ast_expr_get_op_n_arg(Expr); ++i) {
|
for (int i = 1; i < isl_ast_expr_get_op_n_arg(Expr); ++i) {
|
||||||
auto *OpV = create(isl_ast_expr_get_op_arg(Expr, i));
|
auto *OpV = create(isl_ast_expr_get_op_arg(Expr, i));
|
||||||
unifyTypes(V, OpV);
|
unifyTypes(V, OpV);
|
||||||
V = Builder.CreateSelect(Builder.CreateICmp(Pred, V, OpV), V, OpV);
|
V = Builder.CreateSelect(Builder.CreateICmp(Pred, V, OpV), V, OpV);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user