summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [AMDGPU] Merge M0 initializationsStanislav Mekhanoshin2017-04-244-19/+323
| | | | | | | | | | Merges equivalent initializations of M0 and hoists them into a common dominator block. Technically the same code can be used with any register, physical or virtual. Differential Revision: https://reviews.llvm.org/D32279 llvm-svn: 301228
* Handle invariant.group.barrier in BasicAAPiotr Padlewski2017-04-245-13/+56
| | | | | | | | | | | | | | | | | | | | | Summary: llvm.invariant.group.barrier returns pointer that mustalias pointer it takes. It can't be marked with `returned` attribute, because it would be remove easily. The other reason is that only Alias Analysis can know about this, because if any other pass would know it, then the result would be replaced with it's argument, which would be invalid. We can think about returned pointer as something that mustalias, but it doesn't have to be bitwise the same as the argument. Reviewers: dberlin, chandlerc, hfinkel, sanjoy Subscribers: reames, nlewycky, rsmith, anna, amharc Differential Revision: https://reviews.llvm.org/D31585 llvm-svn: 301227
* [asan] Let the frontend disable gc-sections optimization for asan globals.Evgeniy Stepanov2017-04-243-17/+86
| | | | | | Also extend -asan-globals-live-support flag to all binary formats. llvm-svn: 301226
* [asan] Disable ASan global-GC depending on the target and compiler flags.Evgeniy Stepanov2017-04-242-6/+37
| | | | llvm-svn: 301225
* [analyzer] Improve suppression for inlined defensive checks before operator &.Artem Dergachev2017-04-246-6/+118
| | | | | | | | | | | | | | | | | | | Null dereferences are suppressed if the lvalue was constrained to 0 for the first time inside a sub-function that was inlined during analysis, because such constraint is a valid defensive check that does not, by itself, indicate that null pointer case is anyhow special for the caller. If further operations on the lvalue are performed, the symbolic lvalue is collapsed to concrete null pointer, and we need to track where does the null pointer come from. Improve such tracking for lvalue operations involving operator &. rdar://problem/27876009 Differential Revision: https://reviews.llvm.org/D31982 llvm-svn: 301224
* [OpenMP] Initial implementation of code generation for pragma 'distribute ↵Carlo Bertolli2017-04-2411-123/+4706
| | | | | | | | | | | | | | | | | parallel for' on host https://reviews.llvm.org/D29508 This patch makes the following additions: 1. It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation. 2. It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses. It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code. Looking forward to comments. llvm-svn: 301223
* [SimplifyCFG] Fix for non-determinism in codegenMandeep Singh Grang2017-04-241-1/+1
| | | | | | | | | | | | | | Summary: This patch fixes issues in codegen uncovered due to https://reviews.llvm.org/D26718 Reviewers: majnemer, chenli, davide Reviewed By: davide Subscribers: davide, arsenm, llvm-commits Differential Revision: https://reviews.llvm.org/D26726 llvm-svn: 301222
* Move size and alignment information of regclass to TargetRegisterInfoKrzysztof Parzyszek2017-04-2447-232/+296
| | | | | | | | | | | | | | | 1. RegisterClass::getSize() is split into two functions: - TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const; - TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const; 2. RegisterClass::getAlignment() is replaced by: - TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const; This will allow making those values depend on subtarget features in the future. Differential Revision: https://reviews.llvm.org/D31783 llvm-svn: 301221
* Don't test setting sticky bits on files for modern BSDsDimitry Andric2017-04-241-0/+7
| | | | | | | | | | | | | | | | | | | Summary: In rL297945, jhenderson added methods for setting permissions to sys::fs, but some of the unittests that attempt to set sticky bits (01000) on files fail on modern BSDs, such as FreeBSD, NetBSD and OpenBSD. This is because those systems do not allow regular users to set sticky bits on files, only on directories. Fix it by disabling these particular tests on modern BSDs. Reviewers: emaste, brad, jhenderson Reviewed By: jhenderson Subscribers: joerg, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D32120 llvm-svn: 301220
* Don't emit CFI instructions at the end of a functionAdrian Prantl2017-04-245-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | When functions are terminated by unreachable instructions, the last instruction might trigger a CFI instruction to be generated. However, emitting it would be be illegal since the function (and thus the FDE the CFI is in) has already ended with the previous instruction. Darwin's dwarfdump --verify --eh-frame complains about this and the specification supports this. Relevant bits from the DWARF 5 standard (6.4 Call Frame Information): "[The] address_range [field in an FDE]: The number of bytes of program instructions described by this entry." "Row creation instructions: [...] The new location value is always greater than the current one." The first quotation implies that a CFI cannot describe a target address outside of the enclosing FDE's range. rdar://problem/26244988 Differential Revision: https://reviews.llvm.org/D32246 llvm-svn: 301219
* Pragma: Fix DebugOverflowStack() resulting in endless loop.Matthias Braun2017-04-241-3/+3
| | | | | | | | | | Drive-by fix (noticed while working on https://reviews.llvm.org/D32205): DebugOverflowStack() is supposed to provoke a stack overflow, however LLVM was smart enough to use the red-zone and fold the load into a tail jump on x86_64 optimizing this to an endless loop instead of a stack overflow. llvm-svn: 301218
* Updates documentation for a syntax sugar libfuzzer flag,George Karpenkov2017-04-241-3/+9
| | | | | | as implemented in https://reviews.llvm.org/D32193 llvm-svn: 301217
* Remove erroneous driver test for -fsanitize=fuzzer flagGeorge Karpenkov2017-04-241-2/+0
| | | | | | | libfuzzer is not available on all platforms, and hence we can not always rely that it was compiled. llvm-svn: 301216
* CodeGen: Add a hook for getFenceOperandTyYaxun Liu2017-04-245-2/+33
| | | | | | | | | | | | | | Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0. This is fine for most targets. However for amdgcn target, the size of pointer in address space 0 depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is 32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target triple environment. Therefore a hook is need in target lowering for getting the fence operand type. This patch has no effect on targets other than amdgcn. Differential Revision: https://reviews.llvm.org/D32186 llvm-svn: 301215
* Revert "Compute safety information in a much finer granularity."Evgeniy Stepanov2017-04-246-105/+55
| | | | | | Use-after-free in llvm::isGuaranteedToExecute. llvm-svn: 301214
* [InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombineSanjay Patel2017-04-244-66/+66
| | | | | | | | | | | This is a straight cut and paste, but there's a bigger problem: if this fold exists for simplifyOr, there should be a DeMorganized version for simplifyAnd. But more than that, we have a patchwork of ad hoc logic optimizations in InstCombine. There should be some structure to ensure that we're not missing sibling folds across and/or/xor. llvm-svn: 301213
* Flag -fsanitize=fuzzer to enable libfuzzerGeorge Karpenkov2017-04-248-0/+64
| | | | | | | | | | Previously, adding libfuzzer to a project was a multi-step procedure, involving libfuzzer compilation, linking the library, and specifying coverage flags. With this change,libfuzzer can be enabled by adding a single -fsanitize=fuzzer flag instead. llvm-svn: 301212
* X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFCMatthias Braun2017-04-243-34/+24
| | | | | | | | | | | | | | | | | Re-Commit of r300922 and r300923 with less aggressive assert (see discussion at the end of https://reviews.llvm.org/D32205) X86RegisterInfo::eliminateFrameIndex() and X86FrameLowering::getFrameIndexReference() both had logic to compute the base register. This consolidates the code. Also use MachineInstr::isReturn instead of manually enumerating tail call instructions (return instructions were not included in the previous list because they never reference frame indexes). Differential Revision: https://reviews.llvm.org/D32206 llvm-svn: 301211
* Use DW_OP_stack_value when reconstructing variable values with arithmetic.Adrian Prantl2017-04-242-20/+67
| | | | | | | | | | | | | | | When the location description of a source variable involves arithmetic on the value itself, it needs to be marked with DW_OP_stack_value since it is not describing the variable's location, but rather its value. This is a follow-up to r297971 and fixes the source testcase quoted in the comment in debuginfo-dce.ll. rdar://problem/30725338 This reapplies r301093 without modifications. llvm-svn: 301210
* Add a testcase for DIExpression(DW_OP_stack_value)Adrian Prantl2017-04-243-1/+125
| | | | | | | | and relax the assertion that prohibited its emission. This fixes the assertion failure uncovered by r301093. llvm-svn: 301209
* AMDGPU: Add StackPtr and FramePtr registers to MFIMatt Arsenault2017-04-242-0/+26
| | | | | | These will be necessary for setting up call sequences. llvm-svn: 301208
* [ELF] Account for R_386_TLS_LDO_32 addendShoaib Meenai2017-04-242-3/+4
| | | | | | | | | | | | This relocation type has an implicit addend. Account for it when processing the relocation. Add an offset to an existing test to ensure it gets processed correctly. Fixes PR32634. Differential Revision: https://reviews.llvm.org/D32336 llvm-svn: 301207
* AMDGPU: Move trap lowering to DAGMatt Arsenault2017-04-247-62/+89
| | | | | | | | | | | Fixes traps in any block besides the entry block, and fixes depending on a live-in physical register by using a virtual register copy. Also happens to stop emitting a nop in the case debug trap is not supported. llvm-svn: 301206
* [DomPrinter] Add a way to programmatically dump a dot representation.Davide Italiano2017-04-242-0/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D32145 llvm-svn: 301205
* [llvm-pdbdump] Merge functionality of graphical and text dumpers.Zachary Turner2017-04-2414-212/+111
| | | | | | | | | | | | | | The *real* difference between these two was that a) The "graphical" dumper could recurse, while the text one could not. b) The "text" dumper could display nested types and functions, while the graphical one could not. Merge these two so that there is only one dumper that can recurse arbitrarily deep and optionally display nested types or not. llvm-svn: 301204
* [llvm-pdbdump] Re-write the record layout code to be more resilient.Zachary Turner2017-04-2425-450/+451
| | | | | | | | This reworks the way virtual bases are handled, and also the way padding is detected across multiple levels of aggregates, producing a much more accurate result. llvm-svn: 301203
* [Docs] Correct the path to the clang-format-diff.py script to include the ↵Craig Topper2017-04-241-2/+3
| | | | | | clang-format directory. llvm-svn: 301202
* [APInt] Simplify the zext and sext methodsCraig Topper2017-04-241-33/+18
| | | | | | | | | | This replaces a hand written copy loop with a call to memcpy for both zext and sext. For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits. Differential Revision: https://reviews.llvm.org/D32417 llvm-svn: 301201
* Testing commit credentialsGeorge Karpenkov2017-04-241-0/+1
| | | | llvm-svn: 301200
* InstCombine: Fix assert when reassociating fsub with undefMatt Arsenault2017-04-242-0/+49
| | | | | | | | | | | | | There is logic to track the expected number of instructions produced. It thought in this case an instruction would be necessary to negate the result, but here it folded into a ConstantExpr fneg when the non-undef value operand was cancelled out by the second fsub. I'm not sure why we don't fold constant FP ops with undef currently, but I think that would also avoid this problem. llvm-svn: 301199
* [APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ↵Craig Topper2017-04-244-79/+104
| | | | | | | | | | | | ashrInPlace. This patch adds an in place version of ashr to match lshr and shl which were recently added. I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting. Differential Revision: https://reviews.llvm.org/D32415 llvm-svn: 301198
* AMDGPU: Move v_readlane lane select from VGPR to SGPRNicolai Haehnle2017-04-243-0/+32
| | | | | | | | | | | | | | | | | Summary: Fix a compiler bug when the lane select happens to end up in a VGPR. Clarify the semantic of the corresponding intrinsic to be that of the corresponding GLSL: the lane select must be uniform across a wave front, otherwise results are undefined. Reviewers: arsenm Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D32343 llvm-svn: 301197
* Compute safety information in a much finer granularity.Xin Tong2017-04-246-55/+105
| | | | | | | | | | | | | | | | | | | Summary: Instead of keeping a variable indicating whether there are early exits in the loop. We keep all the early exits. This improves LICM's ability to move instructions out of the loop based on is-guaranteed-to-execute. I am going to update compilation time as well soon. Reviewers: hfinkel, sanjoy, efriedma, mkuper Reviewed By: hfinkel Subscribers: llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D32433 llvm-svn: 301196
* InstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}Nicolai Haehnle2017-04-242-4/+24
| | | | | | | | | | | | | | | | | | Summary: The return value of these intrinsics should always have 0 bits for inactive threads. This means that when all arguments are constant and the comparison evaluates to true, the intrinsic should return the current exec mask. Fixes some GL_ARB_shader_ballot tests. Reviewers: arsenm Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D32344 llvm-svn: 301195
* [GlobalISel][X86] Lower FormalArgument/Ret using ↵Igor Breger2017-04-245-48/+156
| | | | | | | | | | | | | | | | G_MERGE_VALUES/G_UNMERGE_VALUES. Summary: [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES. Reviewers: zvi, t.p.northover, guyblank Reviewed By: t.p.northover Subscribers: dberris, rovka, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D32288 llvm-svn: 301194
* [DAGCombiner] Updated bswap byte offset variable names to be more ↵Simon Pilgrim2017-04-241-13/+15
| | | | | | | | descriptive. NFC As discussed on D32039, use MaskByteOffset to describe the variable and also pull out repeated getOpcode() calls. llvm-svn: 301193
* [APInt] Fix repeated word in comments. NFCCraig Topper2017-04-241-2/+2
| | | | llvm-svn: 301192
* AMDGPU: Fix crash when scheduling non-memory SMRD instructionsNicolai Haehnle2017-04-242-0/+19
| | | | | | | | | | | | Summary: Fixes piglit spec/arb_shader_clock/execution/* Reviewers: arsenm Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D32345 llvm-svn: 301191
* [tsan] Include __tsan_external_* API from a header file instead of declaring ↵Kuba Mracek2017-04-244-26/+9
| | | | | | | | them manually. NFC. Differential Revision: https://reviews.llvm.org/D32384 llvm-svn: 301190
* [tsan] Remove the extra word "object" from description of external racesKuba Mracek2017-04-242-8/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D32383 llvm-svn: 301189
* [clang-tidy] Some Cleanups for performance-faster-string-find check.Haojian Wu2017-04-241-22/+12
| | | | | | NFC llvm-svn: 301188
* [SDAG] Teach Chain Analysis about BaseIndexOffset addressing.Nirav Dave2017-04-243-36/+39
| | | | | | | | | | | | | | | | | | While we use BaseIndexOffset in FindBetterNeighborChains to appropriately realize they're almost the same address and should be improved concurrently we do not use it in isAlias using the non-index understanding FindBaseOffset instead. Adding a BaseIndexOffset check in isAlias like should allow indexed stores to be merged. FindBaseOffset to be excised in subsequent patch. Reviewers: jyknight, aditya_nandakumar, bogner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31987 llvm-svn: 301187
* Update two android XFAILSPavel Labath2017-04-242-2/+2
| | | | | | | - XFAIL on TestNoreturnUnwind on all architectures - TestStaticVariables fails with clang-3.8 as well llvm-svn: 301186
* Extend readability-container-size-empty to add comparisons to empty-state ↵Aaron Ballman2017-04-244-6/+197
| | | | | | | | objects. Patch by Josh Zimmerman. llvm-svn: 301185
* [sanitizer] Cache SizeClassForTransferBatch in the 32-bit local cacheKostya Kortchinsky2017-04-241-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: `SizeClassForTransferBatch` is expensive and is called for every `CreateBatch` and `DestroyBatch`. Caching it means `kNumClasses` calls in `InitCache` instead. This should be a performance gain if more than `kNumClasses / 2` batches are created and destroyed during the lifetime of the local cache. I have chosen to fully remove the function and putting the code in `InitCache`, which is a debatable choice. In single threaded benchmarks leveraging primary backed allocations, this turns out to be a sizeable gain in performances (greater than 5%). In multithreaded benchmarks leveraging everything, it is less significant but still an improvement (about 1%). Reviewers: kcc, dvyukov, alekseyshl Reviewed By: dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D32365 llvm-svn: 301184
* [index] If the 'external_source_symbol' attribute indicates 'Swift' as the ↵Argyrios Kyrtzidis2017-04-246-16/+35
| | | | | | language then report it accordingly llvm-svn: 301183
* clang-format: Fix bad corner case in formatting of function types.Daniel Jasper2017-04-242-1/+8
| | | | | | | | | | | | | | | | | | | | | | | Before: std::function< LoooooooooooongTemplatedType<SomeType>*( LooooooooooooooooooooongType type)> function; After: std::function< LoooooooooooongTemplatedType< SomeType>*( LooooooooooooooooongType type)> function; clang-format generally avoids having lines like "SomeType>*(" as they lead to parameter lists that don't belong together to be aligned. However, in case it is better than the alternative, which can even be violating the column limit. llvm-svn: 301182
* [X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructionsSimon Pilgrim2017-04-241-1/+2110
| | | | | | Had to split btver2/znver1 checks as only btver2 suppresses zeroupper llvm-svn: 301181
* [index] The relation between the declarations in template specializationsAlex Lorenz2017-04-244-4/+175
| | | | | | | | | | | | that 'override' declarations in the base template should be recorded This can be used for improved "go to definition" feature in Xcode. rdar://31604739 Differential Revision: https://reviews.llvm.org/D32020 llvm-svn: 301180
* Fix the new SocketAddressTest on WindowsPavel Labath2017-04-241-3/+20
| | | | | | we need to call WSAStartup before we can use getaddrinfo. llvm-svn: 301179
OpenPOWER on IntegriCloud