Commit b995300
authored
Fuzzing: add "callsite-ish constraints". (#216)
This is a followup from #214. We have use-cases in Cranelift now where
we generate constraints on call instructions that have:
- A number of fixed-reg uses at "early";
- A number of fixed-reg defs at "late";
- A number of register clobbers, potentially overlapping with uses;
- A number of "any"-constrained defs at "late", to add register
pressure.
The existing fuzzing function generator would create at most 3 operands,
and would add *either* fixed-reg constraints *or* clobbers, not both.
This PR adds a "callsite-ish constraints" branch as a subcase of the
fixed-reg choice that also adds the "any" defs to add register pressure,
and adds new clobbers that don't interfere with existing constraints. It
also loosens the logic around constructing fixed-reg constraints: if a
conflict is found with some arbitrarily-chosen constraint, it keeps
going to the next operand and tries to make it fixed, rather than giving
up on further operands.1 parent eba60dc commit b995300
File tree
4 files changed
+56
-8
lines changed- fuzz/fuzz_targets
- src/fuzzing
4 files changed
+56
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| 267 | + | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
| |||
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
292 | | - | |
| 294 | + | |
293 | 295 | | |
294 | 296 | | |
295 | 297 | | |
| |||
344 | 346 | | |
345 | 347 | | |
346 | 348 | | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
347 | 355 | | |
348 | 356 | | |
349 | 357 | | |
350 | 358 | | |
351 | 359 | | |
352 | 360 | | |
353 | | - | |
354 | | - | |
| 361 | + | |
355 | 362 | | |
356 | 363 | | |
357 | 364 | | |
| |||
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
411 | | - | |
| 418 | + | |
412 | 419 | | |
413 | 420 | | |
414 | 421 | | |
| |||
471 | 478 | | |
472 | 479 | | |
473 | 480 | | |
474 | | - | |
| 481 | + | |
475 | 482 | | |
476 | 483 | | |
477 | 484 | | |
478 | 485 | | |
479 | 486 | | |
480 | 487 | | |
481 | | - | |
| 488 | + | |
482 | 489 | | |
483 | 490 | | |
484 | 491 | | |
485 | 492 | | |
486 | 493 | | |
487 | 494 | | |
488 | 495 | | |
489 | | - | |
| 496 | + | |
490 | 497 | | |
491 | 498 | | |
492 | 499 | | |
| |||
496 | 503 | | |
497 | 504 | | |
498 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
499 | 544 | | |
500 | 545 | | |
501 | 546 | | |
502 | 547 | | |
503 | | - | |
| 548 | + | |
504 | 549 | | |
505 | 550 | | |
506 | 551 | | |
| |||
0 commit comments