1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Go to file
Chris Lattner 578b634f56 implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
For 2009-03-07-FPConstSelect.ll we now produce:

_f:
	xorl	%eax, %eax
	testl	%edi, %edi
	movl	$4, %ecx
	cmovne	%rax, %rcx
	leaq	LCPI1_0(%rip), %rax
	movss	(%rcx,%rax), %xmm0
	ret

previously we produced:

_f:
	subl	$4, %esp
	cmpl	$0, 8(%esp)
	movss	LCPI1_0, %xmm0
	je	LBB1_2	## entry
LBB1_1:	## entry
	movss	LCPI1_1, %xmm0
LBB1_2:	## entry
	movss	%xmm0, (%esp)
	flds	(%esp)
	addl	$4, %esp
	ret

on PPC the code also improves to:

_f:
	cntlzw r2, r3
	srwi r2, r2, 5
	li r3, lo16(LCPI1_0)
	slwi r2, r2, 2
	addis r3, r3, ha16(LCPI1_0)
	lfsx f1, r3, r2
	blr 

from:

_f:
	li r2, lo16(LCPI1_1)
	cmplwi cr0, r3, 0
	addis r2, r2, ha16(LCPI1_1)
	beq cr0, LBB1_2	; entry
LBB1_1:	; entry
	li r2, lo16(LCPI1_0)
	addis r2, r2, ha16(LCPI1_0)
LBB1_2:	; entry
	lfs f1, 0(r2)
	blr 

This also improves the existing pic-cpool case from:

foo:
	subl	$12, %esp
	call	.Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
	cmpl	$0, 16(%esp)
	movsd	.LCPI1_0@GOTOFF(%eax), %xmm0
	je	.LBB1_2	# entry
.LBB1_1:	# entry
	movsd	.LCPI1_1@GOTOFF(%eax), %xmm0
.LBB1_2:	# entry
	movsd	%xmm0, (%esp)
	fldl	(%esp)
	addl	$12, %esp
	ret

to:

foo:
	call	.Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
	popl	%eax
	addl	$_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
	xorl	%ecx, %ecx
	cmpl	$0, 4(%esp)
	movl	$8, %edx
	cmovne	%ecx, %edx
	fldl	.LCPI1_0@GOTOFF(%eax,%edx)
	ret

This triggers a few dozen times in spec FP 2000.

llvm-svn: 66358
2009-03-08 01:51:30 +00:00
autoconf Autodetect the availability of -export-dynamic in the linker. 2009-03-05 08:20:21 +00:00
bindings Fix a parallel make race condition by swapping the order of -I directories. 2009-03-06 00:00:58 +00:00
cmake Add mode_t to the config.h generated by cmake on win32. Used by clang. 2009-02-14 16:13:26 +00:00
docs Introduce new linkage types linkonce_odr, weak_odr, common_odr 2009-03-07 15:45:40 +00:00
examples reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an 2008-11-21 16:42:48 +00:00
include Fix misaligned whitespace. No functionality change. 2009-03-08 00:57:09 +00:00
lib implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4. 2009-03-08 01:51:30 +00:00
projects CMake: auto-discover project files under the projects/ subdirectory. 2009-03-06 01:16:52 +00:00
runtime Drop toy GC runtime. 2009-03-02 03:46:48 +00:00
test implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4. 2009-03-08 01:51:30 +00:00
tools Change various llvm utilities to use PrettyStackTraceProgram in 2009-03-06 05:34:10 +00:00
unittests Remove libtool. 2009-02-26 07:44:16 +00:00
utils Introduce new linkage types linkonce_odr, weak_odr, common_odr 2009-03-07 15:45:40 +00:00
website Prepare for "core" website. 2007-08-03 05:43:35 +00:00
win32 Update hand-crafted VC++ build. 2009-02-02 19:22:02 +00:00
Xcode Remove Stacker.html from Xcode project. 2008-10-14 23:23:59 +00:00
build-for-llvm-top.sh Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
CMakeLists.txt CMake: auto-discover project files under the projects/ subdirectory. 2009-03-06 01:16:52 +00:00
configure Regenerate. 2009-03-05 08:20:44 +00:00
CREDITS.TXT Adding your's truly to CREDITS.TXT 2009-01-19 15:04:29 +00:00
LICENSE.TXT Another great year for LLVM! 2009-02-26 15:17:13 +00:00
llvm.spec.in * llvm.spec.in: update blurb 2007-07-13 09:48:29 +00:00
Makefile Add targets to support the installation of clang in isolation. 2009-01-19 19:48:23 +00:00
Makefile.common Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
Makefile.config.in Autodetect the availability of -export-dynamic in the linker. 2009-03-05 08:20:21 +00:00
Makefile.rules Revert r66315. Fix the build on mixed 64/32 Linux systems. 2009-03-07 22:17:05 +00:00
ModuleInfo.txt Patch to build llvm with srcdir != objdir from 2009-01-23 08:42:38 +00:00
README.txt Remove extra lines 2008-07-28 20:50:25 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.