summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [msan] Intercept prlimit.Evgeniy Stepanov2016-02-172-4/+38
| | | | llvm-svn: 261048
* Test simplificationXinliang David Li2016-02-171-3/+2
| | | | llvm-svn: 261047
* Restrengthen tests relaxed in r259955Xinliang David Li2016-02-172-1/+2
| | | | llvm-svn: 261046
* Teach clang to use the ThinLTO pipelineMehdi Amini2016-02-171-1/+2
| | | | | | | | | | | | | Summary: Use the new pipeline implemented in D17115 Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D17272 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261045
* WebAssembly: update expected test failuresJF Bastien2016-02-171-3/+0
| | | | | | r261032 adds frame address support. llvm-svn: 261044
* Add .gitignore for build directoriesMatt Arsenault2016-02-171-0/+13
| | | | llvm-svn: 261043
* amdgcn: Use new workitem intrinsicsMatt Arsenault2016-02-179-38/+124
| | | | llvm-svn: 261042
* [LCG] Construct an actual call graph with call-edge SCCs nested insideChandler Carruth2016-02-175-760/+2518
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reference-edge SCCs. This essentially builds a more normal call graph as a subgraph of the "reference graph" that was the old model. This allows both to exist and the different use cases to use the aspect which addresses their needs. Specifically, the pass manager and other *ordering* constrained logic can use the reference graph to achieve conservative order of visit, while analyses reasoning about attributes and other properties derived from reachability can reason about the direct call graph. Note that this isn't necessarily complete: it doesn't model edges to declarations or indirect calls. Those can be found by scanning the instructions of the function if desirable, and in fact every user currently does this in order to handle things like calls to instrinsics. If useful, we could consider caching this information in the call graph to save the instruction scans, but currently that doesn't seem to be important. An important realization for why the representation chosen here works is that the call graph is a formal subset of the reference graph and thus both can live within the same data structure. All SCCs of the call graph are necessarily contained within an SCC of the reference graph, etc. The design is to build 'RefSCC's to model SCCs of the reference graph, and then within them more literal SCCs for the call graph. The formation of actual call edge SCCs is not done lazily, unlike reference edge 'RefSCC's. Instead, once a reference SCC is formed, it directly builds the call SCCs within it and stores them in a post-order sequence. This is used to provide a consistent platform for mutation and update of the graph. The post-order also allows for very efficient updates in common cases by bounding the number of nodes (and thus edges) considered. There is considerable common code that I'm still looking for the best way to factor out between the various DFS implementations here. So far, my attempts have made the code harder to read and understand despite reducing the duplication, which seems a poor tradeoff. I've not given up on figuring out the right way to do this, but I wanted to wait until I at least had the system working and tested to continue attempting to factor it differently. This also requires introducing several new algorithms in order to handle all of the incremental update scenarios for the more complex structure involving two edge colorings. I've tried to comment the algorithms sufficiently to make it clear how this is expected to work, but they may still need more extensive documentation. I know that there are some changes which are not strictly necessarily coupled here. The process of developing this started out with a very focused set of changes for the new structure of the graph and algorithms, but subsequent changes to bring the APIs and code into consistent and understandable patterns also ended up touching on other aspects. There was no good way to separate these out without causing *massive* merge conflicts. Ultimately, to a large degree this is a rewrite of most of the core algorithms in the LCG class and so I don't think it really matters much. Many thanks to the careful review by Sanjoy Das! Differential Revision: http://reviews.llvm.org/D16802 llvm-svn: 261040
* [X86] Fix a shrink-wrapping miscompile around __chkstkReid Kleckner2016-02-172-7/+41
| | | | | | | | | __chkstk clobbers EAX. If EAX is live across the prologue, then we have to take extra steps to save it. We already had code to do this if EAX was a register parameter. This change adapts it to work when shrink wrapping is used. llvm-svn: 261039
* New test case: make sure alloc bit is not set for covmap section on LinuxXinliang David Li2016-02-171-0/+25
| | | | llvm-svn: 261038
* [WebAssembly] Use SDValue::getConstantOperandVal. NFC.Dan Gohman2016-02-171-1/+1
| | | | llvm-svn: 261037
* Fix MSVC bot: apparently visual studio does not like explicitly defaulted ↵Mehdi Amini2016-02-171-1/+3
| | | | | | | move ctor From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261036
* Improve diagnostics for ill-formed literal operator declarations.Richard Smith2016-02-175-99/+165
| | | | | | Patch by Erik Pilkington! llvm-svn: 261034
* Fix build LLVM with -D LLVM_USE_INTEL_JITEVENTS:BOOL=ON on WindowsAndrew Kaylor2016-02-162-2/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D16940 llvm-svn: 261033
* [WebAssembly] Implement __builtin_frame_address.Dan Gohman2016-02-165-8/+54
| | | | | | Differential Revision: http://reviews.llvm.org/D17307 llvm-svn: 261032
* Query the StringMap only once when creating MDString (NFC)Mehdi Amini2016-02-162-12/+7
| | | | | | | | | | | | | Summary: Loading IR with debug info improves MDString::get() from 19ms to 10ms. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16597 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261030
* Define the ThinLTO Pipeline (experimental)Mehdi Amini2016-02-162-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: On the contrary to Full LTO, ThinLTO can afford to shift compile time from the frontend to the linker: both phases are parallel (even if it is not totally "free": projects like clang are reusing product from the "compile phase" for multiple link, think about libLLVMSupport reused for opt, llc, etc.). This pipeline is based on the proposal in D13443 for full LTO. We didn't move forward on this proposal because the LTO link was far too long after that. We believe that we can afford it with ThinLTO. The ThinLTO pipeline integrates in the regular O2/O3 flow: - The compile phase perform the inliner with a somehow lighter function simplification. (TODO: tune the inliner thresholds here) This is intendend to simplify the IR and get rid of obvious things like linkonce_odr that will be inlined. - The link phase will run the pipeline from the start, extended with some specific passes that leverage the augmented knowledge we have during LTO. Especially after the inliner is done, a sequence of globalDCE/globalOpt is performed, followed by another run of the "function simplification" passes. It is not clear if this part of the pipeline will stay as is, as the split model of ThinLTO does not allow the same benefit as FullLTO without added tricks. The measurements on the public test suite as well as on our internal suite show an overall net improvement. The binary size for the clang executable is reduced by 5%. We're still tuning it with the bringup of ThinLTO and it will evolve, but this should provide a good starting point. Reviewers: tejohnson Differential Revision: http://reviews.llvm.org/D17115 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261029
* Refactor the PassManagerBuilder: extract a ↵Mehdi Amini2016-02-162-72/+77
| | | | | | | | | | "addFunctionSimplificationPasses()" (NFC) It is intended to contains the passes run over a function after the inliner is done with a function and before it moves to its callers. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261028
* Fix test from r261013Adam Nemet2016-02-161-0/+1
| | | | llvm-svn: 261027
* [X86][AVX] Regenerated vselect testsSimon Pilgrim2016-02-161-34/+68
| | | | llvm-svn: 261026
* [X86] Remove the now-unused X86ISD::PSIGN. NFC.Ahmed Bougacha2016-02-166-46/+30
| | | | llvm-svn: 261025
* [X86] Generalize logic blend of (x, -x) combine to match (-x, x).Ahmed Bougacha2016-02-162-17/+21
| | | | | | I suspect this is what let PR26110 lie dormant for so long. llvm-svn: 261024
* [X86] Don't turn (c?-v:v) into (c?-v:0) by blindly using PSIGN.Ahmed Bougacha2016-02-162-37/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we sometimes miscompile this vector pattern: (c ? -v : v) We lower it to (because "c" is <4 x i1>, lowered as a vector mask): (~c & v) | (c & -v) When we have SSSE3, we incorrectly lower that to PSIGN, which does: (c < 0 ? -v : c > 0 ? v : 0) in other words, when c is either all-ones or all-zero: (c ? -v : 0) While this is an old bug, it rarely triggers because the PSIGN combine is too sensitive to operand order. This will be improved separately. Note that the PSIGN tests are also incorrect. Consider: %b.lobit = ashr <4 x i32> %b, <i32 31, i32 31, i32 31, i32 31> %sub = sub nsw <4 x i32> zeroinitializer, %a %0 = xor <4 x i32> %b.lobit, <i32 -1, i32 -1, i32 -1, i32 -1> %1 = and <4 x i32> %a, %0 %2 = and <4 x i32> %b.lobit, %sub %cond = or <4 x i32> %1, %2 ret <4 x i32> %cond if %b is zero: %b.lobit = <4 x i32> zeroinitializer %sub = sub nsw <4 x i32> zeroinitializer, %a %0 = <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> %1 = <4 x i32> %a %2 = <4 x i32> zeroinitializer %cond = or <4 x i32> %a, zeroinitializer ret <4 x i32> %a whereas we currently generate: psignd %xmm1, %xmm0 retq which returns 0, as %xmm1 is 0. Instead, use a pure logic sequence, as described in: https://graphics.stanford.edu/~seander/bithacks.html#ConditionalNegate Fixes PR26110. Differential Revision: http://reviews.llvm.org/D17181 llvm-svn: 261023
* [X86] Extract PSIGN/BLENDVP tests into vector-blend.ll. NFC.Ahmed Bougacha2016-02-163-59/+251
| | | | | | | | | | We're going to stop generating PSIGN, so calling a test "psign" isn't ideal. Instead, call these tests what they really are: variable blends using logic. Also add a test to exhibit a case we're currently missing in the PSIGN combine. llvm-svn: 261022
* [X86] Extract PSIGN/BLENDVP combine. NFC.Ahmed Bougacha2016-02-161-77/+95
| | | | llvm-svn: 261021
* [X86] Extract ANDNP combine. NFC.Ahmed Bougacha2016-02-161-61/+57
| | | | | | This makes it IMO more readable and reduces indentation. llvm-svn: 261020
* Bitcode writer: fix a typo, using getName() instead of getSourceFileName()Mehdi Amini2016-02-161-2/+2
| | | | | | | | When emitting the source filename, the encoding of the string was checked against the name instead of the filename. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261019
* [CUDA] pass debug options to ptxas.Artem Belevich2016-02-163-9/+22
| | | | | | | | | ptxas optimizations are disabled if we need to generate debug info as ptxas does not accept '-g' otherwise. Differential Revision: http://reviews.llvm.org/D17111 llvm-svn: 261018
* [WebAssembly] Update torture test expectationsDerek Schuff2016-02-161-7/+0
| | | | | | These were fixed with r260978 llvm-svn: 261017
* [codeview] Bail on a DBG_VALUE register operand with no registerReid Kleckner2016-02-162-6/+10
| | | | | | | | | | This apparently comes up when the register allocator decides that a variable will become undef along a certain path. Also improve the error message we emit when we can't map from LLVM register number to CV register number. llvm-svn: 261016
* [WebAssemly] Don't move calls or stores past intervening loadsDerek Schuff2016-02-162-0/+40
| | | | | | | | | | The register stackifier currently checks for intervening stores (and loads that may alias them) but doesn't account for the fact that the instruction being moved may affect intervening loads. Differential Revision: http://reviews.llvm.org/D17298 llvm-svn: 261014
* [LTO] Support StatisticsAdam Nemet2016-02-162-0/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: I thought -Xlinker -mllvm -Xlinker -stats worked at some point but maybe it never did. For clang, I believe that stats are printed from cc1_main. This patch also prints them for LTO, specifically right after codegen happens. I only looked at the C API for LTO briefly to see if this is a good place. Probably there are still cases where this wouldn't be printed but it seems to be working for the common case. I also experimented putting this in the LTOCodeGenerator destructor but that didn't trigger for me because ld64 does not destroy the LTOCodeGenerator. Reviewers: dexonsmith, joker.eph Subscribers: rafael, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D17302 llvm-svn: 261013
* [codeview] Fix assertion on non-memory, non-register DBG_VALUE instructionsReid Kleckner2016-02-162-0/+79
| | | | | | | Eventually we should find a way to describe constant variables, but it is not obvious how to do this at the moment. llvm-svn: 261010
* Missing semicolons are kind of important. Who knew?Aaron Ballman2016-02-161-1/+1
| | | | llvm-svn: 261009
* Add a nullPointerConstant() AST matcher to handle variations of null pointer ↵Aaron Ballman2016-02-164-0/+49
| | | | | | constants in one matcher. llvm-svn: 261008
* [Hexagon] Adding relocation for code size, cold path optimization allowing a ↵Colin LeMahieu2016-02-1613-1/+77
| | | | | | | | | | | | 23-bit 4-byte aligned relocation to be a valid instruction encoding. The usual way to get a 32-bit relocation is to use a constant extender which doubles the size of the instruction, 4 bytes to 8 bytes. Another way is to put a .word32 and mix code and data within a function. The disadvantage is it's not a valid instruction encoding and jumping over it causes prefetch stalls inside the hardware. This relocation packs a 23-bit value in to an "r0 = add(rX, #a)" instruction by overwriting the source register bits. Since r0 is the return value register, if this instruction is placed after a function call which return void, r0 will be filled with an undefined value, the prefetch won't be confused, and the callee can access the constant value by way of the link register. llvm-svn: 261006
* Stop using "template" when printing qualtype namesReid Kleckner2016-02-162-2/+9
| | | | | | | | | | | | | | | | Summary: The keyword "template" isn't necessary when printing a fully-qualified qualtype name, and, in fact, results in a syntax error if one tries to use it. So stop printing it. Reviewers: rsmith, rnk Subscribers: rnk, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D17214 llvm-svn: 261005
* [AArch64] Add pass to remove redundant copy after RAJun Bum Lim2016-02-165-0/+256
| | | | | | | | | | | | | | | | | | | | | Summary: This change will add a pass to remove unnecessary zero copies in target blocks of cbz/cbnz instructions. E.g., the copy instruction in the code below can be removed because the cbz jumps to BB1 when x0 is zero : BB0: cbz x0, .BB1 BB1: mov x0, xzr Jun Reviewers: gberry, jmolloy, HaoLiu, MatzeB, mcrosier Subscribers: mcrosier, mssimpso, haicheng, bmakam, llvm-commits, aemerson, rengolin Differential Revision: http://reviews.llvm.org/D16203 llvm-svn: 261004
* [GlobalISel] Re-apply r260922-260923 with MSVC-friendly code.Quentin Colombet2016-02-1612-127/+243
| | | | | | | | | Original message: Get rid of the ifdefs in TargetLowering. Introduce a new API used only by GlobalISel: CallLowering. This API will contain target hooks dedicated to call lowering. llvm-svn: 260998
* Exclude PCH/missing-file.cpp on Windows, it does not pass reliablyReid Kleckner2016-02-161-5/+4
| | | | | | | Tag the test with "REQUIRES: can-remove-opened-file", which is what we use for the similar test Modules/explicit-build-missing-file.cpp. llvm-svn: 260994
* [typo-correction] Apply name specifier corrections when forming a NNSReid Kleckner2016-02-162-0/+12
| | | | | | | | Previously we would leave behind the old name specifier prefix, which creates an invalid AST. Other callers of CorrectTypo update their CXXScopeSpec objects with the correction specifier if one is present. llvm-svn: 260993
* clang-cl: Expose -isystem.Nico Weber2016-02-162-1/+3
| | | | | | | | | | | | | Like cl.exe, clang-cl allows adding system include directories via the INCLUDE env var. Having a driver flag for this functionality is useful, so add this too. (In the future, we probably also want to have a flag alternative to VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir() -- maybe -ivcroot= and -iwinsdkroot=?). llvm-svn: 260990
* Pass a std::unique_ptr to IRMover::move.Rafael Espindola2016-02-166-62/+63
| | | | | | | It was already the one "destroying" the source module, now the API reflects that. llvm-svn: 260989
* [WebAssembly] Insert COPY_LOCAL between CopyToReg and FrameIndex DAG nodesDerek Schuff2016-02-164-24/+55
| | | | | | | | | | | | | | CopyToReg nodes don't support FrameIndex operands. Other targets select the FI to some LEA-like instruction, but since we don't have that, we need to insert some kind of instruction that can take an FI operand and produces a value usable by CopyToReg (i.e. in a vreg). So insert a dummy copy_local between Op and its FI operand. This results in a redundant copy which we should optimize away later (maybe in the post-FI-lowering peephole pass). Differential Revision: http://reviews.llvm.org/D17213 llvm-svn: 260987
* [AMDGPU] Rename $dst operand to $vdst for VOP instructions.Tom Stellard2016-02-166-77/+120
| | | | | | | | | | | | | | Summary: This change renames output operand for VOP instructions from dst to vdst. This is needed to enable decoding named operands for disassembler. Reviewers: vpykhtin, tstellarAMD, arsenm Subscribers: arsenm, llvm-commits, nhaustov Projects: #llvm-amdgpu-spb Differential Revision: http://reviews.llvm.org/D16920 llvm-svn: 260986
* Revert 260705, it appears to be causing pr26628Philip Reames2016-02-162-76/+0
| | | | | | The root issue appears to be a confusion around what makeNoWrapRegion actually does. It seems likely we need two versions of this function with slightly different semantics. llvm-svn: 260981
* Don't create multiple .got.plt entries for the same symbol.Rafael Espindola2016-02-163-1/+21
| | | | | | We were doing it for ifunc symbols. llvm-svn: 260980
* [X86] Enable the LEA optimization pass by default.Andrey Turetskiy2016-02-163-6/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D16877 llvm-svn: 260979
* [WebAssembly] Switch from RPO sorting to topological sorting.Dan Gohman2016-02-162-196/+300
| | | | | | | | | | WebAssembly doesn't require full RPO; topological sorting is sufficient and can preserve more of the MachineBlockPlacement ordering. Unfortunately, this still depends a lot on heuristics, because while we use the MachineBlockPlacement ordering as a guide, we can't use it in places where it isn't topologically ordered. This area will require further attention. llvm-svn: 260978
* Merge multiple tdata.* into a single section.Rafael Espindola2016-02-162-2/+4
| | | | llvm-svn: 260977
OpenPOWER on IntegriCloud