Commit be00637
[mlir][OpPrintingFlags] Allow to disable ElementsAttr hex printing (#85766)
At present, large ElementsAttr is unconditionally printed with a hex
string. This means that in IR large constant values often look like:
dense<"0x000000000004000000080000000004000000080000000..."> :
tensor<10x10xi32>
Hoisting hex printing control to the user level for tooling means that
one can disable the feature and get human-readable values when
necessary:
dense<[16, 32, 48, 500...]> : tensor<10x10xi32>
Note: AsmPrinterOptions::printElementsAttrWithHexIfLarger is not always
possible to be used as it requires that one exposes MLIR's command-line
options in user tooling (including an actual compiler).
Co-authored-by: Harald Rotuna <[email protected]>1 parent 3b74f8c commit be00637
File tree
2 files changed
+40
-20
lines changed- mlir
- include/mlir/IR
- lib/IR
2 files changed
+40
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
1139 | 1146 | | |
1140 | 1147 | | |
1141 | 1148 | | |
| |||
1169 | 1176 | | |
1170 | 1177 | | |
1171 | 1178 | | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1172 | 1182 | | |
1173 | 1183 | | |
1174 | 1184 | | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1175 | 1188 | | |
1176 | 1189 | | |
1177 | 1190 | | |
| |||
1204 | 1217 | | |
1205 | 1218 | | |
1206 | 1219 | | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1207 | 1224 | | |
1208 | 1225 | | |
1209 | 1226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
236 | 245 | | |
237 | 246 | | |
238 | 247 | | |
| |||
287 | 296 | | |
288 | 297 | | |
289 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
290 | 307 | | |
291 | 308 | | |
292 | 309 | | |
293 | 310 | | |
294 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
295 | 317 | | |
296 | 318 | | |
297 | 319 | | |
| |||
328 | 350 | | |
329 | 351 | | |
330 | 352 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | 353 | | |
349 | 354 | | |
350 | 355 | | |
| |||
2435 | 2440 | | |
2436 | 2441 | | |
2437 | 2442 | | |
2438 | | - | |
2439 | | - | |
2440 | | - | |
| 2443 | + | |
2441 | 2444 | | |
2442 | 2445 | | |
2443 | 2446 | | |
| |||
0 commit comments