dxil: forward every value stored to a local to loads in its block
Values stored to locals were forwarded to later loads in the same block only when constants (or status values); every value now is. Such loads need no getelementptr, load or conversion back from i32 storage. - The hill-climbing set: -2.4% (A/B). - Output: 1,349 of 19,624 verify compiles change (loads from locals that stay in memory, such as arrays also indexed at run time, read the stored value directly). - Validator 1.8: 11,488 Unreal compiles, 0 invalid; Glide's the same 12 invalid as before.
This commit is contained in:
parent
531b5c6227
commit
9bb4feb32b
|
|
@ -3109,9 +3109,11 @@ const Emitter = struct {
|
|||
for (vals, 0..) |v, c| {
|
||||
if (ptr.offset_dyn == null) {
|
||||
const key = .{ ptr.base, ptr.offset_const + @as(u32, @intCast(c)) };
|
||||
// (Constants too, in locals: ops such as linear algebra
|
||||
// layouts need immediates passed through parameters.)
|
||||
const forward = (v == .constant and ptr.addr_space == 0) or (e.status_vals.count() > 0 and e.status_vals.contains(v));
|
||||
// (Every value stored to a local: later loads of it in the
|
||||
// block need no instructions, and constants stay constants,
|
||||
// as ops such as linear algebra layouts need immediates
|
||||
// passed through parameters.)
|
||||
const forward = ptr.addr_space == 0 or (e.status_vals.count() > 0 and e.status_vals.contains(v));
|
||||
if (forward) {
|
||||
try e.forwarded.put(e.arena, key, .{ .v = v, .block = e.cur });
|
||||
} else if (e.forwarded.count() > 0) _ = e.forwarded.remove(key);
|
||||
|
|
|
|||
Loading…
Reference in New Issue