summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
Commit message (Collapse)AuthorAgeFilesLines
* Revert r137562 because it caused PR10674Nadav Rotem2011-08-161-7/+0
| | | | llvm-svn: 137719
* Fix PR 10635. When generating integer constants, the constant element type mayNadav Rotem2011-08-131-0/+7
| | | | | | | be illegal, even if the requested vector type is legal. Testcase is one of the disabled ARM tests in the vector-select patch. llvm-svn: 137562
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-122-0/+4
| | | | | | | | | | | | This implements the 'landingpad' instruction. It's used to indicate that a basic block is a landing pad. There are several restrictions on its use (see LangRef.html for more detail). These restrictions allow the exception handling code to gather the information it needs in a much more sane way. This patch has the definition, implementation, C interface, parsing, and bitcode support in it. llvm-svn: 137501
* Revert r137310 because it does not optimize any code on ToTNadav Rotem2011-08-121-32/+0
| | | | llvm-svn: 137466
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-123-2/+4
| | | | | | when building with assertions disabled. llvm-svn: 137460
* [AVX] When joining two XMM registers into a YMM register, make sure that theNadav Rotem2011-08-111-0/+32
| | | | | | | lower XMM register gets in first. This will allow the SUBREG pattern to elliminate the first vector insertion. llvm-svn: 137310
* fix PR10605 / rdar://9930964 by adding a pretty scary missed check.Chris Lattner2011-08-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | It's somewhat surprising anything works without this. Before we would compile the testcase into: test: # @test movl $4, 8(%rdi) movl 8(%rdi), %eax orl %esi, %eax cmpl $32, %edx movl %eax, -4(%rsp) # 4-byte Spill je .LBB0_2 now we produce: test: # @test movl 8(%rdi), %eax movl $4, 8(%rdi) orl %esi, %eax cmpl $32, %edx movl %eax, -4(%rsp) # 4-byte Spill je .LBB0_2 llvm-svn: 137303
* Do not drop undef debug values. These are used as range termination marker ↵Devang Patel2011-08-031-1/+1
| | | | | | by live debug variable pass. llvm-svn: 136834
* New approach to r136737: insert the necessary fences for atomic ops in ↵Eli Friedman2011-08-032-8/+60
| | | | | | | | platform-independent code, since a bunch of platforms (ARM, Mips, PPC, Alpha are the relevant targets here) need to do essentially the same thing. I think this completes the basic CodeGen for atomicrmw and cmpxchg. llvm-svn: 136813
* Don't create a ridiculous EXTRACT_ELEMENT. PR10563.Eli Friedman2011-08-021-0/+1
| | | | | | The testcase looks extremely fragile, so I'm adding an assertion which should catch any cases like this. llvm-svn: 136711
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-312-0/+5
| | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). llvm-svn: 136589
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-303-80/+0
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Do not lose branch weights when lowering SwitchInst.Jakub Staszak2011-07-292-17/+52
| | | | llvm-svn: 136529
* Remove unneeded const_cast.Jakub Staszak2011-07-291-2/+2
| | | | llvm-svn: 136506
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-293-12/+65
| | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) llvm-svn: 136457
* Use the pointer type size.Bill Wendling2011-07-291-1/+1
| | | | | | With this, we can now compile a simple EH program. llvm-svn: 136446
* And now something that compiles...Bill Wendling2011-07-291-1/+1
| | | | llvm-svn: 136445
* Make sure to sext or trunc the result from the register.Bill Wendling2011-07-291-2/+2
| | | | llvm-svn: 136444
* Rewrite the CMake build to use explicit dependencies between libraries,Chandler Carruth2011-07-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified in the same file that the library itself is created. This is more idiomatic for CMake builds, and also allows us to correctly specify dependencies that are missed due to bugs in the GenLibDeps perl script, or change from compiler to compiler. On Linux, this returns CMake to a place where it can relably rebuild several targets of LLVM. I have tried not to change the dependencies from the ones in the current auto-generated file. The only places I've really diverged are in places where I was seeing link failures, and added a dependency. The goal of this patch is not to start changing the dependencies, merely to move them into the correct location, and an explicit form that we can control and change when necessary. This also removes a serialization point in the build because we don't have to scan all the libraries before we begin building various tools. We no longer have a step of the build that regenerates a file inside the source tree. A few other associated cleanups fall out of this. This isn't really finished yet though. After talking to dgregor he urged switching to a single CMake macro to construct libraries with both sources and dependencies in the arguments. Migrating from the two macros to that style will be a follow-up patch. Also, llvm-config is still generated with GenLibDeps.pl, which means it still has slightly buggy dependencies. The internal CMake 'llvm-config-like' macro uses the correct explicitly specified dependencies however. A future patch will switch llvm-config generation (when using CMake) to be based on these deps as well. This may well break Windows. I'm getting a machine set up now to dig into any failures there. If anyone can chime in with problems they see or ideas of how to solve them for Windows, much appreciated. llvm-svn: 136433
* Visit the landingpad instruction.Bill Wendling2011-07-281-1/+35
| | | | | | | | | This generates the correct SDNodes for the landingpad instruction. It makes an assumption that the result of the landingpad instruction has at least two values. And that the first value is a pointer to the exception object and the second value is the "selector." llvm-svn: 136430
* Add the AddLandingPadInfo function.Bill Wendling2011-07-281-0/+34
| | | | | | | AddLandingPadInfo takes a landingpad instruction and grabs all of the information from it that it needs for EH table generation. llvm-svn: 136429
* LangRef and basic memory-representation/reading/writing for 'cmpxchg' andEli Friedman2011-07-282-0/+8
| | | | | | | | | | | | | | | | | | | | | 'atomicrmw' instructions, which allow representing all the current atomic rmw intrinsics. The allowed operands for these instructions are heavily restricted at the moment; we can probably loosen it a bit, but supporting general first-class types (where it makes sense) might get a bit complicated, given how SelectionDAG works. As an initial cut, these operations do not support specifying an alignment, but it would be possible to add if we think it's useful. Specifying an alignment lower than the natural alignment would be essentially impossible to support on anything other than x86, but specifying a greater alignment would be possible. I can't think of any useful optimizations which would use that information, but maybe someone else has ideas. Optimizer/codegen support coming soon. llvm-svn: 136404
* The personality function should be a Function* and not just a Value*.Bill Wendling2011-07-281-4/+6
| | | | llvm-svn: 136392
* CR fix: The ANY_EXTEND can be removed because the input and putput type must beNadav Rotem2011-07-281-2/+1
| | | | | | identical. llvm-svn: 136355
* Code generation for 'fence' instruction.Eli Friedman2011-07-273-1/+9
| | | | llvm-svn: 136283
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-272-0/+10
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Explicitly cast narrowing conversions inside {}s that will become errors inJeffrey Yasskin2011-07-271-1/+2
| | | | | | C++0x. llvm-svn: 136211
* Revert r136156, which broke several buildbots.Dan Gohman2011-07-271-1/+14
| | | | llvm-svn: 136206
* Delete unnecessarily cautious LastCALLSEQ code.Dan Gohman2011-07-261-14/+1
| | | | llvm-svn: 136156
* Add obvious missing case to switch. PR10497.Eli Friedman2011-07-261-2/+1
| | | | llvm-svn: 136130
* Initial implementation of 'fence' instruction, the new C++0x-style ↵Eli Friedman2011-07-252-0/+5
| | | | | | | | replacement for llvm.memory.barrier. This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon. llvm-svn: 136009
* Make sure this DAGCombine actually returns an UNDEF of the correct type; ↵Eli Friedman2011-07-251-1/+1
| | | | | | PR10476. llvm-svn: 135993
* PR10421: Fix a straightforward bug in the widening logic for CONCAT_VECTORS.Eli Friedman2011-07-201-5/+5
| | | | llvm-svn: 135595
* Revert r135423.Devang Patel2011-07-192-24/+0
| | | | llvm-svn: 135454
* Add APInt(numBits, ArrayRef<uint64_t> bigVal) constructor to prevent future ↵Jeffrey Yasskin2011-07-183-9/+9
| | | | | | | | | ambiguity errors like the one corrected by r135261. Migrate all LLVM callers of the old constructor to the new one. llvm-svn: 135431
* During bottom up fast-isel, instructions emitted to materalize registers are ↵Devang Patel2011-07-182-0/+24
| | | | | | | | at top of basic block and do not have debug location. This may misguide debugger while entering the basic block and sometimes debugger provides semi useful view of current location to developer by picking up previous known location as current location. Assign a sensible location to the first instruction in a basic block, if it does not have one location derived from source file, so that debugger can provide meaningful user experience to developers in edge cases. [take 2] llvm-svn: 135423
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-1811-82/+82
| | | | llvm-svn: 135375
* Minor code cleanupsNadav Rotem2011-07-171-7/+6
| | | | llvm-svn: 135362
* LegalizeDAG doesn't need its own copy of this enum.Dan Gohman2011-07-151-7/+1
| | | | llvm-svn: 135320
* Delete LegalizeDAG's own version of isTypeLegal and getTypeActionDan Gohman2011-07-151-26/+16
| | | | | | and just use the ones from TargetLowering directly. llvm-svn: 135318
* Delete an unused variable and a redundant assert.Dan Gohman2011-07-151-9/+1
| | | | llvm-svn: 135311
* Modernize comments.Dan Gohman2011-07-151-7/+4
| | | | llvm-svn: 135305
* Check register class matching instead of width of type matchingEric Christopher2011-07-142-6/+11
| | | | | | | | | when determining validity of matching constraint. Allow i1 types access to the GR8 reg class for x86. Fixes PR10352 and rdar://9777108 llvm-svn: 135180
* [VECTOR-SELECT]Nadav Rotem2011-07-141-1/+1
| | | | | | | | | | | During type legalization we often use the SIGN_EXTEND_INREG SDNode. When this SDNode is legalized during the LegalizeVector phase, it is scalarized because non-simple types are automatically marked to be expanded. In this patch we add support for lowering SIGN_EXTEND_INREG manually. This fixes CodeGen/X86/vec_sext.ll when running with the '-promote-elements' flag. llvm-svn: 135144
* Add assertion for the chain value typeNadav Rotem2011-07-141-0/+10
| | | | llvm-svn: 135143
* Don't emit a bit test if there is only one case the test can yield false. A ↵Benjamin Kramer2011-07-141-1/+9
| | | | | | simple SETNE is sufficient. llvm-svn: 135126
* Add a dag combine pattern for folding C2-(A+C1) -> (C2-C1)-AEric Christopher2011-07-141-2/+10
| | | | | | Fixes rdar://9761830 llvm-svn: 135123
* Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.Jay Foad2011-07-132-3/+3
| | | | llvm-svn: 135040
* Add an intrinsic and codegen support for fused multiply-accumulate. The intentCameron Zwarich2011-07-086-0/+46
| | | | | | is to use this for architectures that have a native FMA instruction. llvm-svn: 134742
* Apparently we can't expect a BinaryOperator here.Benjamin Kramer2011-07-081-2/+2
| | | | | | Should fix llvm-gcc selfhost. llvm-svn: 134699
OpenPOWER on IntegriCloud