mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
cfc303a827
Using `clr reg`/`mov %g0, reg`/`or %g0, %g0, reg` to zero a register looks much better than `sethi 0, reg`. Reviewers: jyknight, venkatra Reviewed By: jyknight Subscribers: eraman, fedor.sergeev, jrtc27, llvm-commits Differential Revision: https://reviews.llvm.org/D45810 llvm-svn: 330396
20 lines
647 B
LLVM
20 lines
647 B
LLVM
; RUN: llc -march=sparc < %s | FileCheck %s
|
|
|
|
|
|
; If computeKnownSignBits (in SelectionDAG) can do a simple
|
|
; look-thru for extractelement then we know that the add will yield a
|
|
; non-negative result.
|
|
define i1 @test1(<4 x i16>* %in) {
|
|
; CHECK-LABEL: ! %bb.0:
|
|
; CHECK-NEXT: retl
|
|
; CHECK-NEXT: mov %g0, %o0
|
|
%vec2 = load <4 x i16>, <4 x i16>* %in, align 1
|
|
%vec3 = lshr <4 x i16> %vec2, <i16 2, i16 2, i16 2, i16 2>
|
|
%vec4 = sext <4 x i16> %vec3 to <4 x i32>
|
|
%elt0 = extractelement <4 x i32> %vec4, i32 0
|
|
%elt1 = extractelement <4 x i32> %vec4, i32 1
|
|
%sum = add i32 %elt0, %elt1
|
|
%bool = icmp slt i32 %sum, 0
|
|
ret i1 %bool
|
|
}
|