aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2009-04-08Implement support for using modeling implicit-zero-extension on x86-64Dan Gohman
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG instructions), and teach the DAGCombiner to take advantage of this on targets which support it. This eliminates many redundant zero-extension operations on x86-64. This adds a new TargetLowering hook, isZExtFree. It's similar to isTruncateFree, except it only applies to actual definitions, and not no-op truncates which may not zero the high bits. Also, this adds a new optimization to SimplifyDemandedBits: transform operations like x+y into (zext (add (trunc x), (trunc y))) on targets where all the casts are no-ops. In contexts where the high part of the add is explicitly masked off, this allows the mask operation to be eliminated. Fix the DAGCombiner to avoid undoing these transformations to eliminate casts on targets where the casts are no-ops. Also, this adds a new two-address lowering heuristic. Since two-address lowering runs before coalescing, it helps to be able to look through copies when deciding whether commuting and/or three-address conversion are profitable. Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle the case that a clobber range extended both before and beyond an existing live range. In that case, multiple live ranges need to be added. This was exposed by the new subreg coalescing code. Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the spiller behavior it was looking for no longer occurrs with the new instruction selection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Revert prev. patch for now.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Temporarily revert r68552. This was causing a failure in the self-hosting LLVMBill Wendling
builds. --- Reverse-merging (from foreign repository) r68552 into '.': U test/CodeGen/X86/tls8.ll U test/CodeGen/X86/tls10.ll U test/CodeGen/X86/tls2.ll U test/CodeGen/X86/tls6.ll U lib/Target/X86/X86Instr64bit.td U lib/Target/X86/X86InstrSSE.td U lib/Target/X86/X86InstrInfo.td U lib/Target/X86/X86RegisterInfo.cpp U lib/Target/X86/X86ISelLowering.cpp U lib/Target/X86/X86CodeEmitter.cpp U lib/Target/X86/X86FastISel.cpp U lib/Target/X86/X86InstrInfo.h U lib/Target/X86/X86ISelDAGToDAG.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86ISelLowering.h U lib/Target/X86/X86InstrInfo.cpp U lib/Target/X86/X86InstrBuilder.h U lib/Target/X86/X86RegisterInfo.td git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Right now DBG_LABEL are required for llvm.dbg.region_start and ↵Devang Patel
llvm.dbg.region_end in non-fast mode also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Reduce code duplication on the TLS implementation.Rafael Espindola
This introduces a small regression on the generated code quality in the case we are just computing addresses, not loading values. Will work on it and on X86-64 support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Don't attempt to handle aggregate argument values in FastISel; letDan Gohman
SelectionDAG do those. This fixes PR3955. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07PR2985 / <rdar://problem/6584986>Jim Grosbach
When compiling in Thumb mode, only the low (R0-R7) registers are available for most instructions. Breaking the low registers into a new register class handles this. Uses of R12, SP, etc, are handled explicitly where needed with copies inserted to move results into low registers where the rest of the code generator can deal with them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68545 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07fix style.Torok Edwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07Another attempt at fixing PR2975.Torok Edwin
Types can have references to eachother, so we can't just call destroy on them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07fix rdar://6762290, a crash compiling cxx filt with clang.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-07remove empty sectionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06Handle 'a' modifier in ARM inline assembly.Bob Wilson
Patch by Richard Pennington. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06revert r68457, its crashing in make check.Torok Edwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06Teach llvm-bcanalyzer to skip over the header we use on LLVM IR files.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06fix (part of) memory leak on shutdown. See PR2975.Torok Edwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06Let the strcat optimizer return the pointer to the start of the buffer,Ed Schouten
instead of the place where it started to perform the string copy. - PR3661 - Patch by Benjamin Kramer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-06Map stack based frameindices for spills to zero based indices that can be ↵Sanjiv Gupta
accessed based on an external symbol defining the location of temporary data for a function. For example: we have spill slots addressed as foo.tmp + 0, foo.tmp + 1 etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-04Remove bogus include.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-04Add support for embedded metadata to LLVM. This introduces two new types ofNick Lewycky
Constant, MDString and MDNode which can only be used by globals with a name that starts with "llvm." or as arguments to a function with the same naming restriction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Wrap some lines to fix indentation problems.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Fix some comments.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Fix a TargetLowering optimization so that it doesn't duplicateDan Gohman
loads when an input node has multiple uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03CMake: removed IA64AsmPrinter.cpp from lib/Target/IA64/CMakeLists.txtOscar Fuentes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Separate MIPS asmprinterAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Fix target library nameAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Fix commentAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68381 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Move IA64 asmprinter to separate libraryAnton Korobeynikov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Added a x86 dag combine to increase the chances to use aMon P Wang
movq for v2i64 on x86-32. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.Dan Gohman
Note that these are distinct from TargetInstrInfo::INSERT_SUBREG and TargetInstrInfo::EXTRACT_SUBREG, which are used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-03use higher level APIs.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Fixed build warnings.Sanjiv Gupta
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68333 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02To convert the StopPoint insn into an assembler directive by ISel, we need ↵Sanjiv Gupta
to have access to the line number field. So we convert that info as an operand by custom handling DBG_STOPPOINT in legalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Params are not being generated as static globals now. The caller passes them ↵Sanjiv Gupta
onto the callee's stack directly and the callee loads the argvals from its own stack. Clang generated frameindexes validatd by recalculating the stack as if all frameindexes represent 1-byte slots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-02Fix build on Linux.Mikhail Glushenkov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68269 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Reapply r68211, with the miscompilations it caused fixed.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Clean up pass manager cache after each run.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01silence warning in release-asserts build.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Add llvm::Triple class for abstracting access to target triples.Daniel Dunbar
- The code is silly, I'm just amusing myself. Rewrite to be efficient if you like. :) Also, if you wish to debate the proper names of the triple components I'm all ears. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Use CHAR_BIT instead of hard-coding 8 in several places where itDan Gohman
is appropriate. This helps visually differentiate host-oriented calculations from target-oriented calculations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68227 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Use LLVM type names instead of C type names in comments, to beDan Gohman
less ambiguous and less C-specific. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Fix PR3862: Recognize some ARM-specific constraints for immediates in inlineBob Wilson
assembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Revert r68172. It caused regressions inDan Gohman
Applications/Burg/burg Applications/ClamAV/clamscan and many other tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01hopefully fix an apparent build error on windows.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01fix a serious regression I introduced in my previous patch.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01Enhance GVN to propagate simple conditionals. This fixes PR3921.Owen Anderson
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-01* Fixed spelling of `invertible'Misha Brukman
* Simplified if statement git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31reimplement BitcodeReaderValueList in terms of WeakVH instead of makingChris Lattner
it be an LLVM IR User object. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31Make the key of ValueRankMap an AssertingVH, so that we die violentlyChris Lattner
if it dangles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles", Chris Lattner
which are effectively smart pointers to Value*'s. They are both very light weight and simple, and react to values being destroyed or being RAUW'd. WeakVN does a best effort to follow a value around, including through RAUW operations and will get nulled out of the value is destroyed. This is useful for the eventual "metadata that references a value" work, because it is a reference to a value that does not show up on its use_* list. AssertingVH is a pointer that compiles down to a dumb raw pointer when assertions are disabled. When enabled, it emits an assertion if the pointed-to value is destroyed while it is still being referenced. This is very useful for Maps and other things, and should have caught the recent bugs in CallGraph and Reassociate, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31Throttle back "fold select into operand" transformation. InstCombine should ↵Evan Cheng
not generate selects of two constants unless they are selects of 0 and 1. e.g. define i32 @t1(i32 %c, i32 %x) nounwind { %t1 = icmp eq i32 %c, 0 %t2 = lshr i32 %x, 18 %t3 = select i1 %t1, i32 %t2, i32 %x ret i32 %t3 } was turned into define i32 @t2(i32 %c, i32 %x) nounwind { %t1 = icmp eq i32 %c, 0 %t2 = select i1 %t1, i32 18, i32 0 %t3 = lshr i32 %x, %t2 ret i32 %t3 } For most targets, that means materializing two constants and then a select. e.g. On x86-64 movl %esi, %eax shrl $18, %eax testl %edi, %edi cmovne %esi, %eax ret => xorl %eax, %eax testl %edi, %edi movl $18, %ecx cmovne %eax, %ecx movl %esi, %eax shrl %cl, %eax ret Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68142 91177308-0d34-0410-b5e6-96231b3b80d8