aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add functions for determining if the stdin/out/err is connected to aReid Spencer2005-01-012-0/+48
| | | | | | | console or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19233 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a bulk commit that implements the following primary improvements:Chris Lattner2005-01-011-78/+268
| | | | | | | | | | | | | | | | | | | | | | | * We can now fold cast instructions into select instructions that have at least one constant operand. * We now optimize expressions more aggressively based on bits that are known to be zero. These optimizations occur a lot in code that uses bitfields even in simple ways. * We now turn more cast-cast sequences into AND instructions. Before we would only do this if it if all types were unsigned. Now only the middle type needs to be unsigned (guaranteeing a zero extend). * We transform sign extensions into zero extensions in several cases. This corresponds to these test/Regression/Transforms/InstCombine testcases: 2004-11-22-Missed-and-fold.ll and.ll: test28-29 cast.ll: test21-24 and-or-and.ll cast-cast-to-and.ll zeroext-and-reduce.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19220 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME: Select instructions on longs were miscompiled.Chris Lattner2005-01-011-19/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we're at it, improve codegen of select instructions. For this testcase: int %test(bool %C, int %A, int %B) { %D = select bool %C, int %A, int %B ret int %D } We used to generate this code: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; b .LBB_test_3 ; .LBB_test_2: ; or r5, r4, r4 .LBB_test_3: ; or r3, r5, r5 blr Now we emit: _test: cmpwi cr0, r3, 0 bne .LBB_test_2 ; .LBB_test_1: ; or r4, r5, r5 .LBB_test_2: ; or r3, r4, r4 blr -Chris git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19214 91177308-0d34-0410-b5e6-96231b3b80d8
* Substantially improve the code generated by non-folded setcc instructions.Chris Lattner2005-01-012-66/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, instead of compiling this: bool %test(int %A, int %B) { %C = setlt int %A, %B ret bool %C } to this: test: save %sp, -96, %sp subcc %i0, %i1, %g0 bl .LBBtest_1 ! nop ba .LBBtest_2 ! nop .LBBtest_1: ! or %g0, 1, %i0 ba .LBBtest_3 ! nop .LBBtest_2: ! or %g0, 0, %i0 ba .LBBtest_3 ! nop .LBBtest_3: ! restore %g0, %g0, %g0 retl nop We now compile it to this: test: save %sp, -96, %sp subcc %i0, %i1, %g0 or %g0, 1, %i0 bl .LBBtest_2 ! nop .LBBtest_1: ! or %g0, %g0, %i0 .LBBtest_2: ! restore %g0, %g0, %g0 retl nop git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19213 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement SimplifyCFG/DeadSetCC.llChris Lattner2005-01-011-0/+8
| | | | | | | | | SimplifyCFG is one of those passes that we use for final cleanup: it should not rely on other passes to clean up its garbage. This fixes the "why are trivially dead setcc's in the output of gccas" problem. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19212 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow getZeroExtend and getSignExtend to work with boolean inputs.Chris Lattner2005-01-011-5/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19210 91177308-0d34-0410-b5e6-96231b3b80d8
* Where do these tabs keep coming from???Jeff Cohen2004-12-312-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19203 91177308-0d34-0410-b5e6-96231b3b80d8
* Mostly cleanup, but also some bug fixes, for win32/Path.cppJeff Cohen2004-12-312-76/+162
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19202 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a compilation error for the case where mallinfo() is not available.Reid Spencer2004-12-312-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19201 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of those nasty tabs...Jeff Cohen2004-12-312-36/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19199 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring win32/Path.cpp up to date with respect to Unix/Path.cppJeff Cohen2004-12-312-18/+208
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19198 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MINGW compilation errorsJeff Cohen2004-12-302-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19190 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR491 and testcase ↵Chris Lattner2004-12-291-1/+2
| | | | | | Transforms/DeadStoreElimination/2004-12-28-PartialStore.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19180 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR490Chris Lattner2004-12-292-0/+12
| | | | | | | Fix testcase CodeGen/CBackend/2004-12-28-LogicalConstantExprs.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19176 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove potential platform portability issue with size of "int".Reid Spencer2004-12-292-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19172 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that made the nightly tester *really* slow. During changes forReid Spencer2004-12-271-3/+9
| | | | | | | | | | | portability, the --track-space option was inadvertently ignored. This patch fixes that so that sys::Process::GetMallocUsage() is only invoked if the --track-spaces option is given. Apparently the mallinfo() call that GetMallocUsage() uses is *very* slow, especially when processing very large modules like projects/llvm-test/MultiSource/Applications/kimwitu++. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19163 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-271-4/+58
| | | | | | | | | | | * Ensure #includes are wrapped with appropriate HAVE_ guards * Account for variations in time.h and sys/time.h inclusion. * Add macros for getting wait(2) exit status correctly (per autoconf sugg.) * Implement ThrowErrno in terms of strerror_r, strerror or none based on what is available on the platform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19161 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-272-8/+0
| | | | | | | * Remove redundant #includes that are now in Unix.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19160 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-274-0/+42
| | | | | | | | * Move implementation of sys::PreventCoreFiles function to this file from the now defunct SysConfig abstraction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19159 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-272-2/+50
| | | | | | | | * Ensure #includes are wrapped with appropriate HAVE_ guards * Ensure variations in "dirent" structure are accounted for. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19158 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-272-0/+100
| | | | | | | | * Ensure #includes are wrapped with appropriate HAVE_ guards * Consolidate implementation from operating system specific directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19157 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-276-12/+40
| | | | | | | * Ensure #includes are wrapped with appropriate HAVE_ guards git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19156 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-192/+8
| | | | | | | | * Consolidate implementation for Unix systems into Unix/TimeValue.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19155 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-155/+7
| | | | | | | | * Consolidate implementation for Unix systems into Unix/Program.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19154 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-190/+7
| | | | | | | | * Consolidate implementation for Unix systems into Unix/Signals.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19153 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-407/+7
| | | | | | | | * Consolidate implementation for Unix systems into Unix/Memory.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19152 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-130/+7
| | | | | | | | * Consolidate implementation for Unix systems into Unix/MappedFile.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19151 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-278-155/+7
| | | | | | | | * Consolidate implementation for Unix systems into Unix/Process.cpp * Avoid use of symbolic link to #include platform-specific implementation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19150 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-2710-278/+0
| | | | | | | | | SysConf abstraction was pointless because it had a single function in it that pertained only to the current process. So merge it into the Process abstraction and remove the files completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19149 91177308-0d34-0410-b5e6-96231b3b80d8
* mingw doesn't support the official debug API.Jeff Cohen2004-12-252-18/+56
| | | | | | | | Old versions of the C runtime somehow get loaded into the process. Make sure they aren't searched for symbols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19141 91177308-0d34-0410-b5e6-96231b3b80d8
* Get VC++ building againJeff Cohen2004-12-241-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19140 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate use of ltdl.c when doing a VC++ build. Because libtool isn't used,Jeff Cohen2004-12-243-34/+158
| | | | | | | ltdl's LGPL license would infect all of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19137 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-242-0/+178
| | | | | | | | | Merge implementations of isValid and GetTemporaryDirectory into this file. There is not any point having the operating system specific files for such little variation between the Unix family of systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19134 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-247-355/+0
| | | | | | | | This implementation is no longer needed, its been merged to Unix/Path.cpp since there is such little variation between the platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19133 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-241-1/+7
| | | | | | | | Use the LLVM_ON_UNIX and LLVM_ON_WIN32 #defines to include the implementation instead of relying upon the "platform" link git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19132 91177308-0d34-0410-b5e6-96231b3b80d8
* Resurrect this file.Reid Spencer2004-12-242-0/+106
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19130 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove these files as they are not being included any more. DynamicLibraryReid Spencer2004-12-2410-351/+0
| | | | | | | | is now implemented via ltdl.cpp which has its own way of dealing with the different platforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19129 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix VC++ compilation errorJeff Cohen2004-12-242-4/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19124 91177308-0d34-0410-b5e6-96231b3b80d8
* Put CopyFile in the sys namespace.Reid Spencer2004-12-232-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19122 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap at 80 colsMisha Brukman2004-12-231-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19121 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the comments and file header.Reid Spencer2004-12-231-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19120 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to speed up gccld hot spot in BasicVN::getEqualNumberNodes by makingReid Spencer2004-12-231-3/+2
| | | | | | | | | | a function call at the core of the loop inline and removing unused stack variables from an often called function. This doesn't improve things much, the real saving will be by reducing the number of calls to this function (100K+ when linking kimwitu++). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19119 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch to fix mingw compilation problem contributed by Henrik.Jeff Cohen2004-12-232-0/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19112 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-221-0/+1
| | | | | | | | Include local FDHandle.h file now that FDHandle is local to this library and not in lib/System/FileUtilities. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19108 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-222-0/+96
| | | | | | | FDHandle class (non-portable) moved here from lib/Support/FileUtilities git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19107 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-221-14/+0
| | | | | | | Move non-portable FDHandle class to its only user: lib/Debugger git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19106 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR351:Reid Spencer2004-12-211-10/+7
| | | | | | | | Remove unix specific code (use of errno and read) from the reader. Thanks to Jeff Cohen for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19081 91177308-0d34-0410-b5e6-96231b3b80d8
* Put the CopyFile function explicitly in the sys namespace.Reid Spencer2004-12-212-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19079 91177308-0d34-0410-b5e6-96231b3b80d8
* Include <cassert> for Cygwin.Reid Spencer2004-12-211-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19077 91177308-0d34-0410-b5e6-96231b3b80d8
* Cygwin doesn't like .. through a link, so drop the ..Reid Spencer2004-12-209-9/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19076 91177308-0d34-0410-b5e6-96231b3b80d8