aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Split MCELFStreamer into a header file.Logan Chien2012-12-071-107/+63
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169603 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Remove readonly/readnone attributes from all called functions.Evgeniy Stepanov2012-12-071-0/+13
| | | | | | | | | | | MSan uses a TLS slot to pass shadow for function arguments and return values. This makes all instrumented functions not readonly, and at the same time requires that all callees of an instrumented function that may be MSan-instrumented do not have readonly attribute (otherwise some of the instrumentation may be optimized out). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169591 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new MIBundleBuilder class in the Mips target.Jakob Stoklund Olesen2012-12-072-18/+26
| | | | | | This is the preferred way of creating bundled machine instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169585 91177308-0d34-0410-b5e6-96231b3b80d8
* Add higher-level API for dealing with bundled MachineInstrs.Jakob Stoklund Olesen2012-12-071-0/+32
| | | | | | | | | | | | | | | | | | | | | This is still a work in progress. The purpose is to make bundling and unbundling operations explicit, and to catch errors where bundles are broken or created inadvertently. The old IsInsideBundle flag is replaced by two MI flags: BundledPred which has the same meaning as IsInsideBundle, and BundledSucc which is set on instructions that are bundled with a successor. Having two flags provdes redundancy to detect when a bundle is inadvertently torn by a splice() or insert(), and it makes it possible to write bundle iterators that don't need to peek at adjacent instructions. The new flags can't be manipulated directly (once setIsInsideBundle is gone). Instead there are MI functions to make and break bundle bonds. The setIsInsideBundle function will be removed in a future commit. It should be replaced by bundleWithPred(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169583 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Delete nodes and instructions for dynamic alloca that are no longer inAkira Hatanaka2012-12-073-23/+0
| | | | | | | use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169580 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Shorten predicate name.Akira Hatanaka2012-12-075-105/+105
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169579 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Delete unused sub-target features.Akira Hatanaka2012-12-073-15/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169578 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Remove unnecessary predicates.Akira Hatanaka2012-12-073-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169577 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to ValueTracking for determining that a pointer is non-nullChandler Carruth2012-12-071-0/+73
| | | | | | | | | | | | | | | | | | | | | | | by virtue of inbounds GEPs that preclude a null pointer. This is a very common pattern in the code generated by std::vector and other standard library routines which use allocators that test for null pervasively. This is one step closer to teaching Clang+LLVM to be able to produce an empty function for: void f() { std::vector<int> v; v.push_back(1); v.push_back(2); v.push_back(3); v.push_back(4); } Which is related to getting them to completely fold SmallVector push_back sequences into constants when inlining and other optimizations make that a possibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169573 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a 'using' declaration to suppress GCC's -Woverloaded-virtual while weMatt Beaumont-Gay2012-12-061-0/+1
| | | | | | decide what pattern we want to follow in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169561 91177308-0d34-0410-b5e6-96231b3b80d8
* fixed valgrind issues of prior commit, this change applies r169456 changes ↵Pedro Artigas2012-12-062-9/+48
| | | | | | | | | | | | | | | back to the tree with fixes. on darwin no valgrind issues exist in the tests that used to fail. original change description: change MCContext to work on the doInitialization/doFinalization model reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169553 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused field.Jakub Staszak2012-12-061-6/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169551 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing spaces.Jakub Staszak2012-12-061-25/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169550 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace r169459 with something safer. Rather than having computeMaskedBits toEvan Cheng2012-12-067-101/+58
| | | | | | | | | | | understand target implementation of any_extend / extload, just generate zero_extend in place of any_extend for liveouts when the target knows the zero_extend will be implicit (e.g. ARM ldrb / ldrh) or folded (e.g. x86 movz). rdar://12771555 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169536 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded function, since PR8156 was fixed over a year ago.Jakub Staszak2012-12-061-18/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169534 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code.Jakub Staszak2012-12-061-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169521 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in the code that merges consecutive stores. Previously we did notNadav Rotem2012-12-061-10/+14
| | | | | | | | | check if loads that happen in between stores alias with the first store in the chain, only with the second store onwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169516 91177308-0d34-0410-b5e6-96231b3b80d8
* MemorySanitizer.cpp: Suppress a warning. [-Wunused-variable]NAKAMURA Takumi2012-12-061-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169504 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Fix a typo in a comment.Evgeniy Stepanov2012-12-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169491 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Do not store origin for clean values.Evgeniy Stepanov2012-12-061-17/+57
| | | | | | | | | | | | | | | | | | | Instead of unconditionally storing origin with every application store, only do this when the shadow of the stored value is != 0. This change also delays instrumentation of stores until after the walk over function's instructions, because adding new basic blocks confuses InstVisitor. We only keep 1 origin value per 4 bytes of application memory. This change fixes the bug when a store of a single clean byte wiped the origin for the whole 4-byte area. Since stores of uninitialized values are relatively uncommon, this change improves performance of track-origins mode by 5% median and by up to 47% on specs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169490 91177308-0d34-0410-b5e6-96231b3b80d8
* s/getLowerBoundDefault/getDefaultLowerBound/ for consistency. Also put the ↵Bill Wendling2012-12-062-5/+7
| | | | | | more natural check first in the if-then statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169486 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle non-default array bounds.Bill Wendling2012-12-062-14/+59
| | | | | | | | | | Some languages, e.g. Ada and Pascal, allow you to specify that the array bounds are different from the default (1 in these cases). If we have a lower bound that's non-default, then we emit the lower bound. We also calculate the correct upper bound in those cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169484 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove intrinsic specific instructions for (V)MOVQUmr with patterns pointing ↵Craig Topper2012-12-061-13/+5
| | | | | | to the normal instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169482 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark MOVDQ(A/U)rm as ReMaterializable. Mark all MOVDQ(A/U) instructions as ↵Craig Topper2012-12-062-4/+9
| | | | | | neverHasSideEffects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169477 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r169456, "change MCContext to work on the ↵NAKAMURA Takumi2012-12-062-36/+6
| | | | | | | | doInitialization/doFinalization model" It broke many builders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169462 91177308-0d34-0410-b5e6-96231b3b80d8
* [arm fast-isel] Make the fast-isel implementation of memcpy respect alignment.Chad Rosier2012-12-061-11/+22
| | | | | | rdar://12821569 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169460 91177308-0d34-0410-b5e6-96231b3b80d8
* Let targets provide hooks that compute known zero and ones for any_extendEvan Cheng2012-12-066-7/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and extload's. If they are implemented as zero-extend, or implicitly zero-extend, then this can enable more demanded bits optimizations. e.g. define void @foo(i16* %ptr, i32 %a) nounwind { entry: %tmp1 = icmp ult i32 %a, 100 br i1 %tmp1, label %bb1, label %bb2 bb1: %tmp2 = load i16* %ptr, align 2 br label %bb2 bb2: %tmp3 = phi i16 [ 0, %entry ], [ %tmp2, %bb1 ] %cmp = icmp ult i16 %tmp3, 24 br i1 %cmp, label %bb3, label %exit bb3: call void @bar() nounwind br label %exit exit: ret void } This compiles to the followings before: push {lr} mov r2, #0 cmp r1, #99 bhi LBB0_2 @ BB#1: @ %bb1 ldrh r2, [r0] LBB0_2: @ %bb2 uxth r0, r2 cmp r0, #23 bhi LBB0_4 @ BB#3: @ %bb3 bl _bar LBB0_4: @ %exit pop {lr} bx lr The uxth is not needed since ldrh implicitly zero-extend the high bits. With this change it's eliminated. rdar://12771555 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169459 91177308-0d34-0410-b5e6-96231b3b80d8
* change MCContext to work on the doInitialization/doFinalization modelPedro Artigas2012-12-062-6/+36
| | | | | | | | reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169456 91177308-0d34-0410-b5e6-96231b3b80d8
* Set the 'MadeChange' variable if we are deleting blocks.Bill Wendling2012-12-061-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169455 91177308-0d34-0410-b5e6-96231b3b80d8
* Have CannotBeNegativeZero() be aware of the nsz fast-math flagMichael Ilseman2012-12-061-1/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169452 91177308-0d34-0410-b5e6-96231b3b80d8
* RegPressureTracker::dump(): Remove unnecessary argument.Andrew Trick2012-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169443 91177308-0d34-0410-b5e6-96231b3b80d8
* Change std::vector to SmallVector<4> and remove some unused methods.Eli Bendersky2012-12-051-1/+1
| | | | | | | | | | This is more consistent with other vectors in this code. In addition, I ran some tests compiling a large program and >96% of fragments have 4 or less fixups, so SmallVector<4> is a good optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169433 91177308-0d34-0410-b5e6-96231b3b80d8
* Define new-value store instructions with base+immediate addressing modeJyotsna Verma2012-12-051-128/+53
| | | | | | | | using multiclass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169432 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix name. The array is unboundED.Bill Wendling2012-12-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169428 91177308-0d34-0410-b5e6-96231b3b80d8
* RegisterPressureTracker: fix findUseBetween to handle DebugValueAndrew Trick2012-12-051-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169427 91177308-0d34-0410-b5e6-96231b3b80d8
* RegisterPressureTracker: unify virtual registers and physical regunits.Andrew Trick2012-12-051-241/+179
| | | | | | Now that live register units are tracked individually, the code can be simplified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169426 91177308-0d34-0410-b5e6-96231b3b80d8
* RegisterPresssureTracker: Track live physical register by unit.Andrew Trick2012-12-051-94/+87
| | | | | | | | This is much simpler to reason about, more efficient, and fixes some corner cases involving implicit super-register defs. Fixed rdar://12797931. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169425 91177308-0d34-0410-b5e6-96231b3b80d8
* Cost Model: change the default cost of control flow instructions (br / ret / ↵Nadav Rotem2012-12-051-1/+1
| | | | | | ...) to zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169423 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct ARM NOP encodingDavid Sehr2012-12-051-1/+1
| | | | | | | | | | | | The encoding of NOP in ARMAsmBackend.cpp is missing a trailing zero, which causes the emission of a coprocessor instruction rather than "mov r0, r0" as indicated in the comment. The test also checks for the wrong encoding. http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121203/157919.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169420 91177308-0d34-0410-b5e6-96231b3b80d8
* [NVPTX] Fix crash with unnamed struct argumentsJustin Holewinski2012-12-051-1/+1
| | | | | | Patch by Eric Holk git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169418 91177308-0d34-0410-b5e6-96231b3b80d8
* Use multiclass to define store instructions with base+immediate offsetJyotsna Verma2012-12-051-138/+68
| | | | | | | | addressing mode and immediate stored value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169408 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust JIT target triple on OS X to match the current architecture.Bob Wilson2012-12-051-1/+11
| | | | | | | | | For OS X builds, we generate one version of config.h but then build for multiple architectures. This means that the LLVM_HOSTTRIPLE setting may have the wrong architecture. Adjust it dynamically to match the current architecture. <rdar://problem/12715470> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169405 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix misplaced closing brace.Matthew Curtis2012-12-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169404 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to unbreak the build on hosts that don't transitively pull in a ↵Benjamin Kramer2012-12-051-2/+2
| | | | | | | | definition for int64_t. Also use the portable (ugly) format string macros, for MSVC compatibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169396 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused MachineInstr constructors.Jakob Stoklund Olesen2012-12-051-27/+0
| | | | | | | | A MachineInstr can only ever be constructed by CreateMachineInstr() and CloneMachineInstr(), and those factories don't use the removed constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169395 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a option to the disassembler to print immediates as hex.Kevin Enderby2012-12-054-11/+26
| | | | | | | | | | | | | | | | | | | | | | This is for the lldb team so most of but not all of the values are to be printed as hex with this option. Some small values like the scale in an X86 address were requested to printed in decimal without the leading 0x. There may be some tweaks need to places that may still be in decimal that they want in hex. Specially for arm. I made my best guess. Any tweaks from here should be simple. I also did the best I know now with help from the C++ gurus creating the cleanest formatImm() utility function and containing the changes. But if someone has a better idea to make something cleaner I'm all ears and game for changing the implementation. rdar://8109283 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169393 91177308-0d34-0410-b5e6-96231b3b80d8
* - Added calls to doInitialization/doFinalization to immutable passesPedro Artigas2012-12-052-15/+52
| | | | | | | | | | | - fixed ordering of calls to doFinalization to be the reverse of the pass run order due to potential dependencies - fixed machine module info to operate in the doInitialization/doFinalization model, also fixes some FIXMEs reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169391 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Instrument bswap intrinsic.Evgeniy Stepanov2012-12-051-6/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169383 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Initialize callbacks in runOnFunction as opposed to doInitialization.Evgeniy Stepanov2012-12-051-37/+49
| | | | | | | This mirrors the change in ASan & TSan done in r168864. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169378 91177308-0d34-0410-b5e6-96231b3b80d8
* [msan] Change linkage type of __msan_track_origins.Evgeniy Stepanov2012-12-051-1/+1
| | | | | | | | LinkOnceODRLinkage globals may be removed in GlobalOpt if not used in the current module. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169377 91177308-0d34-0410-b5e6-96231b3b80d8