llvm-project
36d8e46d - [mlir][affine][NFC] Count stores as int64_t in getFusionComputeCost (#243288)

Commit
5 hours ago
[mlir][affine][NFC] Count stores as int64_t in getFusionComputeCost (#243288) When the fused slice runs a single iteration, getFusionComputeCost records -storeCount as the cost of the insertion point's parent loop, to subtract the stores that store-to-load forwarding is expected to remove. storeCount was unsigned, so the negation wrapped around to nearly 2^32. The wrapped value never reaches the result: the entry is overwritten with the cost of the slice before the cost of the destination nest is computed, so the stores are not subtracted either way. Count the stores in int64_t, the type of the cost map, so that the recorded value is the intended one. Making the subtraction take effect would change fusion decisions and is left alone here. Fixes static analyzer complaints about an integer overflow. Assisted-by: Cursor
Author
Parents
Loading