mirror of
https://github.com/ziglang/zig.git
synced 2025-12-17 11:43:16 +00:00
make it more clear we should do UB wrapping optimizations for ptr arithmetic
This commit is contained in:
parent
ad4627ea3b
commit
dffa6dcaf9
@ -1123,15 +1123,14 @@ fn genBody(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail, OutO
|
|||||||
.unreach => try airUnreach(f),
|
.unreach => try airUnreach(f),
|
||||||
.fence => try airFence(f, inst),
|
.fence => try airFence(f, inst),
|
||||||
|
|
||||||
.ptr_add => try airPtrAddSub (f, inst, " + "),
|
|
||||||
.ptr_sub => try airPtrAddSub (f, inst, " - "),
|
|
||||||
|
|
||||||
// TODO use a different strategy for add that communicates to the optimizer
|
// TODO use a different strategy for add that communicates to the optimizer
|
||||||
// that wrapping is UB.
|
// that wrapping is UB.
|
||||||
.add => try airBinOp (f, inst, " + "),
|
.add => try airBinOp (f, inst, " + "),
|
||||||
|
.ptr_add => try airPtrAddSub (f, inst, " + "),
|
||||||
// TODO use a different strategy for sub that communicates to the optimizer
|
// TODO use a different strategy for sub that communicates to the optimizer
|
||||||
// that wrapping is UB.
|
// that wrapping is UB.
|
||||||
.sub => try airBinOp (f, inst, " - "),
|
.sub => try airBinOp (f, inst, " - "),
|
||||||
|
.ptr_sub => try airPtrAddSub (f, inst, " - "),
|
||||||
// TODO use a different strategy for mul that communicates to the optimizer
|
// TODO use a different strategy for mul that communicates to the optimizer
|
||||||
// that wrapping is UB.
|
// that wrapping is UB.
|
||||||
.mul => try airBinOp (f, inst, " * "),
|
.mul => try airBinOp (f, inst, " * "),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user