mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
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:
@@ -34,17 +34,16 @@ 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:i31:unit = store 0:i32 %l3:i32*
|
||||
%b0:i32:unit = store 0:i32 %l4: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*
|
||||
%b0:i30:unit = store 0:i32 %l3:i32*
|
||||
%b0:i31:unit = store 0:i32 %l4:i32*
|
||||
j b2()
|
||||
|
||||
block b2:
|
||||
|
||||
Reference in New Issue
Block a user