Update model solution.

- Stop calculating operands for & operators.
- Evaluate the lhs of compound operators only once.
- Add `side-effect.c` example.
This commit is contained in:
Jaewoo Kim
2025-04-07 11:03:18 +00:00
parent 7a95032d43
commit 32283f2ed1
26 changed files with 331 additions and 210 deletions

View File

@@ -34,15 +34,14 @@ block b0:
%b0:i19:i32 = typecast %b0:i18:i8 to i32
%b0:i20:i32 = add %b0:i16:i32 %b0:i19:i32
%b0:i21:unit = store %b0:i20:i32 %l0:i32*
%b0:i22:struct color = load %l1:struct color*
%b0:i23:unit = store %l1:struct color* %l2:struct color**
%b0:i24:i32 = load %l0:i32*
%b0:i25:struct color* = load %l2:struct color**
%b0:i26:i8* = getelementptr %b0:i25:struct color* offset 4:i64
%b0:i27:i8 = load %b0:i26:i8*
%b0:i28:i32 = typecast %b0:i27:i8 to i32
%b0:i29:i32 = add %b0:i24:i32 %b0:i28:i32
%b0:i30:unit = store %b0:i29:i32 %l0:i32*
%b0:i22:unit = store %l1:struct color* %l2:struct color**
%b0:i23:i32 = load %l0:i32*
%b0:i24:struct color* = load %l2:struct color**
%b0:i25:i8* = getelementptr %b0:i24:struct color* offset 4:i64
%b0:i26:i8 = load %b0:i25:i8*
%b0:i27:i32 = typecast %b0:i26:i8 to i32
%b0:i28:i32 = add %b0:i23:i32 %b0:i27:i32
%b0:i29:unit = store %b0:i28:i32 %l0:i32*
j b1()
block b1: