forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARC] Fix BooleanContents, so that select of a trunc doesn't
eliminate the trunc. Differential Revision: http://reviews.llvm.org/D10442 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245444 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
; RUN: llc -march=sparc < %s | ||
|
||
;; getBooleanContents on Sparc used to claim that no bits mattered | ||
;; other than the first for SELECT. Thus, the 'trunc' got eliminated | ||
;; as redundant. But, cmp does NOT ignore the other bits! | ||
|
||
; CHECK-LABEL select_mask: | ||
; CHECK: ldub [%o0], [[R:%[goli][0-7]]] | ||
; CHECK: and [[R]], 1, [[V:%[goli][0-7]]] | ||
; CHECK: cmp [[V]], 0 | ||
define i32 @select_mask(i8* %this) { | ||
entry: | ||
%bf.load2 = load i8, i8* %this, align 4 | ||
%bf.cast5 = trunc i8 %bf.load2 to i1 | ||
%cond = select i1 %bf.cast5, i32 2, i32 0 | ||
ret i32 %cond | ||
} |