summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix an obvious omission in the SelectionDAGBuilder where we wereChandler Carruth2011-11-221-2/+2
| | | | | | | | | | | | | dropping weights on the floor for invokes. This was impeding my writing further test cases for invoke when interacting with probabilities and block placement. No test case as there doesn't appear to be a way to test this stuff. =/ Suggestions for a test case of course welcome. I hope to be able to add test cases that indirectly cover this eventually by adding probabilities to the exceptional edge and reordering blocks as a result. llvm-svn: 145060
* Remove some unnecessary includes of PseudoSourceValue.h.Jay Foad2011-11-151-1/+0
| | | | llvm-svn: 144634
* Added invariant field to the DAG.getLoad method and changed all calls.Pete Cooper2011-11-081-3/+5
| | | | | | When this field is true it means that the load is from constant (runt-time or compile-time) and so can be hoisted from loops or moved around other memory accesses llvm-svn: 144100
* Don't use floating point to do an integer's job.Jakob Stoklund Olesen2011-10-261-4/+7
| | | | | | | | | | | This code makes different decisions when compiled into x87 instructions because of different rounding behavior. That caused phase 2/3 miscompares on 32-bit Linux when the phase 1 compiler was built with gcc (using x87), and the phase 2 compiler was built with clang (using SSE). This fixes PR11200. llvm-svn: 143006
* Fix a bunch of unused variable warnings when doing a releaseDuncan Sands2011-10-181-1/+1
| | | | | | build with gcc-4.6. llvm-svn: 142350
* Fix comment to refer to correct instructionHal Finkel2011-10-181-1/+1
| | | | llvm-svn: 142334
* Clear out the landing pad to call site map for each function.Bill Wendling2011-10-151-0/+1
| | | | | | | This isn't put into the 'clear()' method because the information needs to stick around (at least for a little bit) after the selection DAG is built. llvm-svn: 142032
* Encode register class constreaints in inline asm instructions.Jakob Stoklund Olesen2011-10-121-0/+12
| | | | | | | | | | | | | The inline asm operand constraint is initially encoded in the virtual register for the operand, but that register class may change during coalescing, and the original constraint is lost. Encode the original register class as part of the flag word for each inline asm operand. This makes it possible to recover the actual constraint required by inline asm, just like we can for normal instructions. llvm-svn: 141833
* Use a utility from MathExtras to clarify a check and avoid undefined ↵Eli Friedman2011-10-121-1/+1
| | | | | | behavior. Based on patch by Ahmed Charles. llvm-svn: 141829
* Thread the chain through the eh.sjlj.setjmp intrinsic, like it's documented toBill Wendling2011-10-071-2/+8
| | | | | | do. This will be useful later on with the new SJLJ stuff. llvm-svn: 141416
* Remove the old atomic instrinsics. autoupgrade functionality is included ↵Eli Friedman2011-10-061-66/+0
| | | | | | with this patch. llvm-svn: 141333
* Modify the mapping from landing pad to call sites to accept more than one callBill Wendling2011-10-051-1/+1
| | | | | | site. llvm-svn: 141226
* Create a mapping between the landing pad basic block and the call site index ↵Bill Wendling2011-10-041-0/+2
| | | | | | for later use. llvm-svn: 141125
* Promote comment to doxycomment. Adjust whitespace. No functionality change.Nick Lewycky2011-09-301-4/+3
| | | | llvm-svn: 140899
* Clean up uses of switch instructions so they are not dependent on the ↵Eli Friedman2011-09-291-2/+2
| | | | | | operand ordering. Patch by Stepan Dyatkovskiy. llvm-svn: 140803
* Use the local we already set up.Eric Christopher2011-09-291-1/+1
| | | | llvm-svn: 140745
* Strip off pointer casts when looking at the eh.sjlj.functioncontext's argument.Bill Wendling2011-09-281-1/+2
| | | | llvm-svn: 140678
* Create and use an llvm.eh.sjlj.functioncontext intrinsic.Bill Wendling2011-09-281-0/+8
| | | | | | | | This intrinsic is used to pass the index of the function context to the back-end for further processing. The back-end is in charge of filling in the rest of the entries. llvm-svn: 140676
* Fix check for unaligned load/store so it doesn't catch over-aligned load/store.Eli Friedman2011-09-131-2/+2
| | | | llvm-svn: 139649
* Error out on CodeGen of unaligned load/store. Fix test so it isn't ↵Eli Friedman2011-09-131-2/+9
| | | | | | accidentally testing that case. llvm-svn: 139641
* tidy up a bitChris Lattner2011-09-091-7/+5
| | | | llvm-svn: 139419
* Directly point debug info to the stack slot of the arugment, instead of ↵Devang Patel2011-09-081-15/+17
| | | | | | trying to keep track of vreg in which it the arugment is copied. The LiveDebugVariable can keep track of variable's ranges. llvm-svn: 139330
* Add codegen support for vector select (in the IR this means a selectDuncan Sands2011-09-061-2/+4
| | | | | | | | | | | | with a vector condition); such selects become VSELECT codegen nodes. This patch also removes VSETCC codegen nodes, unifying them with SETCC nodes (codegen was actually often using SETCC for vector SETCC already). This ensures that various DAG combiner optimizations kick in for vector comparisons. Passes dragonegg bootstrap with no testsuite regressions (nightly testsuite as well as "make check-all"). Patch mostly by Nadav Rotem. llvm-svn: 139159
* Split the init.trampoline intrinsic, which currently combines GCC'sDuncan Sands2011-09-061-5/+8
| | | | | | | | | | | | | | | | | | | | init.trampoline and adjust.trampoline intrinsics, into two intrinsics like in GCC. While having one combined intrinsic is tempting, it is not natural because typically the trampoline initialization needs to be done in one function, and the result of adjust trampoline is needed in a different (nested) function. To get around this llvm-gcc hacks the nested function lowering code to insert an additional parent variable holding the adjust.trampoline result that can be accessed from the child function. Dragonegg doesn't have the luxury of tweaking GCC code, so it stored the result of adjust.trampoline in the memory GCC set aside for the trampoline itself (this is always available in the child function), and set up some new memory (using an alloca) to hold the trampoline. Unfortunately this breaks Go which allocates trampoline memory on the heap and wants to use it even after the parent has exited (!). Rather than doing even more hacks to get Go working, it seemed best to just use two intrinsics like in GCC. Patch mostly by Sanjoy Das. llvm-svn: 139140
* Atomic load/store on ARM/Thumb.Eli Friedman2011-08-261-5/+1
| | | | | | | | | | | | I don't really like the patterns, but I'm having trouble coming up with a better way to handle them. I plan on making other targets use the same legalization ARM-without-memory-barriers is using... it's not especially efficient, but if anyone cares, it's not that hard to fix for a given target if there's some better lowering. llvm-svn: 138621
* Basic x86 code generation for atomic load and store instructions.Eli Friedman2011-08-241-8/+81
| | | | llvm-svn: 138478
* Fix 80 col violations.Evan Cheng2011-08-231-2/+4
| | | | llvm-svn: 138356
* Add the support in code-gen for the landingpad instruction lowering.Bill Wendling2011-08-171-3/+39
| | | | | | | | | | The landingpad instruction is lowered into the EXCEPTIONADDR and EHSELECTION SDNodes. The information from the landingpad instruction is harvested by the 'AddLandingPadInfo' function. The new EH uses the current EH scheme in the back-end. This will change once we switch over to the new scheme. (Reviewed by Jakob!) llvm-svn: 137880
* Revert patch. Forgot a dependent commit.Bill Wendling2011-08-171-39/+3
| | | | llvm-svn: 137875
* Add the body of 'visitLandingPad'.Bill Wendling2011-08-171-3/+39
| | | | | | | | This generates the SDNodes for the new exception handling scheme. It takes the two values coming from the landingpad instruction and assigns them to the EXCEPTIONADDR and EHSELECTION nodes. llvm-svn: 137873
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-121-0/+3
| | | | | | | | | | | | 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
* 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-031-8/+59
| | | | | | | | 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
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-311-0/+4
| | | | | | | | | 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-301-44/+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-291-11/+32
| | | | 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-291-2/+41
| | | | | | | | | 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
* 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
* LangRef and basic memory-representation/reading/writing for 'cmpxchg' andEli Friedman2011-07-281-0/+6
| | | | | | | | | | | | | | | | | | | | | '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
* Code generation for 'fence' instruction.Eli Friedman2011-07-271-1/+6
| | | | llvm-svn: 136283
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-271-0/+8
| | | | | | 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
* Initial implementation of 'fence' instruction, the new C++0x-style ↵Eli Friedman2011-07-251-0/+4
| | | | | | | | replacement for llvm.memory.barrier. This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon. llvm-svn: 136009
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-34/+34
| | | | llvm-svn: 135375
* Check register class matching instead of width of type matchingEric Christopher2011-07-141-4/+6
| | | | | | | | | 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
OpenPOWER on IntegriCloud