summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* another xform that is target-independent (should be done in instcombine).Chris Lattner2009-06-161-3/+23
| | | | llvm-svn: 73472
* I think instcombine should unconditionally do this xform.Chris Lattner2009-06-161-2/+17
| | | | llvm-svn: 73471
* Fix PR4336: Iterating over use-def chains doesn't seem to be deterministic.Chris Lattner2009-06-161-6/+5
| | | | | | | | | | | | | The problem was that BitcodeReader::materializeModule would read functions from the bc file in densemap pointer key order (doubly non-deterministic!), which would cause the use-def chains to be set up for globals in non-determinstic order. Non-determinstic use/def chains can cause nondeterminism in many places down-stream. Many thanks to Julien Lerouge for putting together the pass in the PR that shows the issue! llvm-svn: 73470
* There doesn't seem to be a reason to move the save FP stuff.Bill Wendling2009-06-161-7/+7
| | | | llvm-svn: 73468
* The DWARF to compact encoding converter assumes that the DW_CFA_def_cfa_offsetBill Wendling2009-06-161-20/+18
| | | | | | | | | | | | | | | | | | | | | | | comes after the DW_CFA_def_cfa_register, because the CFA is really ESP from the start of the function and only gets an offset when the "subl $xxx,%esp" instruction happens, not the other way around. And reapply r72898: The DWARF unwind info was incorrect. While compiling with `-fomit-frame-pointer', we would lack the DW_CFA_advance_loc information for a lot of function, and then they would be `0'. The linker (at least on Darwin) needs to encode the stack size. In some cases, the stack size is too large to directly encode. So the linker checks to see if there is a "subl $xxx,%esp" instruction at the point where the `DW_CFA_def_cfa_offset' says the pc was. If so, the compact encoding records the offset in the function to where the stack size is embedded. But because the `DW_CFA_advance_loc' instructions are missing, it looks before the function and dies. So, instead of emitting the EH debug label before the stack adjustment operations, emit it afterwards, right before the frame move stuff. llvm-svn: 73465
* Fix typos.Bill Wendling2009-06-161-2/+2
| | | | llvm-svn: 73464
* Use MainCU if it is available.Devang Patel2009-06-161-2/+3
| | | | llvm-svn: 73457
* Use Type::getScalarType.Dan Gohman2009-06-161-4/+2
| | | | llvm-svn: 73451
* Owen Anderson 2009-06-15: Use a SmallPtrSet here, for speed and to match ↵Owen Anderson2009-06-151-5/+14
| | | | | | | | df_iterator. Owen Anderson 2009-06-15: Remember to clear out our maps to prevent crashing. llvm-svn: 73438
* Change this from an assert to a cerr+exit, since it's diagnosing anDan Gohman2009-06-151-2/+6
| | | | | | unsupported inline asm construct, rather than verifying a code invariant. llvm-svn: 73435
* On Darwin, frame pointer r7 is never available.Evan Cheng2009-06-151-2/+2
| | | | llvm-svn: 73434
* Use Type::isIntOrIntVector and Type::isFPOrFPVector.Dan Gohman2009-06-152-20/+15
| | | | llvm-svn: 73433
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-1513-245/+380
| | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. llvm-svn: 73431
* Fix a typo in a diagnostic.Dan Gohman2009-06-151-1/+1
| | | | llvm-svn: 73429
* Rename methods for the sake of consistency.Anton Korobeynikov2009-06-152-8/+8
| | | | llvm-svn: 73428
* Gracefully handle imbalanced inline function begin and end markers.Devang Patel2009-06-152-2/+9
| | | | llvm-svn: 73426
* ifcvt should ignore cfg where true and false successors are the same.Evan Cheng2009-06-151-1/+12
| | | | llvm-svn: 73423
* Typo.Evan Cheng2009-06-151-1/+1
| | | | llvm-svn: 73422
* The Ls and Qs were mixed up. Patch by Sean.Bill Wendling2009-06-152-6/+6
| | | | llvm-svn: 73417
* Fix the crash in this test. This is basically the sameDale Johannesen2009-06-151-2/+27
| | | | | | | | problem addressed in 31284, but the patch there only addressed the case where an invoke is the first thing in a block. llvm-svn: 73416
* Do not form ldrd / strd if the two dests / srcs are the same. Code clean up.Evan Cheng2009-06-151-59/+73
| | | | llvm-svn: 73413
* Merge PartialInliner changes.Owen Anderson2009-06-151-0/+5
| | | | llvm-svn: 73412
* "The Intel instruction tables should include the 64-bit and 32-bit instructionsBill Wendling2009-06-152-0/+18
| | | | | | | | | | | that push immediate operands of 1, 2, and 4 bytes (extended to the native register size in each case). The assembly mnemonics are "pushl" and "pushq." One such instruction appears at the beginning of the "start" function , so this is essential for accurate disassembly when unwinding." Patch by Sean Callanan! llvm-svn: 73407
* Silence a warning.Evan Cheng2009-06-151-1/+1
| | | | llvm-svn: 73406
* Code cleanups. getSCEVAtScope no longer uses SCEVCouldNotCompute.Dan Gohman2009-06-151-9/+9
| | | | llvm-svn: 73401
* Make the EnableLoadPRE variable static.Dan Gohman2009-06-151-1/+1
| | | | llvm-svn: 73398
* glibc has two versions of strerror_r, a standards compliant one and a GNUDan Gohman2009-06-151-1/+8
| | | | | | | | | | | | | | specific one. The GNU one is chosen when _GNU_SOURCE is defined. g++ always defines _GNU_SOURCE on linux platforms because glibc's headers won't compile in C++ mode without it. The GNU strerror_r doesn't always modify the buffer which causes empty error messages on linux. This patch changes MakeErrMsg to use the return value of strerror_r to get the string instead of assuming the buffer will be modified, on GLIBC. Patch by Benjamin Kramer! llvm-svn: 73396
* CheckTailCallReturnConstraints is missing a check on theArnold Schwaighofer2009-06-151-1/+5
| | | | | | | | | incomming chain of the RETURN node. The incomming chain must be the outgoing chain of the CALL node. This causes the backend to identify tail calls that are not tail calls. This patch fixes this. llvm-svn: 73387
* Part 1.Evan Cheng2009-06-1510-109/+572
| | | | | | | | | | | | | | | | | | | | | - Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent. - Allow targets to specify alternative register allocation orders based on allocation hint. Part 2. - Use the register allocation hint system to implement more aggressive load / store multiple formation. - Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g. v1025 = LDR v1024, 0 v1026 = LDR v1024, 0 => v1025,v1026 = LDRD v1024, 0 If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair. - Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions. This is work in progress, not yet enabled. llvm-svn: 73381
* "This patch implements the method with the GetModuleFileName function for ↵Chris Lattner2009-06-151-1/+3
| | | | | | | | windows." Patch by Benjamin Kramer! llvm-svn: 73379
* remove extraneous const qualifierChris Lattner2009-06-152-3/+2
| | | | llvm-svn: 73373
* I got J and K backward, many thanks to Eli for spotting this!Chris Lattner2009-06-151-2/+2
| | | | llvm-svn: 73372
* add a new static method to portably determine whether a patch isChris Lattner2009-06-152-0/+22
| | | | | | absolute or not, based on a patch by Gregory Curfman! llvm-svn: 73368
* implement support for the 'K' asm constraint, PR4347Chris Lattner2009-06-151-0/+8
| | | | llvm-svn: 73366
* Fix old-style type names in comments.Dan Gohman2009-06-149-20/+20
| | | | llvm-svn: 73362
* Implement more aggressive folding of add operand lists whenDan Gohman2009-06-141-0/+128
| | | | | | | | | | they contain multiplications of constants with add operations. This helps simplify several kinds of things; in particular it helps simplify expressions like ((-1 * (%a + %b)) + %a) to %b, as expressions like this often come up in loop trip count computations. llvm-svn: 73361
* Check for the short-circuiting condition before performingDan Gohman2009-06-141-1/+1
| | | | | | the potentially expensive erase. llvm-svn: 73359
* Do compare constant SCEV values in SCEVComplexityCompare, becauseDan Gohman2009-06-141-3/+12
| | | | | | | | even though the order doesn't matter at the top level of an expression, it does matter when the constant is a subexpression of an n-ary expression, because n-ary expressions are sorted lexicographically. llvm-svn: 73358
* Convert several parts of the ScalarEvolution framework to useDan Gohman2009-06-143-52/+58
| | | | | | SmallVector instead of std::vector. llvm-svn: 73357
* Add another item to the list of things that indvars does.Dan Gohman2009-06-141-1/+4
| | | | llvm-svn: 73355
* Move register allocation preference (or hint) from LiveInterval to ↵Evan Cheng2009-06-148-37/+142
| | | | | | MachineRegisterInfo. This allows more passes to set them. llvm-svn: 73346
* Fix CMake build. Patch from Ingmar Vanhassel.Torok Edwin2009-06-141-0/+1
| | | | llvm-svn: 73342
* Add an early implementation of a partial inlining pass. The idea behind thisOwen Anderson2009-06-141-0/+171
| | | | | | | | | | is that, for functions whose bodies are entirely guarded by an if-statement, it can be profitable to pull the test out of the callee and into the caller. This code has had some cursory testing, but still has a number of known issues on the LLVM test suite. llvm-svn: 73338
* Introduce new BinaryObject (blob) class, ELF Writer modified to use it. ↵Bruno Cardoso Lopes2009-06-145-258/+186
| | | | | | BinaryObject.h by Aaron Gray llvm-svn: 73333
* Unlike the other instructions, GEP really does need to look at the type of aNick Lewycky2009-06-131-0/+14
| | | | | | pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review! llvm-svn: 73299
* The subprogram descriptor for a function may be missing (llvm-ld linking two ↵Sanjiv Gupta2009-06-133-78/+134
| | | | | | | | | static functions with same name), so pick up the compilation unit for the function from the first valid debug loc of its instructions. This patch also emits debug info for structure (aggregate types in general) types. llvm-svn: 73295
* Teach SCEVExpander's visitAddRecExpr to reuse an existing canonicalDan Gohman2009-06-132-79/+75
| | | | | | | | | | | | | | | | | induction variable when the addrec to be expanded does not require a wider type. This eliminates the need for IndVarSimplify to micro-manage SCEV expansions, because SCEVExpander now automatically expands them in the form that IndVarSimplify considers to be canonical. (LSR still micro-manages its SCEV expansions, because it's optimizing for the target, rather than for other optimizations.) Also, this uses the new getAnyExtendExpr, which has more clever expression simplification logic than the IndVarSimplify code it replaces, and this cleans up some ugly expansions in code such as the included masked-iv.ll testcase. llvm-svn: 73294
* Add a ScalarEvolution::getAnyExtendExpr utility function for performingDan Gohman2009-06-131-0/+59
| | | | | | extension with unspecified bits. llvm-svn: 73293
* Add a ARM specific pre-allocation pass that re-schedule loads / stores fromEvan Cheng2009-06-135-28/+334
| | | | | | | | | | | consecutive addresses togther. This makes it easier for the post-allocation pass to form ldm / stm. This is step 1. We are still missing a lot of ldm / stm opportunities because of register allocation are not done in the desired order. More enhancements coming. llvm-svn: 73291
* llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block ↵Devang Patel2009-06-131-1/+5
| | | | | | | | in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics. Apply defensive patch to preserve at least one lexical scope till the end of function. llvm-svn: 73282
OpenPOWER on IntegriCloud