summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add trap instructions for ARM and MIPS.Rui Ueyama2017-06-2611-133/+131
| | | | | | | This patch fills holes in executable sections with 0xd4 (ARM) or 0xef (MIPS). These trap instructions were suggested by Theo de Raadt. llvm-svn: 306322
* When preprocessing with -frewrite-imports and -fmodule-file=, do not pass allRichard Smith2017-06-266-16/+40
| | | | | | | | | | | modules to preprocessing of nested .pcm files. Making those module files available results in loading more .pcm files than necessary, and potentially in misbehavior if a module makes itself visible during its own compilation (as parts of that module that have not yet been processed would then become visible). llvm-svn: 306320
* Only use libdl when it is availableDimitry Andric2017-06-261-1/+1
| | | | | | | | | | | | | | | | Summary: On BSDs, there is no `libdl.so`, and functions like `dlopen` are implemented in the main C library instead. Use the `CMAKE_DL_LIBS` variable instead of hardcoding a dependency on the `dl` library. Reviewers: grokos, joerg, emaste Reviewed By: emaste Subscribers: jlpeyton, mgorny, openmp-commits Differential Revision: https://reviews.llvm.org/D34632 llvm-svn: 306319
* AArch64: remove all kill flags when extending register liveness.Tim Northover2017-06-262-1/+26
| | | | | | | | | | | | When we forward a stored value to a load and eliminate it entirely we need to make sure the liveness of the register is maintained all the way to its use. Previously we only cleared liveness on the store doing the forwarding, but there could be other killing uses in between. We already do the right thing when the load has to be converted into something else, it was just this one path that skipped it. llvm-svn: 306318
* [Sema] Fix a crash-on-invalid when a template parameter list has a classAkira Hatanaka2017-06-2610-13/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | definition or non-reference class type. The crash occurs when there is a template parameter list in a class that is missing the closing angle bracket followed by a definition of a struct. For example: class C0 { public: template<typename T, typename T1 = T // missing closing angle bracket struct S0 {}; C0() : m(new S0<int>) {} S0<int> *m; }; This happens because the parsed struct is added to the scope of the enclosing class without having its access specifier set, which results in an assertion failure in SemaAccess.cpp later. This commit fixes the crash by adding the parsed struct to the enclosing file scope and marking structs as invalid if they are defined in template parameter lists. rdar://problem/31783961 rdar://problem/19570630 Differential Revision: https://reviews.llvm.org/D33606 llvm-svn: 306317
* Tweak to match change in LLVM API, in r306315.Paul Robinson2017-06-261-2/+2
| | | | llvm-svn: 306316
* [DWARF] NFC: Collect info used by DWARFFormValue into a helper.Paul Robinson2017-06-2611-255/+208
| | | | | | | | | | | Some forms have sizes that depend on the DWARF version, DWARF format (32/64-bit), or the size of an address. Collect these into a struct to simplify passing them around. Require callers to provide one when they query a form's size. Differential Revision: http://reviews.llvm.org/D34570 llvm-svn: 306315
* [X86][SSE] Check SSE2/SSE3 codegen tests on i686 and x86_64Simon Pilgrim2017-06-262-184/+456
| | | | llvm-svn: 306314
* [GVN] Recommit the patch "Add phi-translate support in scalarpre".Wei Mi2017-06-265-34/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recommit fixes three bugs: The first one is to use CurrentBlock instead of PREInstr's Parent as param of performScalarPREInsertion because the Parent of a clone instruction may be uninitialized. The second one is stop PRE when CurrentBlock to its predecessor is a backedge and an operand of CurInst is defined inside of CurrentBlock. The same value defined inside of loop in last iteration can not be regarded as available. The third one is an out-of-bound array access in a flipped if guard. Right now scalarpre doesn't have phi-translate support, so it will miss some simple pre opportunities. Like the following testcase, current scalarpre cannot recognize the last "a * b" is fully redundent because a and b used by the last "a * b" expr are both defined by phis. long a[100], b[100], g1, g2, g3; __attribute__((pure)) long goo(); void foo(long a, long b, long c, long d) { g1 = a * b; if (__builtin_expect(g2 > 3, 0)) { a = c; b = d; g2 = a * b; } g3 = a * b; // fully redundant. } The patch adds phi-translate support in scalarpre. This is only a temporary solution before the newpre based on newgvn is available. llvm-svn: 306313
* AMDGPU: Setup SP/FP in callee function prolog/epilogMatt Arsenault2017-06-265-5/+110
| | | | llvm-svn: 306312
* Replace trivial use of external rc.exe by writing our own .res file.Eric Beckmann2017-06-268-78/+145
| | | | | | | | | This patch removes the dependency on the external rc.exe tool by writing a simple .res file using our own library. In this patch I also added an explicit definition for the .res file magic. Furthermore, I added a unittest for embeded manifests and fixed a bug exposed by the test. llvm-svn: 306311
* [libcxx] Annotate c++17 aligned new/delete operators with availabilityAkira Hatanaka2017-06-263-10/+52
| | | | | | | | | | | | | | | | | | | | | | | attribute. This is needed because older versions of libc++ do not have these operators. If users target an older deployment target and try to compile programs in which these operators are explicitly called, the compiler will complain. The following is the list of minimum deployment targets for the four OSes: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34556 llvm-svn: 306310
* [llvm-pdbutil] Add a mode to `bytes` for dumping split debug chunks.Zachary Turner2017-06-265-43/+112
| | | | llvm-svn: 306309
* Move `assert` upwards so that it fails early if it fails.Rui Ueyama2017-06-261-1/+2
| | | | llvm-svn: 306308
* Remove confusing `return`.Rui Ueyama2017-06-261-1/+1
| | | | | | | `addInputSec` returns void. Even though it is syntactically correct, the use of `return` here is just confusing. llvm-svn: 306307
* [opt-viewer] Python 3 support in opt-stats.pyBrian Gesiak2017-06-262-4/+22
| | | | | | | | | | | | | | Summary: Minor changes that allow opt-stats.py to support both Python 2 and 3. Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: llvm-commits, fhahn Differential Revision: https://reviews.llvm.org/D34564 llvm-svn: 306306
* [SystemZ] Fix missing emergency spill slot corner caseUlrich Weigand2017-06-262-2/+91
| | | | | | | | | | | | | | | | We sometimes need emergency spill slots for the register scavenger. This may be the case when code needs to access a stack slot that has an offset of 4096 or more relative to the stack pointer. To make that determination, processFunctionBeforeFrameFinalized currently simply checks the total stack frame size of the current function. But this is not enough, since code may need to access stack slots in the caller's stack frame as well, in particular incoming arguments stored on the stack. This commit fixes the problem by taking argument slots into account. llvm-svn: 306305
* [COFF] Fix SECREL and SECTION relocations against common symbolsReid Kleckner2017-06-263-0/+51
| | | | | | | | | | | | | | Summary: They do the obvious thing: provide the section index of .bss and the offset of the symbol in .bss. Reviewers: ruiu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34628 llvm-svn: 306304
* Add .yaml as an lld test suffixReid Kleckner2017-06-263-4/+4
| | | | | | | | | | | | Over time we've started to add inputs and test cases using the .yaml extension, which seems to be preferred over the .objtxt extension that we were using initially. One nice thing about using .yaml is that it triggers existing editor highlighting and formatting support. Fix two pdb*.yaml test cases that I added that weren't being run as part of check-lld. llvm-svn: 306303
* [X86][SSE] Add combine tests for PMULDQ/PMULUDQSimon Pilgrim2017-06-261-0/+110
| | | | | | Found several missed optimizations while investigating replacing _mm_mul_epi32/_mm_mul_epu32 with generic implementations llvm-svn: 306302
* [inline asm] dot operator while using imm generates wrong ir + asm - clang partMarina Yatsina2017-06-261-0/+6
| | | | | | | | | | | | | | | | | | Inline asm dot operator while using imm generates wrong ir and asm This is the test for the llvm changes committed in revision 306300 This also fixes bugzilla 32987: https://bugs.llvm.org//show_bug.cgi?id=32987 The llvm part of the review that contains the test can be found here: https://reviews.llvm.org/D33039 commit on behald of zizhar Differential Revision: https://reviews.llvm.org/D33040 llvm-svn: 306301
* [inline asm] dot operator while using imm generates wrong ir + asm - llvm partMarina Yatsina2017-06-261-2/+1
| | | | | | | | | | | | | | | | | Inline asm dot operator while using imm generates wrong ir and asm This also fixes bugzilla 32987: https://bugs.llvm.org//show_bug.cgi?id=32987 The clang part of the review that contains the test can be found here: https://reviews.llvm.org/D33040 commit on behald of zizhar Differential Revision: https://reviews.llvm.org/D33039 llvm-svn: 306300
* [X86][AVX-512] Don't raise inexact in ceil, floor, round, trunc.Ahmed Bougacha2017-06-262-20/+20
| | | | | | | | | | | | The non-AVX-512 behavior was changed in r248266 to match N1778 (C bindings for IEEE-754 (2008)), which defined the four functions to not raise the inexact exception ("rint" is still defined as raising it). Update the AVX-512 lowering of these functions to match that: it should not be different. llvm-svn: 306299
* AMDGPU/GlobalISel: Mark 32-bit G_SHL as legalTom Stellard2017-06-262-0/+20
| | | | | | | | | | | | Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D34589 llvm-svn: 306298
* [inline asm][gcc-compatiblity] "=i" output constraint supportMarina Yatsina2017-06-262-0/+40
| | | | | | | | Ignore ‘i’,’n’,’E’,’F’ as output constraints in inline assembly (gcc compatibility) Differential Revision: https://reviews.llvm.org/D31383 llvm-svn: 306297
* [X86] Add test case for PR15981Simon Pilgrim2017-06-261-0/+59
| | | | llvm-svn: 306296
* Remove a stale comment.Rui Ueyama2017-06-261-2/+0
| | | | llvm-svn: 306295
* [llvm-stress] Add getRandom() helper that was going to be part of D34157. NFCI.Simon Pilgrim2017-06-261-27/+32
| | | | llvm-svn: 306294
* [COFF] Improve synthetic symbol handlingReid Kleckner2017-06-268-37/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The main change is that we can have SECREL and SECTION relocations against ___safe_se_handler_table, which is important for handling the debug info in the MSVCRT. Previously we were using DefinedRelative for __safe_se_handler_table and __ImageBase, and after we implement CFGuard, we plan to extend it to handle __guard_fids_table, __guard_longjmp_table, and more. However, DefinedRelative is really only suitable for implementing __ImageBase, because it lacks a Chunk, which you need in order to figure out the output section index and output section offset when resolving SECREl and SECTION relocations. This change renames DefinedRelative to DefinedSynthetic and gives it a Chunk. One wart is that __ImageBase doesn't have a chunk. It points to the PE header, effectively. We could split DefinedRelative and DefinedSynthetic if we think that's cleaner and creates fewer special cases. I also added safeseh.s, which checks that we don't emit a safe seh table entries pointing to garbage collected handlers and that we don't emit a table at all when there are no handlers. Reviewers: ruiu Reviewed By: ruiu Subscribers: inglorion, pcc, llvm-commits, aprantl Differential Revision: https://reviews.llvm.org/D34577 llvm-svn: 306293
* Add GlobalOffsetTable to ElfSym. NFC.Rui Ueyama2017-06-263-8/+13
| | | | | | | | Most "reserved" symbols are in ElfSym and it looks like there's no reason to not do the same thing for _GLOBAL_OFFSET_TABLE_. This should help https://reviews.llvm.org/D34618 too. llvm-svn: 306292
* Improve const-correctness.Axel Naumann2017-06-261-2/+2
| | | | llvm-svn: 306291
* [PPCGCodeGeneration] Add flag to allow polly to fail in GPU kernel fails.Siddharth Bhat2017-06-262-0/+62
| | | | | | - This is useful for debugging GPU code. llvm-svn: 306290
* [x86] transform vector inc/dec to use -1 constant (PR33483)Sanjay Patel2017-06-2621-1605/+1746
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert vector increment or decrement to sub/add with an all-ones constant: add X, <1, 1...> --> sub X, <-1, -1...> sub X, <1, 1...> --> add X, <-1, -1...> The all-ones vector constant can be materialized using a pcmpeq instruction that is commonly recognized as an idiom (has no register dependency), so that's better than loading a splat 1 constant. AVX512 uses 'vpternlogd' for 512-bit vectors because there is apparently no better way to produce 512 one-bits. The general advantages of this lowering are: 1. pcmpeq has lower latency than a memop on every uarch I looked at in Agner's tables, so in theory, this could be better for perf, but... 2. That seems unlikely to affect any OOO implementation, and I can't measure any real perf difference from this transform on Haswell or Jaguar, but... 3. It doesn't look like it from the diffs, but this is an overall size win because we eliminate 16 - 64 constant bytes in the case of a vector load. If we're broadcasting a scalar load (which might itself be a bug), then we're replacing a scalar constant load + broadcast with a single cheap op, so that should always be smaller/better too. 4. This makes the DAG/isel output more consistent - we use pcmpeq already for padd x, -1 and psub x, -1, so we should use that form for +1 too because we can. If there's some reason to favor a constant load on some CPU, let's make the reverse transform for all of these cases (either here in the DAG or in a later machine pass). This should fix: https://bugs.llvm.org/show_bug.cgi?id=33483 Differential Revision: https://reviews.llvm.org/D34336 llvm-svn: 306289
* [Hexagon] Handle cases when the aligned stack pointer is missingKrzysztof Parzyszek2017-06-264-9/+100
| | | | llvm-svn: 306288
* [SystemZ] Add a check against zero before calling getTestUnderMaskCond()Jonas Paulsson2017-06-262-0/+22
| | | | | | | | | | | | | | Csmith discovered that this function can be called with a zero argument, in which case an assert for this triggered. This patch also adds a guard before the other call to this function since it was missing, although the test only covers the case where it was discovered. Reduced test case attached as CodeGen/SystemZ/int-cmp-54.ll. Review: Ulrich Weigand llvm-svn: 306287
* [X86][LLVM][test]Expanding Supports lowerInterleavedStore() in ↵Michael Zuckerman2017-06-262-0/+76
| | | | | | | | X86InterleavedAccess test. Adding base tast (to trunk) for Store strid=4 vf=32. llvm-svn: 306286
* [llvm-stress] Remove Rand32 helper functionSimon Pilgrim2017-06-261-9/+5
| | | | | | To try and help avoid repeats of PR32585, remove Rand32 which is only called by Rand64 llvm-svn: 306285
* [PPCGCodeGeneration] Allow intrinsics within kernels.Siddharth Bhat2017-06-262-20/+191
| | | | | | | | | | | | | | | | | | | - In D33414, if any function call was found within a kernel, we would bail out. - This is an over-approximation. This patch changes this by allowing the `llvm.sqrt.*` family of intrinsics. - This introduces an additional step when creating a separate llvm::Module for a kernel (GPUModule). We now copy function declarations from the original module to new module. - We also populate IslNodeBuilder::ValueMap so it replaces the function references to the old module to the ones in the new module (GPUModule). Differential Revision: https://reviews.llvm.org/D34145 llvm-svn: 306284
* [NFC] Return both polly.start and polly.exiting from executeScopConditionally.Andreas Simbuerger2017-06-264-10/+15
| | | | | | | | | | | | | | This commit returns both the start and the exit block that are created by executeScopConditionally. In a future commit we will make use of the exit block. Before we would have to use the implicit property that there won't be any code generated between polly.start and polly.exiting at the time of use to find the correct block ('polly.exiting'). All usage location are semantically unchanged. llvm-svn: 306283
* [ELF] Define _GLOBAL_OFFSET_TABLE_ symbol relative to .gotPeter Smith2017-06-2613-27/+197
| | | | | | | | | | | | | | | | | | On many architectures gcc and clang will recognize _GLOBAL_OFFSET_TABLE_ - . and produce a relocation that can be processed without needing to know the value of _GLOBAL_OFFSET_TABLE_. This is not always the case; for example ARM gcc produces R_ARM_BASE_PREL but clang produces the more general R_ARM_REL32 to _GLOBAL_OFFSET_TABLE_. To evaluate this relocation correctly _GLOBAL_OFFSET_TABLE_ must be defined to be the either the base of the GOT or end of the GOT dependent on architecture.. If/when llvm-mc is changed to recognize _GLOBAL_OFFSET_TABLE_ - . this change will not be necessary for new objects. However there may still be old objects and versions of clang. Differential Revision: https://reviews.llvm.org/D34355 llvm-svn: 306282
* [llvm-stress] Ensure that the C++11 random device respects its min/max ↵Simon Pilgrim2017-06-261-2/+6
| | | | | | | | | | | | values (PR32585) As noted on PR32585, the change in D29780/rL295325 resulted in calls to Rand32() (values 0 -> 0xFFFFFFFF) but the min()/max() operators indicated it would be (0 -> 0x7FFFF). This patch changes the random operator to call Rand() instead which does respect the 0 -> 0x7FFFF range and asserts that the value is in range as well. Differential Revision: https://reviews.llvm.org/D34089 llvm-svn: 306281
* [mips] Enable IAS by default for Android 64-bit MIPS target (N64)Petar Jovanovic2017-06-261-3/+5
| | | | | | | | | IAS is already used for MIPS64 in majority of Android projects. Android MIPS64 uses N64 ABI. Set IAS as a default now. Differential Revision: https://reviews.llvm.org/D34514 llvm-svn: 306280
* [IfConversion] Hoist removeBranch calls out of if/else clauses [NFC]Mikael Holmen2017-06-261-4/+9
| | | | | | | | | | | | | | | | | Summary: Also added a comment. Pulled out of https://reviews.llvm.org/D34099. Reviewers: iteratee Reviewed By: iteratee Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34388 llvm-svn: 306279
* Shorten sanitizer plugin namesPavel Labath2017-06-2611-18/+18
| | | | | | | | | | | | | | | | | | | | | | | Summary: The new UndefinedBehaviorSanitizer plugin was breaking file path length limits, because it's (fairly long name) appears multiple times in the path. Cmake ends up putting the object file at path tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj which is 191 characters long and very dangerously close to the 260 character path limit on windows systems (also, just the include line for that file was breaking the 80 character line limit). This renames the sanitizer plugins to use shorter names (asan, ubsan, tsan). I think this will still be quite understandable to everyone as those are the names everyone uses to refer to them anyway. Reviewers: zturner, kubamracek, jingham Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D34553 llvm-svn: 306278
* [IR] Rename BinaryOperator::init to AssertOK and remove argument. Replace ↵Craig Topper2017-06-262-8/+7
| | | | | | | | default case in switch with llvm_unreachable since all valid opcodes are covered. This method doesn't do any initializing. It just contains asserts. So renaming to AssertOK makes it consistent with similar instructions in other Instruction classes. llvm-svn: 306277
* This reverts commit r306272.Serguei Katkov2017-06-263-83/+4
| | | | | | | | Revert "[MBP] do not rotate loop if it creates extra branch" It breaks the sanitizer build bots. Need to fix this. llvm-svn: 306276
* [bugpoint] Do not initialize disassembler passesTobias Grosser2017-06-261-1/+0
| | | | | | | | | | | We added the initilization of disassembler passes in r306208 with the goal to bring bugpoint in line with 'opt'. However, 'opt' does itself not initialize dissassembler passes. As our goal was consistency, we drop the initialization of dissassembler passes again from bugpoint. Thanks to Chandler for pointing this out! llvm-svn: 306275
* fix trivial typo in comment, NFCHiroshi Inoue2017-06-261-1/+1
| | | | llvm-svn: 306274
* [tests] Add forgotten pollyacc REQUIRES lineTobias Grosser2017-06-261-0/+2
| | | | llvm-svn: 306273
* [MBP] do not rotate loop if it creates extra branchSerguei Katkov2017-06-263-4/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a last fix for the corner case of PR32214. Actually this is not really corner case in general. We should not do a loop rotation if we create an additional branch due to it. Consider the case where we have a loop chain H, M, B, C , where H is header with viable fallthrough from pre-header and exit from the loop M - some middle block B - backedge to Header but with exit from the loop also. C - some cold block of the loop. Let's H is determined as a best exit. If we do a loop rotation M, B, C, H we can introduce the extra branch. Let's compute the change in number of branches: +1 branch from pre-header to header -1 branch from header to exit +1 branch from header to middle block if there is such -1 branch from cold bock to header if there is one So if C is not a predecessor of H then we introduce extra branch. This change actually prohibits rotation of the loop if both true 1) Best Exit has next element in chain as successor. 2) Last element in chain is not a predecessor of first element of chain. Reviewers: iteratee, xur Reviewed By: iteratee Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34271 llvm-svn: 306272
OpenPOWER on IntegriCloud