aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* [block-freq] Add BlockFrequency::scale that returns a remainder from the ↵Michael Gottesman2013-11-171-38/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | division and make the private scale in BlockFrequency more performant. This change is the first in a series of changes improving LLVM's Block Frequency propogation implementation to not lose probability mass in branchy code when propogating block frequency information from a basic block to its successors. This patch is a simple infrastructure improvement that does not actually modify the block frequency algorithm. The specific changes are: 1. Changes the division algorithm used when scaling block frequencies by branch probabilities to a short division algorithm. This gives us the remainder for free as well as provides a nice speed boost. When I benched the old routine and the new routine on a Sandy Bridge iMac with disabled turbo mode performing 8192 iterations on an array of length 32768, I saw ~600% increase in speed in mean/median performance. 2. Exposes a scale method that returns a remainder. This is important so we can ensure that when we scale a block frequency by some branch probability BP = N/D, the remainder from the division by D can be retrieved and propagated to other children to ensure no probability mass is lost (more to come on this). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194950 91177308-0d34-0410-b5e6-96231b3b80d8
* Use more getZExtOrTruncsMatt Arsenault2013-11-172-9/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194945 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getZExtOrTrunc instead of repeating the same logic.Matt Arsenault2013-11-171-5/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194944 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the cold attribute to error-reporting call sitesHal Finkel2013-11-171-0/+72
| | | | | | | | | | | Generally speaking, control flow paths with error reporting calls are cold. So far, error reporting calls are calls to perror and calls to fprintf, fwrite, etc. with stderr as the stream. This can be extended in the future. The primary motivation is to improve block placement (the cold attribute affects the static branch prediction heuristics). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194943 91177308-0d34-0410-b5e6-96231b3b80d8
* Added a size field to the stack map record to handle subregister spills.Andrew Trick2013-11-176-18/+91
| | | | | | | | Implementing this on bigendian platforms could get strange. I added a target hook, getStackSlotRange, per Jakob's recommendation to make this as explicit as possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194942 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ndebug-build unused variable in loop rerollingHal Finkel2013-11-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194941 91177308-0d34-0410-b5e6-96231b3b80d8
* Use right address space pointer sizeMatt Arsenault2013-11-171-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194940 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a loop rerolling passHal Finkel2013-11-164-0/+1196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a loop rerolling pass: the opposite of (partial) loop unrolling. The transformation aims to take loops like this: for (int i = 0; i < 3200; i += 5) { a[i] += alpha * b[i]; a[i + 1] += alpha * b[i + 1]; a[i + 2] += alpha * b[i + 2]; a[i + 3] += alpha * b[i + 3]; a[i + 4] += alpha * b[i + 4]; } and turn them into this: for (int i = 0; i < 3200; ++i) { a[i] += alpha * b[i]; } and loops like this: for (int i = 0; i < 500; ++i) { x[3*i] = foo(0); x[3*i+1] = foo(0); x[3*i+2] = foo(0); } and turn them into this: for (int i = 0; i < 1500; ++i) { x[i] = foo(0); } There are two motivations for this transformation: 1. Code-size reduction (especially relevant, obviously, when compiling for code size). 2. Providing greater choice to the loop vectorizer (and generic unroller) to choose the unrolling factor (and a better ability to vectorize). The loop vectorizer can take vector lengths and register pressure into account when choosing an unrolling factor, for example, and a pre-unrolled loop limits that choice. This is especially problematic if the manual unrolling was optimized for a machine different from the current target. The current implementation is limited to single basic-block loops only. The rerolling recognition should work regardless of how the loop iterations are intermixed within the loop body (subject to dependency and side-effect constraints), but the significant restriction is that the order of the instructions in each iteration must be identical. This seems sufficient to capture all current use cases. This pass is not currently enabled by default at any optimization level. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194939 91177308-0d34-0410-b5e6-96231b3b80d8
* The WebKit_JS CC preserves the same registers as the C CC.Juergen Ributzka2013-11-161-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194936 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the InstCombine fptrunc sqrt optimization to llvm.sqrtHal Finkel2013-11-161-6/+11
| | | | | | | | | | | | | | | | | | | InstCombine, in visitFPTrunc, applies the following optimization to sqrt calls: (fptrunc (sqrt (fpext x))) -> (sqrtf x) but does not apply the same optimization to llvm.sqrt. This is a problem because, to enable vectorization, Clang generates llvm.sqrt instead of sqrt in fast-math mode, and because this optimization is being applied to sqrt and not applied to llvm.sqrt, sometimes the fast-math code is slower. This change makes InstCombine apply this optimization to llvm.sqrt as well. This fixes the specific problem in PR17758, although the same underlying issue (optimizations applied to libcalls are not applied to intrinsics) exists for other optimizations in SimplifyLibCalls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194935 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assert on unaligned access to global with different address space size.Matt Arsenault2013-11-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194934 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix codegen for null different sized pointer.Matt Arsenault2013-11-161-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194932 91177308-0d34-0410-b5e6-96231b3b80d8
* Annotate APInt methods where it's not clear whether they are in place with ↵Benjamin Kramer2013-11-161-6/+6
| | | | | | | | warn_unused_result. Fix ScalarEvolution bugs uncovered by this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194928 91177308-0d34-0410-b5e6-96231b3b80d8
* R600: Make dot_4 instructions predicableVincent Lejeune2013-11-161-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194927 91177308-0d34-0410-b5e6-96231b3b80d8
* Use array_pod_sort instead of std::sortDuncan P. N. Exon Smith2013-11-161-1/+1
| | | | | | Per Rafael's review of r194514. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194926 91177308-0d34-0410-b5e6-96231b3b80d8
* InstCombine: fold (A >> C) == (B >> C) --> (A^B) < (1 << C) for constant Cs.Benjamin Kramer2013-11-161-0/+18
| | | | | | This is common in bitfield code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194925 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info Verifier: remove un-used argument in verifyDebugInfo.Manman Ren2013-11-161-3/+3
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194917 91177308-0d34-0410-b5e6-96231b3b80d8
* X86: Encode the 'h' cpu subtype in the MachO header for x86.Jim Grosbach2013-11-162-7/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194906 91177308-0d34-0410-b5e6-96231b3b80d8
* Use correct size for address space in BasicAA.Matt Arsenault2013-11-161-2/+3
| | | | | | | | | | | | The tests just hit this with a different sized address space since I haven't figured out how to use this to break it. I thought I committed this a long time ago, and I'm not sure why missing this hasn't caused any problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194903 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push type safety of DIDescriptor through ↵David Blaikie2013-11-162-5/+5
| | | | | | CompileUnit::createAndAddDIE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194902 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Remove unnecessary OwningPtr<T>::get() callDavid Blaikie2013-11-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194901 91177308-0d34-0410-b5e6-96231b3b80d8
* For dwarf4 use the correct form for referencing debug_loc locations,Eric Christopher2013-11-162-2/+4
| | | | | | | | | and update test cases accordingly. This doesn't affect the output dumped using llvm-dwarfdump, but readelf does now dump the debug_loc section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194898 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Add type safety to CompileUnit::getNode by returning ↵David Blaikie2013-11-152-5/+4
| | | | | | DICompileUnit instead of a raw MDNode*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194895 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Add type safety by using DICompileUnit rather than raw ↵David Blaikie2013-11-154-16/+16
| | | | | | MDNode* for the CU metadata node git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194893 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Simplify getLanguage() calls to use existing member functionDavid Blaikie2013-11-151-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194892 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented aarch64 Neon scalar vmulx_lane intrinsicsAna Pazos2013-11-151-2/+169
| | | | | | | | | | | | | | | | Implemented aarch64 Neon scalar vfma_lane intrinsics Implemented aarch64 Neon scalar vfms_lane intrinsics Implemented legacy vmul_n_f64, vmul_lane_f64, vmul_laneq_f64 intrinsics (v1f64 parameter type) using Neon scalar instructions. Implemented legacy vfma_lane_f64, vfms_lane_f64, vfma_laneq_f64, vfms_laneq_f64 intrinsics (v1f64 parameter type) using Neon scalar instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194888 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the dangling context hotfix with an assertion.Adrian Prantl2013-11-151-4/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194883 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused arguments.Lang Hames2013-11-151-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194882 91177308-0d34-0410-b5e6-96231b3b80d8
* During folding for patchpoint/stackmap instructions, defer creation of new MIsLang Hames2013-11-151-4/+5
| | | | | | | | | | until we know that folding will be successful. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194880 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfDebug: Push DISubprogram through updateSubprogramScopeDIEDavid Blaikie2013-11-152-7/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194879 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopVectorizer: Use abi alignment for accesses with no alignmentArnold Schwaighofer2013-11-151-0/+4
| | | | | | | | | | | When we vectorize a scalar access with no alignment specified, we have to set the target's abi alignment of the scalar access on the vectorized access. Using the same alignment of zero would be wrong because most targets will have a bigger abi alignment for vector types. This probably fixes PR17878. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194876 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push DIDescriptors through a getDIE/insertDIEDavid Blaikie2013-11-153-19/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194875 91177308-0d34-0410-b5e6-96231b3b80d8
* DwarfCompileUnit: Push DIDescriptor usage out from isShareableAcrossCUsDavid Blaikie2013-11-151-5/+5
| | | | | | | This is the first of a few similar patches. We'll see how far it goes/makes sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194871 91177308-0d34-0410-b5e6-96231b3b80d8
* [weak vtables] Remove a bunch of weak vtablesJuergen Ributzka2013-11-1577-56/+256
| | | | | | | | | | | This patch removes most of the trivial cases of weak vtables by pinning them to a single object file. Differential Revision: http://llvm-reviews.chandlerc.com/D2068 Reviewed by Andy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194865 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix confusing machine verifier error.Matt Arsenault2013-11-151-1/+1
| | | | | | | | | | | The error reported the number of explicit operands, but that isn't what is checked. In my case, this resulted in the confusing errors "Too few operands." followed shortly by "8 operands expected, but 8 given." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194862 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a problem in MCJIT identifying the module containing a global variable.Andrew Kaylor2013-11-151-2/+2
| | | | | | | | Patch by Keno Fischer! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194859 91177308-0d34-0410-b5e6-96231b3b80d8
* Make method staticMatt Arsenault2013-11-152-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194858 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Fix an iterator problem spotted by the MSVC debug iterators andChandler Carruth2013-11-151-8/+10
| | | | | | AaronBallman. Thanks for the excellent review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194857 91177308-0d34-0410-b5e6-96231b3b80d8
* [PM] Run clang-format on a few lines that I missed in my first pass,Chandler Carruth2013-11-151-2/+2
| | | | | | pulling them under 80-columns. No functionality changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194856 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Fix the scalar NEON ACLE functions so that they return float/doubleChad Rosier2013-11-151-4/+4
| | | | | | rather than the vector equivalent. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194853 91177308-0d34-0410-b5e6-96231b3b80d8
* Path: Recognize COFF import library file magic.Rui Ueyama2013-11-154-0/+7
| | | | | | | | | | | | Summary: Make identify_magic to recognize COFF import file. Reviewers: Bigcheese CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2165 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194852 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement r194843 in a slightly less broken way.Adrian Prantl2013-11-151-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194848 91177308-0d34-0410-b5e6-96231b3b80d8
* ArgumentPromotion: correctly transfer TBAA tags and alignments.Manman Ren2013-11-151-3/+5
| | | | | | | | | | | | | | | We used to use std::map<IndicesVector, LoadInst*> for OriginalLoads, and when we try to promote two arguments, they will both write to OriginalLoads causing created loads for the two arguments to have the same original load. And the same tbaa tag and alignment will be put to the created loads for the two arguments. The fix is to use std::map<std::pair<Argument*, IndicesVector>, LoadInst*> for OriginalLoads, so each Argument will write to different parts of the map. PR17906 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194846 91177308-0d34-0410-b5e6-96231b3b80d8
* Readobj: If NumbersOfSections is 0xffff, it's an COFF import library.Rui Ueyama2013-11-151-4/+7
| | | | | | | | 0xffff does not mean that there are 65535 sections in a COFF file but indicates that it's a COFF import library. This patch fixes SEGV error when an import library file is passed to llvm-readobj. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194844 91177308-0d34-0410-b5e6-96231b3b80d8
* Restore the behaviour from before r194728.Adrian Prantl2013-11-151-1/+3
| | | | | | If getDIE() fails, getOrCreateContextDIE() should also return the CUDie. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194843 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid illegal integer promotion in fastiselBob Wilson2013-11-154-21/+21
| | | | | | | | | | | | | | | | | Stop folding constant adds into GEP when the type size doesn't match. Otherwise, the adds' operands are effectively being promoted, changing the conditions of an overflow. Results are different when: sext(a) + sext(b) != sext(a + b) Problem originally found on x86-64, but also fixed issues with ARM and PPC, which used similar code. <rdar://problem/15292280> Patch by Duncan Exon Smith! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194840 91177308-0d34-0410-b5e6-96231b3b80d8
* R600/SI: Add VReg_96 register class to SIRegisterInfo::hasVGPRs()Tom Stellard2013-11-151-0/+1
| | | | | | This fixes a crash with GNOME settings manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194836 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve JIT runtime linking problems on Android.Andrew Kaylor2013-11-152-3/+84
| | | | | | | | Patch by James Lyon! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194832 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to initialize memory for a global if the allocation failed in ↵Andrew Kaylor2013-11-151-0/+4
| | | | | | | | | | ExecutionEngine. Patch by Dale Martin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194831 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AVX512 unmasked FMA intrinsics and support.Cameron McInally2013-11-151-1/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194824 91177308-0d34-0410-b5e6-96231b3b80d8