22 lines · plain
1; RUN: llc < %s -mtriple=sparc | FileCheck %s2; RUN: llc -O0 < %s -mtriple=sparc | FileCheck %s3 4;; llc -O0 used to try to spill Y to the stack, which isn't possible,5;; and then crashed. Additionally, in -O1, it would omit the second6;; apparently-redundant wr to %y, which is not actually redundant7;; because the spec says to treat %y as potentially-written by udiv.8 9; CHECK-LABEL: two_divides:10; CHECK: wr %g0, %g0, %y11; CHECK: udiv12; CHECK: wr %g0, %g0, %y13; CHECK: udiv14; CHECK: add15 16define i32 @two_divides(i32 %a, i32 %b) {17 %r = udiv i32 %a, %b18 %r2 = udiv i32 %b, %a19 %r3 = add i32 %r, %r220 ret i32 %r321}22