summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* AMDGPU: Partially fix reported code size for some instructionsMatt Arsenault2016-10-064-4/+8
| | | | | | | | These ones need to have the size on the pseudo instruction set for getInstSizeInBytes to work correctly. These also have a statically known size. llvm-svn: 283437
* Add test-cases which demontrate pr30561Zvi Rackover2016-10-061-0/+26
| | | | llvm-svn: 283436
* [ValueTracking] Teach computeKnownBits and ComputeNumSignBits to look ↵Bjorn Pettersson2016-10-062-0/+42
| | | | | | | | | | | | | | | through ExtractElement. Summary: The computeKnownBits and ComputeNumSignBits functions in ValueTracking can now do a simple look-through of ExtractElement. Reviewers: majnemer, spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24955 llvm-svn: 283434
* [EfficiencySanitizer] Adds shadow memory parameters for 40-bit virtual ↵Sagar Thakur2016-10-061-9/+27
| | | | | | | | | | | memory address. Adding 40-bit shadow memory parameters because MIPS64 uses 40-bit virtual memory addresses. Reviewed by rengolin. Differential: https://reviews.llvm.org/D23801 llvm-svn: 283433
* fix build on cygwinNuno Lopes2016-10-061-1/+1
| | | | | | Cygwin has dlfcn.h, but no Dl_info llvm-svn: 283427
* [ARM] Constant pool promotion - fix alignment calculationJames Molloy2016-10-062-1/+11
| | | | | | | | | Global variables are GlobalValues, so they have explicit alignment. Querying DataLayout for the alignment was incorrect. Testcase added. llvm-svn: 283423
* [ARM] Improve testcase for r283323James Molloy2016-10-061-2/+1
| | | | | | | | | We can work around a shortcoming of FileCheck by using {{\[}} to match a square bracket before a [[ sequence. Thanks to Eli Friedman for the heads up! llvm-svn: 283422
* [Triple] Add triple for FuchsiaPetr Hosek2016-10-066-0/+27
| | | | | | | | Fuchsia is a new operating system. Differential Revision: https://reviews.llvm.org/D25116 llvm-svn: 283419
* [libFuzzer] be more careful with memory usage, print peak rss in status linesKostya Serebryany2016-10-063-2/+4
| | | | llvm-svn: 283418
* [AMDGPU] Promote uniform i16 bitreverse intrinsic to i32Konstantin Zhuravlyov2016-10-062-427/+665
| | | | | | Differential Revision: https://reviews.llvm.org/D25121 llvm-svn: 283415
* [libFuzzer] when re-running for lsan, don't look at the coverageKostya Serebryany2016-10-051-1/+1
| | | | llvm-svn: 283411
* [DAG] add tests to show missing checks for SDNode FMFSanjay Patel2016-10-051-4/+111
| | | | | | The AVX attribute is added to remove noise caused by SSE's destructive insts. llvm-svn: 283410
* [libFuzzer] refactoring to make -shrink=1 work for value profile, added a test.Kostya Serebryany2016-10-0512-150/+145
| | | | llvm-svn: 283409
* Fix tests for WindowsHal Finkel2016-10-054-10/+10
| | | | | | We need to match file names with both forward and backward slashes. llvm-svn: 283407
* Add missing #include from r283039. Found by modules build.Richard Smith2016-10-051-0/+1
| | | | llvm-svn: 283405
* [codeview] Truncate records to maximum record size near 64KBReid Kleckner2016-10-053-4/+57
| | | | | | | | | | | | If we don't truncate, LLVM asserts when the label difference doesn't fit in a 16 bit field. This patch truncates two kinds of data: trailing null terminated names in symbol records, and inline line tables. The inline line table test that I have is too large (many MB), so I'm not checking it in. Hopefully fixes PR28264. llvm-svn: 283403
* [llvm-opt-report] Distinguish inlined contexts when optimizations differHal Finkel2016-10-0511-74/+679
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How code is optimized sometimes, perhaps often, depends on the context into which it was inlined. This change allows llvm-opt-report to track the differences between the optimizations performed, or not, in different contexts, and when these differ, display those differences. For example, this code: $ cat /tmp/q.cpp void bar(); void foo(int n) { for (int i = 0; i < n; ++i) bar(); } void quack() { foo(4); } void quack2() { foo(4); } will now produce this report: < /home/hfinkel/src/llvm/test/tools/llvm-opt-report/Inputs/q.cpp 2 | void bar(); 3 | void foo(int n) { [[ > foo(int): 4 | for (int i = 0; i < n; ++i) > quack(), quack2(): 4 U4 | for (int i = 0; i < n; ++i) ]] 5 | bar(); 6 | } 7 | 8 | void quack() { 9 I | foo(4); 10 | } 11 | 12 | void quack2() { 13 I | foo(4); 14 | } 15 | Note that the tool has demangled the function names, and grouped the reports associated with line 4. This shows that the loop on line 4 was unrolled by a factor of 4 when inlined into the functions quack() and quack2(), but not in the function foo(int) itself. llvm-svn: 283402
* Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.Adrian Prantl2016-10-054-79/+55
| | | | | | | | | | | | | This came out of a discussion in https://reviews.llvm.org/D25285. There used to be various other llvm.dbg.* nodes, but we don't support upgrading them and we want to reserve the namespace for future uses. This also removes an entirely obsolete and bitrotted testcase for PR7662. Reapplies 283390 with a forgotten testcase. llvm-svn: 283400
* Revert "Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace."Adrian Prantl2016-10-053-48/+79
| | | | | | Forgot to add a testcase in r283390. llvm-svn: 283399
* Add an llvm-opt-report tool to generate basic source-annotated optimization ↵Hal Finkel2016-10-057-0/+771
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | summaries LLVM now has the ability to record information from optimization remarks in a machine-consumable YAML file for later analysis. This can be enabled in opt (see r282539), and D25225 adds a Clang flag to do the same. This patch adds llvm-opt-report, a tool to generate basic optimization "listing" files (annotated sources with information about what optimizations were performed) from one of these YAML inputs. D19678 proposed to add this capability directly to Clang, but this more-general YAML-based infrastructure was the direction we decided upon in that review thread. For this optimization report, I focused on making the output as succinct as possible while providing information on inlining and loop transformations. The goal here is that the source code should still be easily readable in the report. My primary inspiration here is the reports generated by Cray's tools (http://docs.cray.com/books/S-2496-4101/html-S-2496-4101/z1112823641oswald.html). These reports are highly regarded within the HPC community. Intel's compiler, for example, also has an optimization-report capability (https://software.intel.com/sites/default/files/managed/55/b1/new-compiler-optimization-reports.pdf). $ cat /tmp/v.c void bar(); void foo() { bar(); } void Test(int *res, int *c, int *d, int *p, int n) { int i; #pragma clang loop vectorize(assume_safety) for (i = 0; i < 1600; i++) { res[i] = (p[i] == 0) ? res[i] : res[i] + d[i]; } for (i = 0; i < 16; i++) { res[i] = (p[i] == 0) ? res[i] : res[i] + d[i]; } foo(); foo(); bar(); foo(); } D25225 adds -fsave-optimization-record (and -fsave-optimization-record=filename), and this would be used as follows: $ clang -O3 -o /tmp/v.o -c /tmp/v.c -fsave-optimization-record $ llvm-opt-report /tmp/v.yaml > /tmp/v.lst $ cat /tmp/v.lst < /tmp/v.c 2 | void bar(); 3 | void foo() { bar(); } 4 | 5 | void Test(int *res, int *c, int *d, int *p, int n) { 6 | int i; 7 | 8 | #pragma clang loop vectorize(assume_safety) 9 V4,2 | for (i = 0; i < 1600; i++) { 10 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i]; 11 | } 12 | 13 U16 | for (i = 0; i < 16; i++) { 14 | res[i] = (p[i] == 0) ? res[i] : res[i] + d[i]; 15 | } 16 | 17 I | foo(); 18 | 19 | foo(); bar(); foo(); I | ^ I | ^ 20 | } Each source line gets a prefix giving the line number, and a few columns for important optimizations: inlining, loop unrolling and loop vectorization. An 'I' is printed next to a line where a function was inlined, a 'U' next to an unrolled loop, and 'V' next to a vectorized loop. These are printed on the relevant code line when that seems unambiguous, or on subsequent lines when multiple potential options exist (messages, both positive and negative, from the same optimization with different column numbers are taken to indicate potential ambiguity). When on subsequent lines, a '^' is output in the relevant column. Annotated source for all relevant input files are put into the listing file (each starting with '<' and then the file name). You can disable having the unrolling/vectorization factors appear by using the -s flag. Differential Revision: https://reviews.llvm.org/D25262 llvm-svn: 283398
* Remove extra semicolonReid Kleckner2016-10-051-1/+1
| | | | llvm-svn: 283395
* Fix the build with MSVC 2013, still cannot default move ctors yetReid Kleckner2016-10-051-1/+2
| | | | | | Ten days. llvm-svn: 283394
* [DAG] change test to use 'unsafe' function attribute instead of global settingSanjay Patel2016-10-051-4/+11
| | | | | | But we have node-level FMF, so the next step is to fix this at the instruction/node-level. llvm-svn: 283393
* Modify df_iterator to support post-order actionsDavid Callahan2016-10-0514-29/+48
| | | | | | | | | | | | Summary: This makes a change to the state used to maintain visited information for depth first iterator. We know assume a method "completed(...)" which is called after all children of a node have been visited. In all existing cases, this method does nothing so this patch has no functional changes. It will however allow a client to distinguish back from cross edges in a DFS tree. Reviewers: nadav, mehdi_amini, dberlin Subscribers: MatzeB, mzolotukhin, twoh, freik, llvm-commits Differential Revision: https://reviews.llvm.org/D25191 llvm-svn: 283391
* Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.Adrian Prantl2016-10-053-79/+48
| | | | | | | | | | | This came out of a discussion in https://reviews.llvm.org/D25285. There used to be various other llvm.dbg.* nodes, but we don't support upgrading them and we want to reserve the namespace for future uses. This also removes an entirely obsolete and bitrotted testcase for PR7662. llvm-svn: 283390
* [WebAssembly] Add binary-encoding opcode values to instruction descriptions.Dan Gohman2016-10-058-133/+147
| | | | llvm-svn: 283389
* [codeview] Translate bitpiece metadata to DEFRANGE_SUBFIELD* recordsReid Kleckner2016-10-054-52/+520
| | | | | | | | | | | | | This allows LLVM to describe locations of aggregate variables that have been split by SROA. Fixes PR29141 Reviewers: amccarth, majnemer Differential Revision: https://reviews.llvm.org/D25253 llvm-svn: 283388
* [Object] Fix a crash in Archive::child_iterator's default constructor.Lang Hames2016-10-052-5/+8
| | | | | | | | | | To be default constructible, Archive::child_iterator needs to be able to construct an Archive::Child with a null parent, however Archive::Child's constructor always dereferenced its Parent argument to compute the remaining archive size. This commit fixes Archive::Child's constructor to only do the size calculation when the parent is non-null. llvm-svn: 283387
* [ARM] Use __rt_div functions for divrem on WindowsMartin Storsjo2016-10-053-56/+68
| | | | | | | | | | | | | | | | | | | | This avoids falling back to calling out to the GCC rem functions (__moddi3, __umoddi3) when targeting Windows. The __rt_div functions have flipped the two arguments compared to the __aeabi_divmod functions. To match MSVC, we emit a check for division by zero before actually calling the library function (even if the library function itself also might do the same check). Not all calls to __rt_div functions for division are currently merged with calls to the same function with the same parameters for the remainder. This is more wasteful than a div + mls as before, but avoids calls to __moddi3. Differential Revision: https://reviews.llvm.org/D24076 llvm-svn: 283383
* [Sparc] Implement UMUL_LOHI and SMUL_LOHI instead of MULHS/MULHU/MUL.James Y Knight2016-10-054-22/+8
| | | | | | | This is what the instruction-set actually provides, and the default expansions of the others into the lohi opcodes are good. llvm-svn: 283381
* [ADT] Add missing const_iterator DenseSet::find() constVitaly Buka2016-10-052-11/+28
| | | | | | | | | | | | Summary: Probably overlooked. Reviewers: eugenis, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24689 llvm-svn: 283377
* [asan] Reapply: Switch to using dynamic shadow offset on iOSAnna Zaks2016-10-051-2/+3
| | | | | | | | | | The VM layout is not stable between iOS version releases, so switch to dynamic shadow offset. This is the LLVM counterpart of https://reviews.llvm.org/D25218 Differential Revision: https://reviews.llvm.org/D25219 llvm-svn: 283376
* Improve the debug-info test created in r274263.Yunzhong Gao2016-10-051-3/+20
| | | | | | | | | | | | | This patch is related to r274263 or Phabricator/D21818. This patch aims to improve the test case added in the previous commit to verify specifically that the stack protector pass is adding the debug line info as intended. Before, the test only verified that the verifier pass does not crash. The current approach is to generate the assembly output and then look for the .loc directive. Differential Revision: https://reviews.llvm.org/D25290 llvm-svn: 283374
* [LV] Pass profitability analysis in vectorizer constructor (NFC)Matthew Simpson2016-10-051-23/+28
| | | | | | | | | The vectorizer already holds a pointer to one cost model artifact in a member variable (i.e., MinBWs). As we add more, it will be easier to communicate these artifacts to the vectorizer if we simply pass a pointer to the cost model instead. llvm-svn: 283373
* [RDF] Fix live def propagation through basic blockKrzysztof Parzyszek2016-10-052-45/+274
| | | | llvm-svn: 283371
* AMDGPU: Do not re-use tmpreg in spill/restore loweringMatthias Braun2016-10-051-2/+2
| | | | | | | | | The register scavenging code does not support multiple definitions of the same vreg. Differential Revision: https://reviews.llvm.org/D25220 llvm-svn: 283369
* [LV] Pass legality analysis in vectorizer constructor (NFC)Matthew Simpson2016-10-051-12/+12
| | | | | | | The vectorizer already holds a pointer to the legality analysis in a member variable, so it makes sense that we would pass it in the constructor. llvm-svn: 283368
* FastISel: Remove unused/un-overridden entry points. NFCI.Peter Collingbourne2016-10-053-38/+1
| | | | llvm-svn: 283366
* [LV] Remove obsolete comment (NFC)Matthew Simpson2016-10-051-3/+1
| | | | llvm-svn: 283365
* [LV] Use getScalarizationOverhead in memory instruction costs (NFC)Matthew Simpson2016-10-051-14/+10
| | | | | | | | | This patch refactors the cost estimation of scalarized loads and stores to reuse getScalarizationOverhead for the cost of the extractelement and insertelement instructions we might create. The existing code accounted for this cost, but it was functionally equivalent to the helper function. llvm-svn: 283364
* fix documentation comments; NFCSanjay Patel2016-10-052-46/+6
| | | | llvm-svn: 283361
* Allow the caller to pass in the hash.Rafael Espindola2016-10-052-4/+7
| | | | | | | If the caller already has the hash we don't have to compute it. This will be used in lld. llvm-svn: 283359
* Improve DEBUG_VALUE assembly comments for spilled bitpiecesReid Kleckner2016-10-052-7/+91
| | | | | | | | Previously we would give up when we saw the bitpiece DWARF expression and print "[complex expression]" when actually we handled bitpiece expressions outside the loop. llvm-svn: 283355
* [LV] Add helper function for predicated block probability (NFC)Matthew Simpson2016-10-051-13/+25
| | | | | | | | | | | | The cost model has to estimate the probability of executing predicated blocks. However, we currently always assume predicated blocks have a 50% chance of executing (this value is hardcoded in several places throughout the code). Since we always use the same value, this patch adds a helper function for getting this uniform probability. The function simplifies some comments and makes our assumptions more clear. In the future, we may want to extend this with actual block probability information if it's available. llvm-svn: 283354
* [mips][ias] fix li macro when values are negated with ~Simon Dardis2016-10-054-8/+44
| | | | | | | | | | | | | | | The integrated assembler evaluates the expressions such as ~0x80000000 to 0xffffffff7fffffff early in the parsing process. This patch adds compatibility with gas so that li loads the expected value (0x7fffffff) in those cases. This only occurs iff all the upper 32bits are set and maintains existing checks by not truncating the result down to 32 bits if any of the the upper bits are not set. Reviewers: dsanders, zoran.jovanovic Differential Review: https://reviews.llvm.org/D23399 llvm-svn: 283353
* [LV] Add isScalarWithPredication helper function (NFC)Matthew Simpson2016-10-051-11/+23
| | | | | | | | | This patch adds a single helper function for checking if an instruction will be scalarized with predication. Such instructions include conditional stores and instructions that may divide by zero. Existing checks have been updated to use the new function. llvm-svn: 283350
* Revert "[asan] LLVM: Switch to using dynamic shadow offset on iOS"Anna Zaks2016-10-051-3/+2
| | | | | | | | This reverts commit abe77a118615cd90b0d7f127e4797096afa2b394. Revert as these changes broke a Chromium buildbot. llvm-svn: 283348
* [DAG] Teach computeKnownBits and ComputeNumSignBits in SelectionDAG to look ↵Bjorn Pettersson2016-10-054-3/+57
| | | | | | | | | | | | | | | | | through EXTRACT_VECTOR_ELT. Summary: Both computeKnownBits and ComputeNumSignBits can now do a simple look-through of EXTRACT_VECTOR_ELT. It will compute the result based on the known bits (or known sign bits) for the vector that the element is extracted from. Reviewers: bogner, tstellarAMD, mkuper Subscribers: wdng, RKSimon, jyknight, llvm-commits, nhaehnle Differential Revision: https://reviews.llvm.org/D25007 llvm-svn: 283347
* Test commit permission. NFCBjorn Pettersson2016-10-051-1/+1
| | | | llvm-svn: 283346
* Fix build due to comparison of std::pairs.Zachary Turner2016-10-051-16/+20
| | | | llvm-svn: 283342
OpenPOWER on IntegriCloud