Commit b1bcca1
authored
The idea is that if `alpha` is known to be non-zero and a `Bool`, it
must be `true`. We may therefore hardcode the value to reduce the
branches in `@stable_muladdmul`.
TTFX:
```julia
julia> using LinearAlgebra
julia> D = Diagonal(1:4); A = zeros(4,4);
julia> @time A * D;
0.079938 seconds (139.62 k allocations: 6.952 MiB, 99.92% compilation time) # master
0.058087 seconds (126.77 k allocations: 6.290 MiB, 99.88% compilation time) # this PR
```
The TTFX in `D * A` does not change by much, but the allocations go
down.
```julia
julia> @time D * A;
0.062484 seconds (176.66 k allocations: 8.696 MiB, 99.91% compilation time) # master
0.059009 seconds (133.34 k allocations: 6.572 MiB, 99.91% compilation time) # this PR
```
1 parent e3e9987 commit b1bcca1
1 file changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
441 | 444 | | |
442 | 445 | | |
443 | 446 | | |
444 | | - | |
| 447 | + | |
445 | 448 | | |
446 | 449 | | |
447 | 450 | | |
| |||
484 | 487 | | |
485 | 488 | | |
486 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
487 | 493 | | |
488 | 494 | | |
489 | | - | |
| 495 | + | |
490 | 496 | | |
491 | 497 | | |
492 | 498 | | |
| |||
0 commit comments