-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARC] Cleanup handling of the Y/ASR registers.
- Implement copying ASR to/from GPR regs. - Mark ASRs as non-allocatable, so it won't try to arbitrarily use them inappropriately. - Instead of inserting explicit WRASR/RDASR nodes in the MUL/DIV routines, just do normal register copies. - Also...mark div as using Y, not just writing it. Added a test case with some code which previously died with an assertion failure (with -O0), or produced wrong code (otherwise). (Third time's the charm?) Differential Revision: http://reviews.llvm.org/D10401 llvm-svn: 241686
- Loading branch information
Showing
6 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
; RUN: llc < %s -march=sparc | FileCheck %s | ||
; RUN: llc -O0 < %s -march=sparc | FileCheck %s | ||
|
||
;; llc -O0 used to try to spill Y to the stack, which isn't possible, | ||
;; and then crashed. Additionally, in -O1, it would omit the second | ||
;; apparently-redundant wr to %y, which is not actually redundant | ||
;; because the spec says to treat %y as potentially-written by udiv. | ||
|
||
; CHECK-LABEL: two_divides: | ||
; CHECK: wr %g0, %g0, %y | ||
; CHECK: udiv | ||
; CHECK: wr %g0, %g0, %y | ||
; CHECK: udiv | ||
; CHECK: add | ||
|
||
define i32 @two_divides(i32 %a, i32 %b) { | ||
%r = udiv i32 %a, %b | ||
%r2 = udiv i32 %b, %a | ||
%r3 = add i32 %r, %r2 | ||
ret i32 %r3 | ||
} |