Home
last modified time | relevance | path

Searched refs:Fold (Results 1 – 25 of 189) sorted by relevance

12345678

/llvm-project-15.0.7/llvm/include/llvm/Analysis/
H A DTargetFolder.h38 Constant *Fold(Constant *C) const { in Fold() function
60 return Fold(ConstantExpr::get(Opc, LC, RC)); in FoldBinOp()
72 return Fold(ConstantExpr::get( in FoldExactBinOp()
90 return Fold(ConstantExpr::get(Opc, LC, RC, Flags)); in FoldNoWrapBinOp()
106 return Fold(ConstantExpr::getCompare(P, LC, RC)); in FoldICmp()
113 return Fold(ConstantExpr::get(Opc, C)); in FoldUnOpFMF()
136 return Fold(ConstantExpr::getSelect(CC, TC, FC)); in FoldSelect()
192 return Fold(ConstantExpr::getCast(Op, C, DestTy)); in CreateCast()
203 return Fold(ConstantExpr::getPointerCast(C, DestTy)); in CreatePointerCast()
208 return Fold(ConstantExpr::getFPCast(C, DestTy)); in CreateFPCast()
[all …]
/llvm-project-15.0.7/llvm/test/Transforms/InstCombine/
H A Dstrlen-5.ll11 ; Fold strlen(a5_4[0]) to 3.
23 ; Fold strlen(&a5_4[0][1]) to 2.
35 ; Fold strlen(&a5_4[0][2]) to 1.
47 ; Fold strlen(&a5_4[0][3]) to 0.
59 ; Fold strlen(a5_4[1]) to 2.
71 ; Fold strlen(&a5_4[1][1]) to 1.
83 ; Fold strlen(&a5_4[1][2]) to 0.
95 ; Fold strlen(&a5_4[1][3]) to 0.
107 ; Fold strlen(a5_4[2]) to 1.
155 ; Fold strlen(a5_4[3]) to 0
[all …]
H A Dstr-int-3.ll32 ; Fold atoi(a[0].a) to 1.
38 ; Fold atoi(a[0].b) to 12.
44 ; Fold atoi(a[1].a) to 123.
50 ; Fold atoi(a[1].b) to 1234.
106 ; Fold atol(a[0].a) to 1.
112 ; Fold atol(a[0].b) to 12.
118 ; Fold atol(a[0].c) to 56789.
124 ; Fold atol(a[1].a) to 123.
130 ; Fold atol(a[1].b) to 1234.
136 ; Fold atol(a[1].c) to 67890.
[all …]
H A Dmemrchr-3.ll14 ; Fold memrchr(ax, C, 0) to null.
27 ; Fold memrchr(a12345, 3, 0) to null.
40 ; Fold memrchr(a12345, 1, 1) to a12345.
52 ; Fold memrchr(a12345, 5, 1) to null.
64 ; Fold memrchr(a123123, 1, 1) to a123123.
76 ; Fold memrchr(a123123, 3, 1) to null.
117 ; Fold memrchr(a12345, 5, 4) to null.
143 ; Fold memrchr(a12345 + 1, 1, 4) to null.
182 ; Fold memrchr(a12345, 0, %N) to null.
275 ; Fold memrchr(a123123, 0, 6) to null.
[all …]
H A Dstrncmp-4.ll41 ; Fold strncmp(a.a = "123", a.b = "1231", 0) to 0.
46 ; Fold strncmp(a.a = "123", a.b = "1231", 1) to 0.
51 ; Fold strncmp(a.a = "123", a.b = "1231", 2) to 0.
56 ; Fold strncmp(a.a = "123", a.b = "1231", 3) to 0.
61 ; Fold strncmp(a.a = "123", a.b = "1231", 4) to 0.
71 ; Fold strncmp("123", "1231" "2", 5) to 0.
76 ; Fold strncmp("123", "1231" "23", 6) to 0.
81 ; Fold strncmp("123", "1231" "2345", 7) to 1.
86 ; Fold strncmp("123", "1231" "2345", 8) to 1.
91 ; Fold strncmp("123", "1231" "2345", 9) to 1.
[all …]
H A Dmemrchr-5.ll57 ; Fold memrchr(a, 'a', 16) - a to 0 (3 in LE).
65 ; Fold memrchr(a, 'b', 16) - a to 1 (2 in LE)
73 ; Fold memrchr(a, 'c', 16) - a to 2 (1 in LE)
81 ; Fold memrchr(a, 'd', 16) - a to 3 (0 in LE)
89 ; Fold memrchr(a, 'n', 16) - a to 13 (14 in LE)
97 ; Fold memrchr(a, 'o', 16) - a to 14 (13 in LE)
105 ; Fold memrchr(a, 'p', 16) - a to 15 (12 in LE)
209 ; Fold memrchr(a, C, 20) for C in ['a', 'e'].
248 ; Fold memrchr(a, 'b', 16) - a to 17 (18 in LE)
256 ; Fold memrchr(a, 'c', 16) - a to 18 (17 in LE)
[all …]
H A Dstrlen-7.ll55 ; Fold strlen(a[0].a) to 1.
61 ; Fold strlen(a[0].a + 1) to 0.
67 ; Fold strlen(a[0].a + 2) to 0.
73 ; Fold strlen(a[0].a + 3) to 0.
79 ; Fold strlen(a[0].b) to 2.
85 ; Fold strlen(a[0].b + 1) to 1.
91 ; Fold strlen(a[0].b + 2) to 0.
97 ; Fold strlen(a[0].b + 3) to 0.
103 ; Fold strlen(a[0].b + 4) to 0.
109 ; Fold strlen(a[1].a) to 3.
[all …]
H A Dmemchr-5.ll57 ; Fold memchr(a, 'a', 16) - a to 0 (3 in LE).
65 ; Fold memchr(a, 'b', 16) - a to 1 (2 in LE)
73 ; Fold memchr(a, 'c', 16) - a to 2 (1 in LE)
81 ; Fold memchr(a, 'd', 16) - a to 3 (0 in LE)
89 ; Fold memchr(a, 'n', 16) - a to 13 (14 in LE)
97 ; Fold memchr(a, 'o', 16) - a to 14 (13 in LE)
105 ; Fold memchr(a, 'p', 16) - a to 15 (12 in LE)
159 ; Fold memchr(a + 1, 'e', 12) - a to 0 (3 in LE).
167 ; Fold memchr(a + 1, 'f', 12) - a to 1 (2 in LE).
175 ; Fold memchr(a + 1, 'g', 12) - a to 2 (1 in LE).
[all …]
H A Dsprintf-2.ll15 ; Fold snprintf(0, 0, "%s", a[I].M + C) for constant I in [0, 1],
40 ; Fold snprintf(0, 0, "%s", a[0].a) to 1.
46 ; Fold snprintf(0, 0, "%s", a[0].a) to 0.
52 ; Fold snprintf(0, 0, "%s", a[0].b) to 2.
58 ; Fold snprintf(0, 0, "%s", a[0].b + 1) to 1.
64 ; Fold snprintf(0, 0, "%s", a[0].b + 2) to 0.
70 ; Fold snprintf(0, 0, "%s", a[0].c) to 3.
76 ; Fold snprintf(0, 0, "%s", a[1].a) to 4.
82 ; Fold snprintf(0, 0, "%s", a[1].b) to 5.
88 ; Fold snprintf(0, 0, "%s", a[1].c) to 6.
H A Dstrnlen-1.ll55 ; Fold strnlen(ax, 0) to 0.
67 ; Fold strnlen(ax, 1) to *ax ? 1 : 0.
82 ; Fold strnlen(s5, 0) to 0.
94 ; Fold strnlen(s5, 4) to 4.
106 ; Fold strnlen(s5, 5) to 5.
118 ; Fold strnlen(s5, (size_t)-1) to 5.
130 ; Fold strnlen(s5_3 + 4, 5) to 1.
142 ; Fold strnlen(s5_3 + 5, 5) to 0.
154 ; Fold strnlen(s5_3 + 6, 3) to 3.
166 ; Fold even the invalid strnlen(s5_3 + 6, 4) call where the bound exceeds
H A Dstrncmp-5.ll56 ; Fold strncmp(a, b, n) to 0.
61 ; Fold strncmp(a, b + 1, n) to N != 0 ? -1 : 0.
76 ; Fold strncmp(a, b + 4, n) to 0.
156 ; Fold strncmp(a, c, n) to N > 7 ? -1 : 0.
241 ; Fold strncmp(a, d, n) to N != 0 ? -1 : 0.
277 ; Fold strncmp(a + 5, d + 5, n) to 0.
282 ; Fold strncmp(a + 6, d + 6, n) to 0.
336 ; Fold to 0.
341 ; Fold to N ? +1 : 0.
346 ; Fold to N ? -1 : 0.
[all …]
H A Dmemcmp-7.ll87 ; Fold memcmp(&a, &b, 1) to 0;
92 ; Fold memcmp(&a, &b, 2) to 0;
97 ; Fold memcmp(&a, &b, 3) to 0;
102 ; Fold memcmp(&a, &b, 4) to 0;
110 ; Fold memcmp(&a, (char*)&b + 1, 1) to -1;
115 ; Fold memcmp(&a, (char*)&b + 1, 2) to -1;
120 ; Fold memcmp(&a, (char*)&b + 1, 3) to -1;
128 ; Fold memcmp((char*)&a + 1, &b, 1) to +1;
133 ; Fold memcmp((char*)&a + 1, &b, 2) to +1;
138 ; Fold memcmp((char*)&a + 1, &b, 3) to +1;
H A Dmemchr-9.ll47 ; Fold memchr((char*)a + 0, '\0', 1) to a.
52 ; Fold memchr((char*)a + 0, '\01', 1) to null.
57 ; Fold memchr((char*)a + 0, '\04', 4) to null.
75 ; Fold memchr((char*)a + 1, '\01', 1) to null.
85 ; Fold memchr((char*)a + 1, '\03', 3) to null.
90 ; Fold memchr((char*)a + 1, '\03', 4) to null.
95 ; Fold memchr((char*)a + 1, '\03', 5) to null.
172 ; Fold memchr((char*)a + 0, '\04', N) to null.
180 ; Fold memchr((char*)a + 1, '\0', N) to null.
200 ; Fold memchr((char*)a + 1, '\04', N) to null.
[all …]
H A Dmemchr-2.ll14 ; Fold memchr(a12345, '\06', n) to null.
27 ; Fold memchr(a12345, '\04', 2) to null.
40 ; Fold memchr(a12345, '\04', 3) to null.
53 ; Fold memchr(a12345, '\03', 3) to a12345 + 2.
66 ; Fold memchr(a12345, '\03', 9) to a12345 + 2.
79 ; Fold memchr(a123f45, 500, 9) to a123f45 + 3 (verify that 500 is
93 ; Fold memchr(a12345, '\03', n) to n < 3 ? null : a12345 + 2.
108 ; Fold memchr(a12345, 259, n) to n < 3 ? null : a12345 + 2
H A Dmemcmp-5.ll51 ; Fold memcmp(a, b, n) to 0.
56 ; Fold memcmp(a, b + 1, n) to N != 0 ? -1 : 0.
61 ; Fold memcmp(a, b + 2, n) to N != 0 ? -1 : 0.
66 ; Fold memcmp(a, b + 3, n) to N != 0 ? -1 : 0.
71 ; Fold memcmp(a, b + 4, n) to 0.
76 ; Fold memcmp(a, b + 5, n) to N != 0 ? -1 : 0.
146 ; Fold memcmp(a, c, n) to N > 7 ? -1 : 0.
207 ; Fold memcmp(a, d, n) to N != 0 ? -1 : 0.
212 ; Fold memcmp(a, d + 1, n) to N != 0 -1 : 0.
217 ; Fold memcmp(a + 1, d + 1, n) to 0.
[all …]
H A Dstrnlen-3.ll17 ; Fold strnlen(sx + i, 0) to 0.
45 ; Fold strnlen(a3 + i, 2) to min(3 - i, 2).
60 ; Fold strnlen(a3 + i, 3) to min(3 - i, 3).
75 ; Fold strnlen(s3 + i, 0) to 0.
87 ; Fold strnlen(s5 + i, 0) to 0.
99 ; Fold strnlen(s5_3 + i, 0) to 0.
125 ; Fold strnlen(a3, n) to min(sizeof(a3), n)
139 ; Fold strnlen(s3, n) to min(strlen(s3), n)
153 ; Fold strnlen(a3 + i, 2) to min(sizeof(a3) - i, 2)
168 ; Fold strnlen(s3 + i, 2) to min(strlen(s3) - i, 2)
[all …]
H A Dmemcmp-6.ll33 ; Fold memcmp(a + 5, b + 5, 2) to -1.
38 ; Fold memcmp(b + 5, a + 5, 2) to +1.
43 ; Fold memcmp(a + 6, b + 6, 1) to -1.
48 ; Fold memcmp(b + 6, a + 6, 1) to +1.
85 ; Fold memcmp(a, b, n) to -1.
90 ; Fold memcmp(b, a, n) to +1.
95 ; Fold memcmp(a + 6, b + 6, n) to -1.
100 ; Fold memcmp(b + 6, a + 6, n) to +1.
H A Dstrncmp-6.ll33 ; Fold strncmp(a + 5, b + 5, 2) to -1.
38 ; Fold strncmp(b + 5, a + 5, 2) to +1.
43 ; Fold strncmp(a + 6, b + 6, 1) to -1.
48 ; Fold strncmp(b + 6, a + 6, 1) to +1.
85 ; Fold strncmp(a, b, n) to -1.
90 ; Fold strncmp(b, a, n) to +1.
95 ; Fold strncmp(a + 6, b + 6, n) to -1.
100 ; Fold strncmp(b + 6, a + 6, n) to +1.
H A Dstrchr-4.ll10 ; Fold strchr(s, c) == s to *s == c.
25 ; Fold strchr(s, c) != s to *s != c.
40 ; Fold strchr(s, '\0') == null to false. (A string must be nul-terminated,
53 ; Fold strchr(s, '\0') != null to true.
67 ; Fold strchr(a5, c) == a5 to *a5 == c.
H A Dstrlen-6.ll30 ; Fold strlen(a_s3.a) to 3.
42 ; Fold strlen(&a_s3.a[1]) to 2.
54 ; Fold strlen(&a_s3.a[2]) to 1.
66 ; Fold strlen(&a_s3.a[3]) to 0.
78 ; Fold strlen(a_s3_s4.a) to 3.
90 ; Fold strlen(&a_s3_s4.a[2]) to 1.
102 ; Fold strlen(a_s3_s4.b) to 4.
125 ; Fold strlen(&a_s3_s4.b[1]) to 3.
148 ; Fold strlen(a_s3_i32_s4.b) to 4.
171 ; Fold strlen(&a_s3_i32_s4.b[1]) to 3.
[all …]
H A Dstr-int-5.ll105 ; Fold INT32_MIN.
123 ; Fold INT32_MIN in hex.
129 ; Fold -INT32_MIN in hex.
135 ; Fold INT32_MAX.
141 ; Fold -0x01.
153 ; Fold UINT32_MAX.
268 ; Fold INT32_MIN.
280 ; Fold INT32_MIN in hex.
286 ; Fold INT64_MIN.
292 ; Fold INT64_MAX.
[all …]
/llvm-project-15.0.7/flang/lib/Evaluate/
H A Dfold.cpp16 characteristics::TypeAndShape Fold( in Fold() function
73 auto expr{Fold(context, std::move(value.value()))}; in FoldOperation()
119 return {Fold(context, std::move(lower)), Fold(context, std::move(upper)), in FoldOperation()
120 Fold(context, triplet.stride())}; in FoldOperation()
127 expr.value() = Fold(context, std::move(expr.value())); in FoldOperation()
152 cosubscript.emplace_back(Fold(context, std::move(x))); in FoldOperation()
157 folded.set_stat(Fold(context, std::move(*stat))); in FoldOperation()
161 Fold(context, std::move(*team)), coarrayRef.teamIsTeamNumber()); in FoldOperation()
178 auto lower{Fold(context, substring.lower())}; in FoldOperation()
179 auto upper{Fold(context, substring.upper())}; in FoldOperation()
[all …]
/llvm-project-15.0.7/llvm/lib/Target/AMDGPU/
H A DSIFoldOperands.cpp186 if (Fold.isImm()) { in updateOperand()
236 if ((Fold.isImm() || Fold.isFI() || Fold.isGlobal()) && Fold.needsShrink()) { in updateOperand()
273 if (Fold.isCommuted()) in updateOperand()
280 if (Fold.isImm()) { in updateOperand()
292 if (Fold.isGlobal()) { in updateOperand()
293 Old.ChangeToGA(Fold.OpToFold->getGlobal(), Fold.OpToFold->getOffset(), in updateOperand()
298 if (Fold.isFI()) { in updateOperand()
324 if (Fold.UseMI == MI && Fold.UseOpNo == OpNo) in appendFoldCandidate()
1264 assert(!Fold.isReg() || Fold.OpToFold); in foldInstOperand()
1265 if (Fold.isReg() && Fold.OpToFold->getReg().isVirtual()) { in foldInstOperand()
[all …]
/llvm-project-15.0.7/flang/include/flang/Evaluate/
H A Dfold.h35 template <typename T> Expr<T> Fold(FoldingContext &context, Expr<T> &&expr) { in Fold() function
39 characteristics::TypeAndShape Fold(
43 std::optional<A> Fold(FoldingContext &context, std::optional<A> &&x) { in Fold() function
45 return Fold(context, std::move(*x)); in Fold()
/llvm-project-15.0.7/llvm/test/CodeGen/AArch64/GlobalISel/
H A Dprelegalizercombiner-trivial-arith.mir9 ; Fold (x - 0) -> x
29 ; Fold (x + 0) -> x
50 ; Fold (x * 0) -> 0
73 ; Fold (x * 0) -> 0
97 ; Fold (0 / x) -> 0
118 ; Fold (0 / x) -> 0
139 ; Fold (0 % x) -> 0
160 ; Fold (0 % x) -> 0
182 ; Fold (x || 0) -> x
203 ; Fold (x | 0) -> x
[all …]

12345678