summaryrefslogtreecommitdiffstats
path: root/llvm/test
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] Reapply: Use __rt_div functions for divrem on WindowsMartin Storsjo2016-10-072-35/+23
| | | | | | | | | | | | | | | | | | | | | | | | Reapplying r283383 after revert in r283442. The additional fix is a getting rid of a stray space in a function name, in the refactoring part of the commit. 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/D25332 llvm-svn: 283550
* [ARM]: Add Cortex-R52 target to LLVMJaved Absar2016-10-071-0/+34
| | | | | | | This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. Cortex-R52 implements the ARMv8-R architecture. llvm-svn: 283542
* [X86][SSE] Update register class during MOVSD/MOVSS - BLENDPD/BLENDPS ↵Simon Pilgrim2016-10-071-0/+57
| | | | | | | | | | | | | | commutation MOVSD/MOVSS take a 128-bit register and a FR32/FR64 register input, the commutation code wasn't taking this into account leading to verification errors. This patch inserts a vreg copy mi to ensure that the registers are correct. Fix for PR30607 Differential Revision: https://reviews.llvm.org/D25280 llvm-svn: 283539
* [SLPVectorizer] Fix for PR25748: reduction vectorization after loopAlexey Bataev2016-10-072-14/+62
| | | | | | | | | | | | | | | | | | | | unrolling. The next code is not vectorized by the SLPVectorizer: ``` int test(unsigned int *p) { int sum = 0; for (int i = 0; i < 8; i++) sum += p[i]; return sum; } ``` During optimization this loop is fully unrolled and SLPVectorizer is unable to vectorize it. Patch tries to fix this problem. Differential Revision: https://reviews.llvm.org/D24796 llvm-svn: 283535
* [ARM] Don't convert switches to lookup tables of pointers with ROPI/RWPIOliver Stannard2016-10-071-0/+132
| | | | | | | | | | | | With the ROPI and RWPI relocation models we can't always have pointers to global data or functions in constant data, so don't try to convert switches into lookup tables if any value in the lookup table would require a relocation. We can still safely emit lookup tables of other values, such as simple constants. Differential Revision: https://reviews.llvm.org/D24462 llvm-svn: 283530
* AMDGPU: Fix use-after-free in SIOptimizeExecMaskingNicolai Haehnle2016-10-071-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was a bug with sequences like s_mov_b64 s[0:1], exec s_and_b64 s[2:3]<def>, s[0:1], s[2:3]<kill> ... s_mov_b64_term exec, s[2:3] because s[2:3] was defined and used in the same instruction, ending up with SaveExecInst inside OtherUseInsts. Note that the test case also exposes an unrelated bug. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98028 Reviewers: tstellarAMD, arsenm Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye Differential Revision: https://reviews.llvm.org/D25306 llvm-svn: 283528
* AMDGPU: Change check prefix in testMatt Arsenault2016-10-071-247/+247
| | | | llvm-svn: 283521
* [llvm-opt-report] Left justify unrolling counts, etc.Hal Finkel2016-10-073-0/+66
| | | | | | | | | | In the left part of the reports, we have things like U<number>; if some of these numbers use more digits than others, we don't want a space in between the U and the start of the number. Instead, the space should come afterward. This way it is clear that the number goes with the U and not any other optimization indicator that might come later on the line. llvm-svn: 283518
* [SimplifyCFG] Correctly test for unconditional branches in GetCaseResultsDavid Majnemer2016-10-071-0/+60
| | | | | | | | | | | GetCaseResults assumed that a terminator with one successor was an unconditional branch. This is not necessarily the case, it could be a cleanupret. Strengthen the check by querying whether or not the terminator is exceptional. llvm-svn: 283517
* [llvm-opt-report] Use -no-demangle to disable demanglingHal Finkel2016-10-071-0/+22
| | | | | | | As this is intended to be a user-facing option, -no-demangle seems much better than -demangle=0. Add testing for the option. llvm-svn: 283516
* [LV] Remove triples from target-independent vectorizer tests. NFC.Michael Kuperstein2016-10-0668-68/+0
| | | | | | | | | Vectorizer tests in the target-independent directory should not have a target triple. If a test really needs to query a specific backend, it belongs in the right target subdirectory (which "REQUIRES" the right backend). Otherwise, it should not specify a triple. llvm-svn: 283512
* [WebAssemby] Implement block signatures.Dan Gohman2016-10-063-116/+118
| | | | | | | | | Per spec changes, this implements block signatures, and adds just enough logic to produce correct block signatures at the ends of functions. Differential Revision: https://reviews.llvm.org/D25144 llvm-svn: 283503
* [WebAssembly] Remove loop's bottom label.Dan Gohman2016-10-061-17/+31
| | | | | | | | Per spec changes, loop constructs no longer have a bottom label. https://reviews.llvm.org/D25118 llvm-svn: 283502
* [WebAssembly] Remove the output operand from stores.Dan Gohman2016-10-0615-139/+139
| | | | | | | | | Per spec changes, store instructions in WebAssembly no longer have a return value. Update the instruction descriptions. Differential Revision: https://reviews.llvm.org/D25122 llvm-svn: 283501
* Preserve the debug location when CodeGenPrepare sinks a compare instruction ↵Wolfgang Pieb2016-10-061-0/+46
| | | | | | | | | | | | into the basic block of a user. Patch by Andrea DiBiagio. Differential Revision: https://reviews.llvm.org/D24632 llvm-svn: 283500
* Handle *_EXTEND_VECTOR_INREG during Integer LegalizationPirama Arumuga Nainar2016-10-061-0/+137
| | | | | | | | | | | | | | | | Summary: These nodes need legalization for 3-element vectors. This commit handles the legalization and adds tests for zext and sext. This fixes PR30614. Reviewers: RKSimon, srhines Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25268 llvm-svn: 283496
* [PGO] Create weak alias for the renamed Comdat functionRong Xu2016-10-061-0/+6
| | | | | | | | | | Add a weak alias to the renamed Comdat function in IR level instrumentation, using it's original name. This ensures the same behavior w/ and w/o IR instrumentation, even for non standard conforming code. Differential Revision: http://reviews.llvm.org/D25339 llvm-svn: 283490
* [X86] Preserve BasePtr for LEA64_32rMichael Kuperstein2016-10-061-0/+44
| | | | | | | | | | | | When replacing FrameIndex with BasePtr, we must preserve BasePtr for LEA64_32r since BasePtr is used later for stack adjustment if it is the same as StackPtr. Patch by H.J Lu <hjl.tools@gmail.com> Differential Revision: https://reviews.llvm.org/D23575 llvm-svn: 283486
* [X86][SSE] Add f16/f80/f128 vector sitofp test casesSimon Pilgrim2016-10-061-0/+206
| | | | | | As discussed on D23808 llvm-svn: 283485
* [DAG] Generalize build_vector -> vector_shuffle combine for more than 2 inputsMichael Kuperstein2016-10-064-1025/+691
| | | | | | | | | | | | | | | | This generalizes the build_vector -> vector_shuffle combine to support any number of inputs. The idea is to create a binary tree of shuffles, where the first layer performs pairwise shuffles of the input vectors placing each input element into the correct lane, and the rest of the tree blends these shuffles together. This doesn't try to be smart and create any sort of "optimal" shuffles. The assumption is that even a "poor" shuffle sequence is better than extracting and inserting the elements one by one. Differential Revision: https://reviews.llvm.org/D24683 llvm-svn: 283480
* Revert "Add -strip-nonlinetable-debuginfo capability"Michael Ilseman2016-10-066-183/+5
| | | | | | | | This reverts commit r283473. Reverted until review is completed. llvm-svn: 283478
* Add -strip-nonlinetable-debuginfo capabilityMichael Ilseman2016-10-066-5/+183
| | | | | | | | | | | | | | | | | | | | | | This adds a new function to DebugInfo.cpp that takes an llvm::Module as input and removes all debug info metadata that is not directly needed for line tables, thus effectively stripping all type and variable information from the module. The primary motivation for this feature was the bitcode work flow (cf. http://lists.llvm.org/pipermail/llvm-dev/2016-June/100643.html for more background). This is not wired up yet, but will be in subsequent patches. For testing, the new functionality is exposed to opt with a -strip-nonlinetable-debuginfo option. The secondary use-case (and one that works right now!) is as a reduction pass in bugpoint. I added two new bugpoint options (-disable-strip-debuginfo and -disable-strip-debug-types) to control the new features. By default it will first attempt to remove all debug information, then only the type info, and then proceed to hack at any remaining MDNodes. llvm-svn: 283473
* BranchRelaxation: Support expanding unconditional branchesMatt Arsenault2016-10-064-13/+737
| | | | | | | AMDGPU needs to expand unconditional branches in a new block with an indirect branch. llvm-svn: 283464
* [Hexagon] Avoid replacing full regs with subregisters in tied operandsKrzysztof Parzyszek2016-10-061-0/+23
| | | | | | Doing so will result in the two-address pass generating incorrect code. llvm-svn: 283463
* BranchRelaxation: Account for function alignmentMatt Arsenault2016-10-061-0/+29
| | | | llvm-svn: 283462
* Move AArch64BranchRelaxation to generic codeMatt Arsenault2016-10-063-3/+3
| | | | llvm-svn: 283459
* [X86] Fix intel syntax push parsing bugNirav Dave2016-10-061-0/+23
| | | | | | | | | | | | | | | Change erroneous parsing of push immediate instructions in intel syntax to default to pointer size by rewriting into the ATT style for matching. This fixes PR22028. Reviewers: majnemer, rnk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D25288 llvm-svn: 283457
* Centralize sh_entsize checking.Rafael Espindola2016-10-061-1/+1
| | | | llvm-svn: 283455
* Refactor to use getSectionContentsAsArray.Rafael Espindola2016-10-061-2/+2
| | | | | | This centralizes quite a bit of error checking. llvm-svn: 283454
* [AMDGPU] Disassembler: print label names in branch instructionsSam Kolton2016-10-061-3/+3
| | | | | | | | | | | | | Summary: Add AMDGPUSymbolizer for finding names for labels from ELF symbol table. Initialize MCObjectFileInfo with some default values. Reviewers: vpykhtin, artem.tamazov, tstellarAMD Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye Differential Revision: https://reviews.llvm.org/D24802 llvm-svn: 283450
* [llvm-opt-report] Record VF, etc. correctly for multiple opts on one lineHal Finkel2016-10-063-0/+98
| | | | | | | When there are multiple optimizations on one line, record the vectorization factors, etc. correctly (instead of incorrectly substituting default values). llvm-svn: 283443
* Revert "[ARM] Use __rt_div functions for divrem on Windows"Diana Picus2016-10-062-23/+35
| | | | | | | | | | This reverts commit r283383 because it broke some of the bots: undefined reference to ` __aeabi_uldivmod' It affected (at least) clang-cmake-armv7-a15-selfhost, clang-cmake-armv7-a15-selfhost and clang-native-arm-lnt. llvm-svn: 283442
* [llvm-opt-report] Print line numbers starting from 1Hal Finkel2016-10-064-184/+184
| | | | | | Line numbers should start from 1, not 2. llvm-svn: 283440
* Add test-cases which demontrate pr30561Zvi Rackover2016-10-061-0/+26
| | | | llvm-svn: 283436
* [ValueTracking] Teach computeKnownBits and ComputeNumSignBits to look ↵Bjorn Pettersson2016-10-061-0/+28
| | | | | | | | | | | | | | | 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
* [ARM] Constant pool promotion - fix alignment calculationJames Molloy2016-10-061-0/+10
| | | | | | | | | 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
* [AMDGPU] Promote uniform i16 bitreverse intrinsic to i32Konstantin Zhuravlyov2016-10-061-416/+600
| | | | | | Differential Revision: https://reviews.llvm.org/D25121 llvm-svn: 283415
* [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
* Fix tests for WindowsHal Finkel2016-10-054-10/+10
| | | | | | We need to match file names with both forward and backward slashes. llvm-svn: 283407
* [codeview] Truncate records to maximum record size near 64KBReid Kleckner2016-10-051-0/+43
| | | | | | | | | | | | 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-059-0/+495
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-053-77/+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. 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-052-41/+77
| | | | | | 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-055-0/+364
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [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
* Verifier: Reject any unknown named MD nodes in the llvm.dbg namespace.Adrian Prantl2016-10-052-77/+41
| | | | | | | | | | | 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
* [codeview] Translate bitpiece metadata to DEFRANGE_SUBFIELD* recordsReid Kleckner2016-10-051-0/+429
| | | | | | | | | | | | | 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
* [ARM] Use __rt_div functions for divrem on WindowsMartin Storsjo2016-10-052-35/+23
| | | | | | | | | | | | | | | | | | | | 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-051-4/+2
| | | | | | | This is what the instruction-set actually provides, and the default expansions of the others into the lohi opcodes are good. llvm-svn: 283381
OpenPOWER on IntegriCloud