Home
last modified time | relevance | path

Searched refs:gcd (Results 1 – 25 of 51) sorted by relevance

123

/llvm-project-15.0.7/polly/lib/External/isl/imath/tests/
H A Dgcd.tc3 gcd:0,0,0:$MP_UNDEF
4 gcd:0,0,=1:$MP_UNDEF
5 gcd:0,0,=2:$MP_UNDEF
10 gcd:844378,24,0:2
11 gcd:209,3,0:1
14 gcd:641,701,0:1
16 gcd:-95,4770,0:5
21 gcd:618,-3,0:3
23 gcd:28271,6,0:1
25 gcd:99,-565,0:1
[all …]
/llvm-project-15.0.7/mlir/lib/Analysis/Presburger/
H A DUtils.cpp30 int64_t gcd = in normalizeDivisionByGCD() local
41 gcd = llvm::greatestCommonDivisor(std::abs(dividend[i]), gcd); in normalizeDivisionByGCD()
42 if (gcd == 1) in normalizeDivisionByGCD()
48 [gcd](int64_t &n) { return floorDiv(n, gcd); }); in normalizeDivisionByGCD()
49 divisor /= gcd; in normalizeDivisionByGCD()
319 gcd = llvm::GreatestCommonDivisor64(gcd, std::abs(elem)); in gcdRange()
323 return gcd; in gcdRange()
328 if (gcd == 0 || gcd == 1) in normalizeRange()
329 return gcd; in normalizeRange()
332 return gcd; in normalizeRange()
[all …]
/llvm-project-15.0.7/mlir/lib/Dialect/Affine/Analysis/
H A DLoopAnalysis.cpp120 Optional<uint64_t> gcd; in getLargestDivisorOfTripCount() local
135 if (gcd.has_value()) in getLargestDivisorOfTripCount()
136 gcd = llvm::GreatestCommonDivisor64(gcd.value(), thisGcd); in getLargestDivisorOfTripCount()
138 gcd = thisGcd; in getLargestDivisorOfTripCount()
140 assert(gcd.has_value() && "value expected per above logic"); in getLargestDivisorOfTripCount()
141 return gcd.value(); in getLargestDivisorOfTripCount()
/llvm-project-15.0.7/compiler-rt/lib/xray/
H A Dxray_utils.h57 constexpr size_t gcd(size_t a, size_t b) { in gcd() function
58 return (b == 0) ? a : gcd(b, a % b); in gcd()
61 constexpr size_t lcm(size_t a, size_t b) { return a * b / gcd(a, b); } in lcm()
/llvm-project-15.0.7/polly/lib/External/isl/
H A Disl_seq.c241 void isl_seq_gcd(isl_int *p, unsigned len, isl_int *gcd) in isl_seq_gcd() argument
246 isl_int_set_si(*gcd, 0); in isl_seq_gcd()
249 isl_int_abs(*gcd, p[min]); in isl_seq_gcd()
250 for (i = 0; isl_int_cmp_si(*gcd, 1) > 0 && i < len; ++i) { in isl_seq_gcd()
255 isl_int_gcd(*gcd, *gcd, p[i]); in isl_seq_gcd()
H A Disl_stride.c264 isl_val *gcd, *a, *b; in detect_stride() local
266 gcd = isl_val_gcdext(v, isl_val_copy(stride), &a, &b); in detect_stride()
267 isl_val_free(gcd); in detect_stride()
H A Disl_map_simplify.c51 isl_int gcd; in isl_basic_map_normalize_constraints() local
57 isl_int_init(gcd); in isl_basic_map_normalize_constraints()
70 isl_int_gcd(gcd, gcd, bmap->eq[i][0]); in isl_basic_map_normalize_constraints()
71 if (isl_int_is_one(gcd)) in isl_basic_map_normalize_constraints()
92 isl_int_gcd(gcd, gcd, bmap->ineq[i][0]); in isl_basic_map_normalize_constraints()
98 isl_int_clear(gcd); in isl_basic_map_normalize_constraints()
102 isl_int_clear(gcd); in isl_basic_map_normalize_constraints()
3159 isl_int gcd; in reduce_stride_constraints() local
3167 isl_int_init(gcd); in reduce_stride_constraints()
3193 isl_int_clear(gcd); in reduce_stride_constraints()
[all …]
H A Disl_affine_hull.c1030 isl_int gcd; in add_strides() local
1037 isl_int_init(gcd); in add_strides()
1039 isl_seq_gcd(M->row[i], M->n_col, &gcd); in add_strides()
1040 if (isl_int_is_divisible_by(gcd, M->row[0][0])) in add_strides()
1054 isl_int_clear(gcd); in add_strides()
1058 isl_int_clear(gcd); in add_strides()
/llvm-project-15.0.7/libcxx/test/std/numerics/numeric.ops/numeric.ops.gcd/
H A Dgcd.pass.cpp45 static_assert(std::is_same_v<Output, decltype(std::gcd(value1, value2))>, ""); in test0()
46 static_assert(std::is_same_v<Output, decltype(std::gcd(value2, value1))>, ""); in test0()
47 assert(static_cast<Output>(out) == std::gcd(value1, value2)); in test0()
141 auto res = std::gcd(static_cast<std::int64_t>(1234), INT32_MIN); in main()
H A Dgcd.not_integral1.compile.fail.cpp23 std::gcd(2.0, 4); in main()
H A Dgcd.bool4.compile.fail.cpp23 std::gcd<int, const bool>(2, true); in main()
H A Dgcd.bool1.compile.fail.cpp23 std::gcd(false, 4); in main()
H A Dgcd.bool3.compile.fail.cpp23 std::gcd<volatile bool, int>(false, 4); in main()
H A Dgcd.not_integral2.compile.fail.cpp23 std::gcd(4, 6.0); in main()
H A Dgcd.bool2.compile.fail.cpp23 std::gcd(2, true); in main()
/llvm-project-15.0.7/libc/src/string/memory_utils/
H A Daddress.h69 static constexpr size_t gcd(size_t A, size_t B) { in gcd() function
70 return B == 0 ? A : gcd(B, A % B); in gcd()
74 constexpr size_t GCD = gcd(ByteOffset, ALIGNMENT); in commonAlign()
/llvm-project-15.0.7/libcxx/include/__numeric/
H A Dgcd_lcm.h60 gcd(_Tp __m, _Up __n)
84 _Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
/llvm-project-15.0.7/mlir/lib/IR/
H A DAffineExpr.cpp1202 uint64_t gcd = rhsConst; in visitModExpr() local
1204 gcd = llvm::GreatestCommonDivisor64(gcd, std::abs(lhs[i])); in visitModExpr()
1206 if (gcd != 1) { in visitModExpr()
1208 floorDividend[i] = floorDividend[i] / static_cast<int64_t>(gcd); in visitModExpr()
1210 int64_t floorDivisor = rhsConst / static_cast<int64_t>(gcd); in visitModExpr()
1314 uint64_t gcd = std::abs(rhsConst); in visitDivExpr() local
1316 gcd = llvm::GreatestCommonDivisor64(gcd, std::abs(lhs[i])); in visitDivExpr()
1318 if (gcd != 1) { in visitDivExpr()
1320 lhs[i] = lhs[i] / static_cast<int64_t>(gcd); in visitDivExpr()
1322 int64_t divisor = rhsConst / static_cast<int64_t>(gcd); in visitDivExpr()
/llvm-project-15.0.7/lldb/source/Host/common/
H A DGetOptInc.cpp44 static int gcd(int, int);
56 static int gcd(int a, int b) { in gcd() function
87 ncycle = gcd(nnonopts, nopts); in permute_args()
/llvm-project-15.0.7/llvm/test/CodeGen/PowerPC/
H A Daix-complex.ll6 @gcd = external global { double, double }, align 8
34 …store double %0, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32…
35 …store double %1, double* getelementptr inbounds ({ double, double }, { double, double }* @gcd, i32…
/llvm-project-15.0.7/polly/lib/External/isl/imath/
H A Dimrat.c854 mpz_t gcd; in s_rat_reduce() local
864 if ((res = mp_int_init(&gcd)) != MP_OK) return res; in s_rat_reduce()
866 if ((res = mp_int_gcd(MP_NUMER_P(r), MP_DENOM_P(r), &gcd)) != MP_OK) { in s_rat_reduce()
870 if (mp_int_compare_value(&gcd, 1) != 0) { in s_rat_reduce()
871 if ((res = mp_int_div(MP_NUMER_P(r), &gcd, MP_NUMER_P(r), NULL)) != MP_OK) { in s_rat_reduce()
874 if ((res = mp_int_div(MP_DENOM_P(r), &gcd, MP_DENOM_P(r), NULL)) != MP_OK) { in s_rat_reduce()
888 mp_int_clear(&gcd); in s_rat_reduce()
/llvm-project-15.0.7/mlir/include/mlir/Analysis/Presburger/
H A DSlowMPInt.h70 friend SlowMPInt gcd(const SlowMPInt &a, const SlowMPInt &b);
97 SlowMPInt gcd(const SlowMPInt &a, const SlowMPInt &b);
/llvm-project-15.0.7/llvm/test/CodeGen/X86/
H A D2011-01-24-DbgValue-Before-Use.ll24 define i64 @gcd(i64 %a, i64 %b) nounwind readnone optsize noinline ssp !dbg !0 {
58 %call6 = tail call i64 @gcd(i64 %conv, i64 %conv5) optsize, !dbg !26
82 !0 = distinct !DISubprogram(name: "gcd", line: 5, isLocal: false, isDefinition: true, virtualIndex:…
/llvm-project-15.0.7/mlir/unittests/Analysis/Presburger/
H A DMPIntTest.cpp193 EXPECT_EQ(gcd(2 * y, 3 * y), y); in TYPED_TEST()
195 EXPECT_EQ(gcd(15 * y, 6 * y), 3 * y); in TYPED_TEST()
/llvm-project-15.0.7/clang/test/CXX/drs/
H A Ddr3xx.cpp1138 friend number gcd(number &x, number &y) {}
1143 a = gcd(a, b);
1144 b = gcd(3, 4); // expected-error {{undeclared}}
1152 friend number gcd(number x, number y) { return 0; }
1157 a = gcd(a, b);
1158 b = gcd(3, 4); // expected-error {{undeclared}}

123