summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Checking for a return value with FormatMessage; if the call fails, there's ↵Aaron Ballman2013-11-181-4/+9
| | | | | | no guarantee that the buffer will be non-null. llvm-svn: 195019
* Fixing a possible memory leak from a failing realloc() call.Aaron Ballman2013-11-181-2/+7
| | | | llvm-svn: 195018
* Recover gracefully when deserializing invalid YAML input.Alexander Kornienko2013-11-181-7/+26
| | | | | | | | | Fixes http://llvm.org/PR16221, http://llvm.org/PR15927 Phabricator: http://llvm-reviews.chandlerc.com/D1236 Patch by Andrew Tulloch! llvm-svn: 195016
* [ASan] Fix PR17867 - make sure ASan doesn't crash if use-after-scope and ↵Alexey Samsonov2013-11-181-6/+6
| | | | | | use-after-return are combined. llvm-svn: 195014
* LoopVectorizer: Extend the induction variable to a larger typeArnold Schwaighofer2013-11-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In some case the loop exit count computation can overflow. Extend the type to prevent most of those cases. The problem is loops like: int main () { int a = 1; char b = 0; lbl: a &= 4; b--; if (b) goto lbl; return a; } The backedge count is 255. The induction variable type is i8. If we add one to 255 to get the exit count we overflow to zero. To work around this issue we extend the type of the induction variable to i32 in the case of i8 and i16. PR17532 llvm-svn: 195008
* [mips] Fix 'ran out of registers' in MIPS32 with FP64 when generating code ↵Daniel Sanders2013-11-182-2/+12
| | | | | | | | | | for (ConstantFP 0.0) Fixed an inappropriate use of BuildPairF64 when compiling for MIPS32 with FP64 which resulted in an impossible constraint on the register allocation. It now uses BuildPairF64_64. llvm-svn: 195007
* [mips][msa] Update encoding of bnz.v (typo).Matheus Almeida2013-11-181-1/+1
| | | | | | Note that there's no hardware yet that relies on that encoding. llvm-svn: 195006
* [mips][msa] Fix immediate value of LSA instruction as it was being wrongly ↵Matheus Almeida2013-11-185-6/+108
| | | | | | | | | encoded. The immediate field should be encoded as "imm - 1" as the CPU always adds one to that field. llvm-svn: 195004
* Revert r194865 and r194874.Alexey Samsonov2013-11-1877-256/+56
| | | | | | | | | | | | This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. llvm-svn: 194997
* [AArch64 NEON]Add mov alias for simd copy instructions.Kevin Qin2013-11-181-35/+63
| | | | | | Set some unspecified bits of INS/DUP to zero as ARMARM requested. llvm-svn: 194996
* Implement the newly added ACLE functions for ld1/st1 with 2/3/4 vectors.Hao Liu2013-11-184-45/+237
| | | | | | The functions are like: vst1_s8_x2 ... llvm-svn: 194990
* Debug Info Verifier: disable it by default.Manman Ren2013-11-181-1/+1
| | | | | | | | | | | | | | Debug info verifier is part of the verifier which is a Function Pass. Tot currently tries to pull all reachable debug info MDNodes in each function, which is too time-consuming. The correct fix seems to be separating debug info verification to its own module pass. I will disable the debug info verifier until a correct fix is found. For Bill's testing case, enabling debug info verifier increase compile time from 11s to 11m. llvm-svn: 194986
* Fix spacing, forward declare order.Matt Arsenault2013-11-182-2/+2
| | | | llvm-svn: 194985
* Remove unnecessary temporary construction.David Blaikie2013-11-171-1/+1
| | | | llvm-svn: 194981
* Remove redundant explicit default initialization.David Blaikie2013-11-171-2/+2
| | | | llvm-svn: 194980
* DwarfCompileUnit: Add type safety to createGlobalVariableDIEDavid Blaikie2013-11-173-5/+4
| | | | llvm-svn: 194979
* Debug Info: fix typo in function name.Manman Ren2013-11-171-5/+5
| | | | llvm-svn: 194975
* Debug Info Verifier: fix when to find debug info nodes and when to verify them.Manman Ren2013-11-171-5/+11
| | | | | | | | | | | | | | | | | | We used to collect debug info MDNodes in doInitialization and verify them in doFinalization. That is incorrect since MDNodes can be modified by passes run between doInitialization and doFinalization. To fix the problem, we handle debug info MDNodes that can be reached from a function in runOnFunction (i.e we collect those nodes by calling processDeclare, processValue and processLocation, and then verify them in runOnFunction). We handle debug info MDNodes that can be reached from named metadata in doFinalization. This is in line with how Verifier handles module-level data (they are verified in doFinalization). rdar://15472296 llvm-svn: 194974
* Debug Info Verifier: enable public functions of Finder to update the type map.Manman Ren2013-11-172-8/+21
| | | | | | | | | | We used to depend on running processModule before the other public functions such as processDeclare, processValue and processLocation. We are now relaxing the constraint by adding a module argument to the three functions and letting the three functions to initialize the type map. This will be used in a follow-on patch that collects nodes reachable from a Function. llvm-svn: 194973
* Utils/LoopUnroll.cpp: Tweak (StringRef)OldName to be valid until it is used, ↵NAKAMURA Takumi2013-11-171-1/+3
| | | | | | | | since r194601. eraseFromParent() invalidates OldName. llvm-svn: 194970
* Add a loop rerolling flag to the PassManagerBuilderHal Finkel2013-11-171-1/+2
| | | | | | | | | This adds a boolean member variable to the PassManagerBuilder to control loop rerolling (just like we have for unrolling and the various vectorization options). This is necessary for control by the frontend. Loop rerolling remains disabled by default at all optimization levels. llvm-svn: 194966
* Revert "Micro-optimization"Bill Wendling2013-11-171-4/+5
| | | | | | | | This reverts commit f1d9fe9d04ce93f6d5dcebbd2cb6a07414d7a029. This was causing PR17964. We need to use thread data before regular data. llvm-svn: 194960
* DAGCombiner: Partially revert r192795, getNOT was fixed not to create ↵Benjamin Kramer2013-11-171-1/+1
| | | | | | illegal constants. llvm-svn: 194959
* [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). llvm-svn: 194950
* Use more getZExtOrTruncsMatt Arsenault2013-11-172-9/+2
| | | | llvm-svn: 194945
* Use getZExtOrTrunc instead of repeating the same logic.Matt Arsenault2013-11-171-5/+1
| | | | llvm-svn: 194944
* 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). llvm-svn: 194943
* 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. llvm-svn: 194942
* Fix ndebug-build unused variable in loop rerollingHal Finkel2013-11-171-1/+1
| | | | llvm-svn: 194941
* Use right address space pointer sizeMatt Arsenault2013-11-171-1/+2
| | | | llvm-svn: 194940
* 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. llvm-svn: 194939
* The WebKit_JS CC preserves the same registers as the C CC.Juergen Ributzka2013-11-161-0/+1
| | | | llvm-svn: 194936
* 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. llvm-svn: 194935
* Fix assert on unaligned access to global with different address space size.Matt Arsenault2013-11-161-1/+1
| | | | llvm-svn: 194934
* Fix codegen for null different sized pointer.Matt Arsenault2013-11-161-2/+4
| | | | llvm-svn: 194932
* 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. llvm-svn: 194928
* R600: Make dot_4 instructions predicableVincent Lejeune2013-11-161-0/+19
| | | | llvm-svn: 194927
* Use array_pod_sort instead of std::sortDuncan P. N. Exon Smith2013-11-161-1/+1
| | | | | | Per Rafael's review of r194514. llvm-svn: 194926
* 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. llvm-svn: 194925
* Debug Info Verifier: remove un-used argument in verifyDebugInfo.Manman Ren2013-11-161-3/+3
| | | | | | No functionality change. llvm-svn: 194917
* X86: Encode the 'h' cpu subtype in the MachO header for x86.Jim Grosbach2013-11-162-7/+15
| | | | llvm-svn: 194906
* 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. llvm-svn: 194903
* DwarfCompileUnit: Push type safety of DIDescriptor through ↵David Blaikie2013-11-162-5/+5
| | | | | | CompileUnit::createAndAddDIE. llvm-svn: 194902
* DwarfCompileUnit: Remove unnecessary OwningPtr<T>::get() callDavid Blaikie2013-11-161-1/+1
| | | | llvm-svn: 194901
* 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. llvm-svn: 194898
* DwarfCompileUnit: Add type safety to CompileUnit::getNode by returning ↵David Blaikie2013-11-152-5/+4
| | | | | | DICompileUnit instead of a raw MDNode*. llvm-svn: 194895
* DwarfCompileUnit: Add type safety by using DICompileUnit rather than raw ↵David Blaikie2013-11-154-16/+16
| | | | | | MDNode* for the CU metadata node llvm-svn: 194893
* DwarfCompileUnit: Simplify getLanguage() calls to use existing member functionDavid Blaikie2013-11-151-3/+3
| | | | llvm-svn: 194892
* 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. llvm-svn: 194888
* Replace the dangling context hotfix with an assertion.Adrian Prantl2013-11-151-4/+1
| | | | llvm-svn: 194883
OpenPOWER on IntegriCloud