Lines Matching full:create
93 // Create the function.
97 func = builder.create<func::FuncOp>(
114 Value iOffset = builder.create<arith::MulIOp>(loc, args[0], cstep);
115 Value jOffset = builder.create<arith::MulIOp>(loc, args[1], cstep);
119 Value i = builder.create<arith::AddIOp>(loc, ak, iOffset);
120 Value j = builder.create<arith::AddIOp>(loc, ak, jOffset);
134 // Create code for the first (xPerm + ny) buffers.
145 // Create code for the remaining buffers.
168 Value vi = builder.create<memref::LoadOp>(loc, buffer, i);
169 Value vj = builder.create<memref::LoadOp>(loc, buffer, j);
170 builder.create<memref::StoreOp>(loc, vj, buffer, i);
171 builder.create<memref::StoreOp>(loc, vi, buffer, j);
178 /// each pair is create via `compareBuilder`.
196 builder.create<scf::YieldOp>(loc, ifOp.getResult(0));
210 Value vi = builder.create<memref::LoadOp>(loc, x, i);
211 Value vj = builder.create<memref::LoadOp>(loc, x, j);
215 res = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq, vi, vj);
216 // For 1D, we create a compare without any control flow. Otherwise, we
217 // create YieldOp to return the result in the nested if-stmt.
219 builder.create<scf::YieldOp>(loc, res);
222 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ne, vi, vj);
223 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, builder.getIntegerType(1),
228 builder.create<scf::YieldOp>(loc, f);
264 Value vi = builder.create<memref::LoadOp>(loc, x, i);
265 Value vj = builder.create<memref::LoadOp>(loc, x, j);
269 res = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult, vi, vj);
270 // For 1D, we create a compare without any control flow. Otherwise, we
271 // create YieldOp to return the result in the nested if-stmt.
273 builder.create<scf::YieldOp>(loc, res);
276 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ne, vi, vj);
277 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, builder.getIntegerType(1),
282 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult, vi, vj);
283 builder.create<scf::YieldOp>(loc, lt);
340 scf::WhileOp whileOp = builder.create<scf::WhileOp>(
347 Value cond1 = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult,
350 builder.create<scf::ConditionOp>(loc, cond1, before->getArguments());
360 Value mid = builder.create<arith::ShRUIOp>(
361 loc, builder.create<arith::AddIOp>(loc, lo, hi), c1);
362 Value midp1 = builder.create<arith::AddIOp>(loc, mid, c1);
375 Value newLo = builder.create<arith::SelectOp>(loc, cond2, lo, midp1);
376 Value newHi = builder.create<arith::SelectOp>(loc, cond2, mid, hi);
377 builder.create<scf::YieldOp>(loc, ValueRange{newLo, newHi});
380 builder.create<func::ReturnOp>(loc, whileOp.getResult(0));
396 builder.create<scf::WhileOp>(loc, TypeRange{i.getType()}, ValueRange{i});
412 builder.create<scf::ConditionOp>(loc, cond, before->getArguments());
418 i = builder.create<arith::AddIOp>(loc, after->getArgument(0), cs);
419 builder.create<scf::YieldOp>(loc, ValueRange{i});
443 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, cond, /*else=*/false);
520 Value hiP1 = builder.create<arith::AddIOp>(loc, hi, c1);
521 Value len = builder.create<arith::SubIOp>(loc, hiP1, lo);
523 Value lenCond = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult,
525 scf::IfOp lenIf = builder.create<scf::IfOp>(loc, lenCond, /*else=*/true);
534 Value miP1 = builder.create<arith::AddIOp>(loc, hi, c1);
535 Value a = builder.create<arith::AddIOp>(loc, lo, miP1);
537 a = builder.create<arith::ShRUIOp>(loc, a, c1);
538 Value b = builder.create<arith::AddIOp>(loc, mi, hiP1);
540 b = builder.create<arith::ShRUIOp>(loc, b, c1);
592 Value sum = builder.create<arith::AddIOp>(loc, lo, hi);
594 Value p = builder.create<arith::ShRUIOp>(loc, sum, c1);
597 Value j = builder.create<arith::SubIOp>(loc, hi, c1);
603 scf::WhileOp whileOp = builder.create<scf::WhileOp>(loc, types, operands);
609 builder.create<scf::ConditionOp>(loc, before->getArgument(3),
632 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult, i, j);
633 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, types, cond, /*else=*/true);
640 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq, i, p);
641 scf::IfOp ifOpI = builder.create<scf::IfOp>(loc, TypeRange{p.getType()},
644 builder.create<scf::YieldOp>(loc, ValueRange{j});
647 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::eq, j, p);
648 scf::IfOp ifOpJ = builder.create<scf::IfOp>(loc, TypeRange{p.getType()},
651 builder.create<scf::YieldOp>(loc, ValueRange{i});
653 builder.create<scf::YieldOp>(loc, ValueRange{p});
655 builder.create<scf::YieldOp>(loc, ifOpJ.getResults());
658 builder.create<arith::AndIOp>(loc, iCompareEq, jCompareEq);
659 scf::IfOp ifOp2 = builder.create<scf::IfOp>(
662 Value i2 = builder.create<arith::AddIOp>(loc, i, c1);
663 Value j2 = builder.create<arith::SubIOp>(loc, j, c1);
664 builder.create<scf::YieldOp>(loc, ValueRange{i2, j2});
666 builder.create<scf::YieldOp>(loc, ValueRange{i, j});
668 builder.create<scf::YieldOp>(
675 p = builder.create<arith::AddIOp>(loc, j,
677 builder.create<scf::YieldOp>(
682 builder.create<scf::YieldOp>(loc, ifOp.getResults());
686 builder.create<func::ReturnOp>(loc, whileOp.getResult(2));
693 Value res = builder.create<arith::SubIOp>(loc, n, i2);
695 return builder.create<arith::ShRUIOp>(loc, res, i1);
746 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::uge, n, c2);
747 scf::IfOp ifN = builder.create<scf::IfOp>(loc, condN, /*else=*/false);
749 Value child = builder.create<arith::SubIOp>(loc, start, first);
754 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::uge, t, child);
755 scf::IfOp ifNc = builder.create<scf::IfOp>(loc, condNc, /*else=*/false);
771 Value lChild = builder.create<arith::ShLIOp>(loc, r, c1);
772 lChild = builder.create<arith::AddIOp>(loc, lChild, c1);
773 Value lChildIdx = builder.create<arith::AddIOp>(loc, lChild, first);
774 Value rChild = builder.create<arith::AddIOp>(loc, lChild, c1);
775 Value cond1 = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult,
779 builder.create<scf::IfOp>(loc, ifTypes, cond1, /*else=*/true);
781 Value rChildIdx = builder.create<arith::AddIOp>(loc, rChild, first);
788 builder.create<scf::IfOp>(loc, ifTypes, cond2, /*else=*/true);
790 builder.create<scf::YieldOp>(loc, ValueRange{rChild, rChildIdx});
792 builder.create<scf::YieldOp>(loc, ValueRange{lChild, lChildIdx});
794 builder.create<scf::YieldOp>(loc, if2.getResults());
796 builder.create<scf::YieldOp>(loc, ValueRange{lChild, lChildIdx});
806 scf::WhileOp whileOp = builder.create<scf::WhileOp>(
818 builder.create<scf::ConditionOp>(loc, cond, before->getArguments());
830 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::uge, t, child);
831 scf::IfOp if2 = builder.create<scf::IfOp>(
835 builder.create<scf::YieldOp>(loc, ValueRange{newChild, newChildIdx});
837 builder.create<scf::YieldOp>(loc, ValueRange{child, childIdx});
839 builder.create<scf::YieldOp>(
843 builder.create<func::ReturnOp>(loc);
873 Value n = builder.create<arith::SubIOp>(loc, hi, lo);
879 Value up = builder.create<arith::AddIOp>(loc, s, c1);
880 scf::ForOp forI = builder.create<scf::ForOp>(loc, c0, up, c1);
882 Value i = builder.create<arith::SubIOp>(loc, s, forI.getInductionVar());
883 Value lopi = builder.create<arith::AddIOp>(loc, lo, i);
890 builder.create<func::CallOp>(loc, shiftDownFunc, TypeRange(),
895 up = builder.create<arith::SubIOp>(loc, n, c1);
896 scf::ForOp forL = builder.create<scf::ForOp>(loc, c0, up, c1);
898 Value l = builder.create<arith::SubIOp>(loc, n, forL.getInductionVar());
899 Value loplm1 = builder.create<arith::AddIOp>(loc, lo, l);
900 loplm1 = builder.create<arith::SubIOp>(loc, loplm1, c1);
906 builder.create<arith::SubIOp>(loc, l, c1);
907 builder.create<func::CallOp>(loc, shiftDownFunc, TypeRange(),
911 builder.create<func::ReturnOp>(loc);
931 .create<func::CallOp>(loc, partitionFunc,
936 Value lenLow = builder.create<arith::SubIOp>(loc, p, lo);
937 Value lenHigh = builder.create<arith::SubIOp>(loc, hi, p);
940 Value len = builder.create<arith::SubIOp>(loc, hi, lo);
942 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ugt, len, c2);
944 builder.create<scf::IfOp>(loc, types, lenGtTwo, /*else=*/true);
947 builder.create<scf::YieldOp>(loc, ValueRange{lo, lo});
951 Value cond = builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ule,
955 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, types, cond, /*else=*/true);
959 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ne, len, c0);
960 scf::IfOp ifOp = builder.create<scf::IfOp>(loc, cond, /*else=*/false);
964 builder.create<func::CallOp>(loc, func, operands);
972 builder.create<scf::YieldOp>(loc, ValueRange{p, hi});
976 builder.create<scf::YieldOp>(loc, ValueRange{lo, p});
979 builder.create<scf::YieldOp>(loc, ifOp.getResults());
1014 Value lop1 = builder.create<arith::AddIOp>(loc, lo, c1);
1017 scf::ForOp forOpI = builder.create<scf::ForOp>(loc, lop1, hi, c1);
1028 .create<func::CallOp>(loc, searchFunc, TypeRange{c1.getType()},
1038 d.push_back(builder.create<memref::LoadOp>(loc, buffer, i));
1043 Value imp = builder.create<arith::SubIOp>(loc, i, p);
1045 scf::ForOp forOpJ = builder.create<scf::ForOp>(loc, c0, imp, c1);
1048 Value imj = builder.create<arith::SubIOp>(loc, i, j);
1050 operands[0] = builder.create<arith::SubIOp>(loc, imj, c1);
1054 Value t = builder.create<memref::LoadOp>(loc, buffer, imjm1);
1055 builder.create<memref::StoreOp>(loc, t, buffer, imj);
1064 builder.create<memref::StoreOp>(loc, d[k], buffer, p);
1068 builder.create<func::ReturnOp>(loc);
1130 builder.create<scf::WhileOp>(loc, types, SmallVector<Value, 2>{lo, hi});
1139 builder.create<arith::AddIOp>(loc, lo, constantIndex(builder, loc, 1));
1141 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ult, loP1, hi);
1142 builder.create<scf::ConditionOp>(loc, needSort, before->getArguments());
1154 Value len = builder.create<arith::SubIOp>(loc, hi, lo);
1156 Value lenCond = builder.create<arith::CmpIOp>(
1159 builder.create<scf::IfOp>(loc, types, lenCond, /*else=*/true);
1166 builder.create<func::CallOp>(loc, insertionSortFunc, TypeRange(),
1168 builder.create<scf::YieldOp>(loc, ValueRange{lo, lo});
1173 depthLimit = builder.create<arith::SubIOp>(loc, depthLimit,
1176 builder.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ule,
1179 builder.create<scf::IfOp>(loc, types, depthCond, /*else=*/true);
1186 builder.create<func::CallOp>(loc, heapSortFunc, TypeRange(),
1188 builder.create<scf::YieldOp>(loc, ValueRange{lo, lo});
1195 builder.create<scf::YieldOp>(loc, ValueRange{lo, hi});
1200 builder.create<scf::YieldOp>(loc, ValueRange{lo, hi});
1211 builder.create<scf::YieldOp>(loc, ValueRange{lo, hi});
1215 builder.create<func::ReturnOp>(loc);
1231 v = rewriter.create<memref::CastOp>(loc, newMtp, v);
1251 Value len = rewriter.create<arith::IndexCastOp>(
1253 rewriter.create<arith::SubIOp>(loc, hi, lo));
1254 Value depthLimit = rewriter.create<arith::SubIOp>(
1256 rewriter.create<math::CountLeadingZerosOp>(loc, len));
1310 Value capacity = rewriter.create<memref::DimOp>(loc, buffer, c0);
1315 Value newSize = rewriter.create<arith::AddIOp>(loc, size, n);
1320 Value cond = rewriter.create<arith::CmpIOp>(
1326 scf::IfOp ifOp = rewriter.create<scf::IfOp>(loc, bufferType, cond,
1331 capacity = rewriter.create<arith::MulIOp>(loc, capacity, c2);
1336 rewriter.create<scf::WhileOp>(loc, capacity.getType(), capacity);
1344 rewriter.create<arith::MulIOp>(loc, before->getArgument(0), c2);
1345 cond = rewriter.create<arith::CmpIOp>(loc, arith::CmpIPredicate::ugt,
1347 rewriter.create<scf::ConditionOp>(loc, cond, ValueRange{capacity});
1352 rewriter.create<scf::YieldOp>(loc, after->getArguments());
1359 rewriter.create<memref::ReallocOp>(loc, bufferType, buffer, capacity);
1361 Value fillSize = rewriter.create<arith::SubIOp>(loc, capacity, newSize);
1363 Value subBuffer = rewriter.create<memref::SubViewOp>(
1367 rewriter.create<linalg::FillOp>(loc, fillValue, subBuffer);
1369 rewriter.create<scf::YieldOp>(loc, newBuffer);
1373 rewriter.create<scf::YieldOp>(loc, buffer);
1382 rewriter.create<memref::StoreOp>(loc, value, buffer, size);
1384 Value subBuffer = rewriter.create<memref::SubViewOp>(
1387 rewriter.create<linalg::FillOp>(loc, value, subBuffer);