←back to thread

Why SSA Compilers?

(mcyoung.xyz)
158 points transpute | 2 comments | | HN request time: 0.471s | source
1. mbauman ◴[] No.45675610[source]
Forget compilers, SSA is an immensely valuable readability improvement for humans, too.
replies(1): >>45678241 #
2. MeetingsBrowser ◴[] No.45678241[source]
Why have

    while (c < 10) { c *= 3; }
when you could have

  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  store i32 %0, ptr %3, align 4
  br label %4, !dbg !18

  4:
  %5 = load i32, ptr %3, align 4, !dbg !19
  %6 = icmp slt i32 %5, 10, !dbg !20
  br i1 %6, label %7, label %10, !dbg !18

  7:
  %8 = load i32, ptr %3, align 4, !dbg !21
  %9 = mul nsw i32 %8, 3, !dbg !21
  store i32 %9, ptr %3, align 4, !dbg !21
  br label %4, !dbg !18