summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make sure sin, cos, sqrt calls are marked readonlyDale Johannesen2009-09-251-3/+6
| | | | | | | before producing FSIN, FCOS, FSQRT. If they aren't so marked we have to assume they might set errno. llvm-svn: 82781
* Generate FSQRT from calls to the sqrt function, whichDale Johannesen2009-09-251-0/+9
| | | | | | | | | | | | allows appropriate backends to generate a sqrt instruction. On x86, this isn't done at -O0 because we go through FastISel instead. This is a behavior change from before this series of sqrt patches started. I think this is OK considering that compile speed is most important at -O0, but could be convinced otherwise. llvm-svn: 82778
* Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that ↵Evan Cheng2009-09-181-0/+1
| | | | | | | | sdisel will use to properly complete phi nodes. Not functionality change yet. llvm-svn: 82273
* duncan points out the EH selector values are signed.Chris Lattner2009-09-181-1/+1
| | | | llvm-svn: 82245
* tolerate llvm.eh.selector.i64 on 32-bit systems and llvm.eh.selector.i32 onChris Lattner2009-09-171-21/+24
| | | | | | 64-bit systems. llvm-svn: 82180
* Better solution for tracking both the original alignment of the access, and ↵Nate Begeman2009-09-151-3/+2
| | | | | | | | the current alignment based on the source value offset. This avoids increasing the size of mem nodes. llvm-svn: 81897
* Add an "original alignment" field to load and store nodes. This enables theNate Begeman2009-09-151-6/+5
| | | | | | | DAG Combiner to disambiguate chains for loads and stores of types which are broken up by the Legalizer into smaller pieces. llvm-svn: 81813
* Fix an abort on a store of an empty struct member. getValue returnsDan Gohman2009-09-081-0/+4
| | | | | | | null in the case of an empty struct, so don't try to call getNumValues on it. llvm-svn: 81180
* Simplify. Testing shows that this is not equivalent to BBI = CR.CaseBB + 1.Duncan Sands2009-09-061-4/+2
| | | | llvm-svn: 81124
* Remove some not-really-used variables, as warnedDuncan Sands2009-09-061-6/+2
| | | | | | about by icc (#593, partial). Patch by Erick Tryzelaar. llvm-svn: 81115
* Detect VLAs.Devang Patel2009-09-051-1/+5
| | | | | | Do not use DenseMap operator[] because it inserts new entry if lookup fails. Use find() to check an entry in a DenseMap first. llvm-svn: 81058
* Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.Sandeep Patel2009-09-021-2/+3
| | | | llvm-svn: 80773
* Reapply 79977.Devang Patel2009-08-281-6/+6
| | | | | | Use MDNodes to encode debug info in llvm IR. llvm-svn: 80406
* Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.Devang Patel2009-08-261-6/+6
| | | | llvm-svn: 80073
* Update DebugInfo interface to use metadata, instead of special named ↵Devang Patel2009-08-251-6/+6
| | | | | | | | llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well. This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!) llvm-svn: 79977
* Record variable debug info at ISel time directly.Devang Patel2009-08-221-3/+12
| | | | llvm-svn: 79742
* Fix typo. Should check both values of RangeUse for 0. Patch by Marius Wachtler.Bill Wendling2009-08-211-1/+1
| | | | llvm-svn: 79649
* Remove a bit more cruft from the sjlj moving to a backend pass.Jim Grosbach2009-08-171-9/+0
| | | | llvm-svn: 79272
* Simplify this code to not depend as much on CurMBB.Dan Gohman2009-08-151-16/+15
| | | | llvm-svn: 79068
* Indentation change.Evan Cheng2009-08-141-2/+1
| | | | llvm-svn: 78978
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-12/+16
| | | | llvm-svn: 78948
* Add contexts to some of the MVT APIs. No functionality change yet, just the ↵Owen Anderson2009-08-121-45/+47
| | | | | | infrastructure work needed to get the contexts to where they need to be first. llvm-svn: 78759
* Split EVT into MVT and EVT, the former representing _just_ a primitive type, ↵Owen Anderson2009-08-111-286/+286
| | | | | | | | while the latter is capable of representing either a primitive or an extended type. llvm-svn: 78713
* SjLj based exception handling unwinding support. This patch is nasty, brutishJim Grosbach2009-08-111-1/+10
| | | | | | | | | | | | | and short. Well, it's kinda short. Definitely nasty and brutish. The front-end generates the register/unregister calls into the SjLj runtime, call-site indices and landing pad dispatch. The back end fills in the LSDA with the call-site information provided by the front end. Catch blocks are not yet implemented. Built on Darwin and verified no llvm-core "make check" regressions. llvm-svn: 78625
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-101-410/+410
| | | | | | own struct type. llvm-svn: 78610
* Start moving TargetLowering away from using full MVTs and towards ↵Owen Anderson2009-08-101-6/+10
| | | | | | SimpleValueType, which will simplify the privatization of IntegerType in the future. llvm-svn: 78584
* Use stripPointerCasts instead of partially rewriting it.Dale Johannesen2009-08-061-4/+2
| | | | llvm-svn: 78350
* Add assertion checks after the calls to LowerFormalArguments, LowerCall,Dan Gohman2009-08-061-1/+34
| | | | | | | and LowerReturn, to verify that the targets' hooks have respected some of their postconditions. llvm-svn: 78312
* Remove an over-aggressive assert. Functions with empty struct returnDan Gohman2009-08-061-3/+0
| | | | | | | types don't have any return values, from CodeGen's perspective. This fixes PR4688. llvm-svn: 78311
* Major calling convention code refactoring.Dan Gohman2009-08-051-229/+300
| | | | | | | | | | | | | | | | | | | Instead of awkwardly encoding calling-convention information with ISD::CALL, ISD::FORMAL_ARGUMENTS, ISD::RET, and ISD::ARG_FLAGS nodes, TargetLowering provides three virtual functions for targets to override: LowerFormalArguments, LowerCall, and LowerRet, which replace the custom lowering done on the special nodes. They provide the same information, but in a more immediately usable format. This also reworks much of the target-independent tail call logic. The decision of whether or not to perform a tail call is now cleanly split between target-independent portions, and the target dependent portion in IsEligibleForTailCallOptimization. This also synchronizes all in-tree targets, to help enable future refactoring and feature work. llvm-svn: 78142
* llvm_report_error already prints "LLVM ERROR:". So stop reporting errors ↵Benjamin Kramer2009-08-031-6/+5
| | | | | | like "LLVM ERROR: llvm: error:" or "LLVM ERROR: ERROR:". llvm-svn: 77971
* Allow target intrinsics that return multiple values, i.e., struct types,Bob Wilson2009-07-311-15/+9
| | | | | | | | | | | | | | | | | | | | | | | | in SelectionDAGLowering::visitTargetIntrinsic. This removes a bit of special-case code for vector types. After staring at it for a while, I managed to convince myself that it is not necessary. The only case where TLI.getValueType() differs from MVT::getMVT is for iPTR, so this code could potentially make a difference for a vector of pointers. But, it looks like that is not supported. Calling TLI.getValueType() on a vector of pointers leads to the following sequence of calls: TargetLowering::getValueType MVT::getMVT MVT::getVectorVT(iPTR, num elements) MVT::getExtendedVectorVT MVT::getTypeForMVT for iPTR assertion fails "Type is not extended!" So, unless I'm really missing something, this bit of code is irrelevant to the current version of LLVM, which is consistent with the fact that I don't see this code in other similar places. llvm-svn: 77747
* Move getTrue() and getFalse() to 2.5-like APIs.Owen Anderson2009-07-311-4/+4
| | | | llvm-svn: 77685
* Move types back to the 2.5 API.Owen Anderson2009-07-291-2/+2
| | | | llvm-svn: 77516
* Return ConstantVector to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77366
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-271-4/+2
| | | | llvm-svn: 77247
* Remove Value::getNameLenDaniel Dunbar2009-07-261-18/+6
| | | | llvm-svn: 77148
* "fix" PR4612, which is a crash on:Chris Lattner2009-07-231-1/+5
| | | | | | | | | | %0 = malloc [3758096384 x i32] The "malloc" instruction doesn't support 64-bits correctly (see PR715), and should be removed. Victor is actively working on fixing this, in the meantime just don't crash. llvm-svn: 76899
* Rename getConstantInt{True|False} to get{True|False} at Chris' behest.Owen Anderson2009-07-211-4/+4
| | | | llvm-svn: 76598
* Move a bit more state over to the LLVMContext.Owen Anderson2009-07-211-4/+6
| | | | llvm-svn: 76533
* Move stripping of bitcasts in inline asm argumentsDale Johannesen2009-07-201-0/+5
| | | | | | | to a place where it affects everything. Occurs only on calls AFAIK. llvm-svn: 76502
* Add line numbers to OProfile. To do this, I added a processDebugLoc()Jeffrey Yasskin2009-07-161-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | call to the MachineCodeEmitter interface and made copying the start line of a function not conditional on whether we're emitting Dwarf debug information. I'll propagate the processDebugLoc() calls to the non-X86 targets in a followup patch. In the long run, it'll probably be better to gather this information through the DwarfWriter, but the DwarfWriter currently depends on the AsmPrinter and TargetAsmInfo, and fixing that would be out of the way for this patch. There's a bug in OProfile 0.9.4 that makes it ignore line numbers for addresses above 4G, and a patch fixing it at http://thread.gmane.org/gmane.linux.oprofile/7634 Sample output: $ sudo opcontrol --reset; sudo opcontrol --start-daemon; sudo opcontrol --start; `pwd`/Debug/bin/lli fib.bc; sudo opcontrol --stop Signalling daemon... done Profiler running. fib(40) == 165580141 Stopping profiling. $ opreport -g -d -l `pwd`/Debug/bin/lli|head -60 Overflow stats not available CPU: Core 2, speed 1998 MHz (estimated) Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000 vma samples % linenr info image name symbol name 00007f67a30370b0 25489 61.2554 fib.c:24 10946.jo fib_left 00007f67a30370b0 1634 6.4106 fib.c:24 00007f67a30370b1 83 0.3256 fib.c:24 00007f67a30370b9 1997 7.8348 fib.c:24 00007f67a30370c6 2080 8.1604 fib.c:27 00007f67a30370c8 988 3.8762 fib.c:27 00007f67a30370cd 1315 5.1591 fib.c:27 00007f67a30370cf 251 0.9847 fib.c:27 00007f67a30370d3 1191 4.6726 fib.c:27 00007f67a30370d6 975 3.8252 fib.c:27 00007f67a30370db 1010 3.9625 fib.c:27 00007f67a30370dd 242 0.9494 fib.c:27 00007f67a30370e1 2782 10.9145 fib.c:28 00007f67a30370e5 3768 14.7828 fib.c:28 00007f67a30370eb 615 2.4128 (no location information) 00007f67a30370f3 6558 25.7287 (no location information) 00007f67a3037100 15603 37.4973 fib.c:29 10946.jo fib_right 00007f67a3037100 1646 10.5493 fib.c:29 00007f67a3037101 45 0.2884 fib.c:29 00007f67a3037109 2372 15.2022 fib.c:29 00007f67a3037116 2234 14.3178 fib.c:32 00007f67a3037118 612 3.9223 fib.c:32 00007f67a303711d 622 3.9864 fib.c:32 00007f67a303711f 385 2.4675 fib.c:32 00007f67a3037123 404 2.5892 fib.c:32 00007f67a3037126 634 4.0633 fib.c:32 00007f67a303712b 870 5.5759 fib.c:32 00007f67a303712d 62 0.3974 fib.c:32 00007f67a3037131 1848 11.8439 fib.c:33 00007f67a3037135 2840 18.2016 fib.c:33 00007f67a303713a 1 0.0064 fib.c:33 00007f67a303713b 1023 6.5564 (no location information) 00007f67a3037143 5 0.0320 (no location information) 000000000080c1e4 15 0.0360 MachineOperand.h:150 lli llvm::MachineOperand::isReg() const 000000000080c1e4 6 40.0000 MachineOperand.h:150 000000000080c1ec 2 13.3333 MachineOperand.h:150 ... llvm-svn: 76102
* Privatize the ConstantFP table. I'm on a roll!Owen Anderson2009-07-161-2/+3
| | | | llvm-svn: 76097
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-161-1/+2
| | | | | | | | number of issues in our current context-passing stuff, which is also fixed here llvm-svn: 76089
* Propagate return result extension typeAnton Korobeynikov2009-07-161-0/+7
| | | | llvm-svn: 75925
* Move a few more convenience factory functions from Constant to LLVMContext.Owen Anderson2009-07-151-1/+1
| | | | llvm-svn: 75840
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-9/+9
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-131-3/+4
| | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. llvm-svn: 75445
* remove llvm.part.set.* and llvm.part.select.*. They have never been Chris Lattner2009-07-121-8/+0
| | | | | | | | | | implemented in codegen, have no frontend to generate them, and are better implemented with pattern matching (like the ppc backend does to generate rlwimi/rlwinm etc). PR4543 llvm-svn: 75430
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-7/+7
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
OpenPOWER on IntegriCloud