summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
...
* Instroduce a template file to define InstrPGO core data structures.Xinliang David Li2015-10-161-0/+88
| | | | | | | | | | | | | | | Changing PGO data format layout can be a pain. Many different places need to be touched and kept in sync. Failing to do so usually results in errors very time consuming to debug. This file is intended to be the master file that defines the layout of the core runtime data structures. Currently only two structure is covered: Per function ProfData structure and the function record structure used in coverage mapping. No client code has been made yet, so this commit is NFC. llvm-svn: 250574
* [CMake] Cleaning up and generalizing the LLVMInstallSymlink script so that ↵Chris Bieneman2015-10-162-11/+7
| | | | | | | | it can be used for libraries too. In order to resolve PR25059, we're going to need to be able to generate symlinks to libraries manually, so I need this code to be reusable. llvm-svn: 250573
* [libFuzzer] print a stack trace on timeoutKostya Serebryany2015-10-164-0/+17
| | | | llvm-svn: 250571
* Revert "This is a follow-up to the discussion in D12882."Benjamin Kramer2015-10-162-214/+16
| | | | | | Breaks clang selfhost, see PR25222. This reverts commits r250527 and r250528. llvm-svn: 250570
* [libFuzzer] reduce the size of artifacts printed on the screenKostya Serebryany2015-10-161-1/+1
| | | | llvm-svn: 250565
* [libFuzzer] When -test_single_input crashes the test it is not necessary to ↵Kostya Serebryany2015-10-165-5/+18
| | | | | | write crash-file because input is already known to the user. Patch by Mike Aizatsky llvm-svn: 250564
* [x86] promote 'add nsw' to a wider type to allow more combinesSanjay Patel2015-10-162-25/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this patch starts with PR20134: https://llvm.org/bugs/show_bug.cgi?id=20134 void foo(int *a, int i) { a[i] = a[i+1] + a[i+2]; } It seems better to produce this (14 bytes): movslq %esi, %rsi movl 0x4(%rdi,%rsi,4), %eax addl 0x8(%rdi,%rsi,4), %eax movl %eax, (%rdi,%rsi,4) Rather than this (22 bytes): leal 0x1(%rsi), %eax cltq leal 0x2(%rsi), %ecx movslq %ecx, %rcx movl (%rdi,%rcx,4), %ecx addl (%rdi,%rax,4), %ecx movslq %esi, %rax movl %ecx, (%rdi,%rax,4) The most basic problem (the first test case in the patch combines constants) should also be fixed in InstCombine, but it gets more complicated after that because we need to consider architecture and micro-architecture. For example, AArch64 may not see any benefit from the more general transform because the ISA solves the sexting in hardware. Some x86 chips may not want to replace 2 ADD insts with 1 LEA, and there's an attribute for that: FeatureSlowLEA. But I suspect that doesn't go far enough or maybe it's not getting used when it should; I'm also not sure if FeatureSlowLEA should also mean "slow complex addressing mode". I see no perf differences on test-suite with this change running on AMD Jaguar, but I see small code size improvements when building clang and the LLVM tools with the patched compiler. A more general solution to the sext(add nsw(x, C)) problem that works for multiple targets is available in CodeGenPrepare, but it may take quite a bit more work to get that to fire on all of the test cases that this patch takes care of. Differential Revision: http://reviews.llvm.org/D13757 llvm-svn: 250560
* MC: Don't crash after issuing a diagnostic.Jim Grosbach2015-10-162-3/+10
| | | | | | | | | | | | | | | | Crashing is bad, m'kay? Fixing a 4 year old bug of my own creation. Adding the testcase now which I should have added then which would have long since caught this. The problem is that printMessage() will display the diagnostic but not set HadError to true, resulting in the assembler continuing on its way and trying to create relocations for things that may not allow them or otherwise get itself into trouble. Using the Error() helper function here rather than calling printMessage() directly resolves this. rdar://23133240 llvm-svn: 250557
* [WinEH] Fix CatchRetSuccessorColorMap accountingJoseph Tremoulet2015-10-162-2/+41
| | | | | | | | | | | | | | | | Summary: We now use the block for the catchpad itself, rather than its normal successor, as the funclet entry. Putting the normal successor in the map leads downstream funclet membership computations to erroneous results. Reviewers: majnemer, rnk Subscribers: rnk, llvm-commits Differential Revision: http://reviews.llvm.org/D13798 llvm-svn: 250552
* Fix assertion failure with fp128 to unsigned i64 conversionAndrew Kaylor2015-10-162-9/+21
| | | | | | | | Patch by Mitch Bodart Differential Revision: http://reviews.llvm.org/D13780 llvm-svn: 250550
* [Hexagon] Split double registersKrzysztof Parzyszek2015-10-1622-96/+1338
| | | | llvm-svn: 250549
* [WinEH] Remove dead code/includes from WinEHPrepareDavid Majnemer2015-10-161-29/+2
| | | | | | No functionality change is intended. llvm-svn: 250545
* [Hexagon] Delete lib/Target/Hexagon/HexagonRemoveSZExtArgs.cppKrzysztof Parzyszek2015-10-163-96/+0
| | | | llvm-svn: 250543
* [Hexagon] Merge adjacent storesKrzysztof Parzyszek2015-10-167-1/+694
| | | | llvm-svn: 250542
* Sample profiles - Re-arrange binary format to emit head samples only on top ↵Diego Novillo2015-10-166-21/+32
| | | | | | | | | | | | | | functions. The number of samples collected at the head of a function only make sense for top-level functions (i.e., those actually called as opposed to being inlined inside another). Head samples essentially count the time spent inside the function's prologue. This clearly doesn't make sense for inlined functions, so we were always emitting 0 in those. llvm-svn: 250539
* WebAssembly: fix load/store syntaxJF Bastien2015-10-167-81/+81
| | | | | | | | | | | | Summary: The syntax has changed a bit recently. Reviewers: binji Subscribers: llvm-commits, jfb, sunfish, dschuff Differential Revision: http://reviews.llvm.org/D13821 llvm-svn: 250535
* [WinEH] Fix endpad coloring/numberingJoseph Tremoulet2015-10-162-3/+72
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a cleanup's cleanupendpad or cleanupret targets a catchendpad, stop trying to propagate the cleanup's parent's color to the catchendpad, since what's needed is the cleanup's grandparent's color and the catchendpad will get that color from the catchpad linkage already. We already had this exclusion for invokes, but were missing it for cleanupendpad/cleanupret. Also add a missing line that tags cleanupendpads' states in the EHPadStateMap, without with lowering invokes that target cleanupendpads which unwind to other handlers (and so don't have the -1 state) will fail. This fixes the reduced IR repro in PR25163. Reviewers: majnemer, andrew.w.kaylor, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13797 llvm-svn: 250534
* Fix typo, NFC.Yaron Keren2015-10-161-1/+1
| | | | llvm-svn: 250529
* move test case to x86 directory because it specifies an x86 targetSanjay Patel2015-10-161-0/+0
| | | | llvm-svn: 250528
* This is a follow-up to the discussion in D12882.Sanjay Patel2015-10-162-16/+214
| | | | | | | | | | | | | | Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands are expensive (as defined by the TTI cost model) because that may expose further optimizations. However, we would then like a later pass like CodeGenPrepare to undo that transformation if the target would likely benefit from not speculatively executing an expensive op (this patch). Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its select-formation behavior that changed with r248439. Differential Revision: http://reviews.llvm.org/D13297 llvm-svn: 250527
* WebAssembly: relooper analysis passJF Bastien2015-10-163-56/+109
| | | | | | | | | | | | Summary: Make the relooper an analysis pass, to convert CFG to AST. Reviewers: sunfish Subscribers: jfb, dschuff Differential Revision: http://reviews.llvm.org/D12744 llvm-svn: 250524
* [AArch64] Implement vector splitting on UADDV.Charlie Turner2015-10-163-0/+269
| | | | | | | | | | | | Summary: Fixes PR25056. Reviewers: mcrosier, junbuml, jmolloy Subscribers: aemerson, rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D13466 llvm-svn: 250520
* Sample Profiling - Remove useless asserts. NFC.Diego Novillo2015-10-161-2/+0
| | | | llvm-svn: 250513
* Commited two test files which are forgotten during commit of patch for ↵Zlatko Buljan2015-10-162-0/+13
| | | | | | http://reviews.llvm.org/D13376 llvm-svn: 250512
* [mips][microMIPS] Implement LB, LBE, LBU and LBUE instructionsHrvoje Varga2015-10-168-1/+148
| | | | | | Differential Revision: http://reviews.llvm.org/D11633 llvm-svn: 250511
* Fix path::home_directory() unit test.Pawel Bylica2015-10-161-8/+12
| | | | | | It turns out that constructing std::string from null pointer is not the very best idea. llvm-svn: 250506
* SupportTests::HomeDirectory: Don't try tests when $HOME is undefined.NAKAMURA Takumi2015-10-161-6/+9
| | | | | | Lit sanitizes env vars. $HOME is not exported in Lit tests. llvm-svn: 250505
* Reformat.NAKAMURA Takumi2015-10-161-1/+1
| | | | llvm-svn: 250504
* Use Windows Vista API to get the user's home directoryPawel Bylica2015-10-162-16/+24
| | | | | | | | | | | | Summary: This patch replaces usage of deprecated SHGetFolderPathW with SHGetKnownFolderPath. The usage of SHGetKnownFolderPath is wrapped to allow queries for other "known" folders in the near future. Reviewers: aaron.ballman, gbedwell Subscribers: chapuni, llvm-commits Differential Revision: http://reviews.llvm.org/D13753 llvm-svn: 250501
* [X86] Add fxsr feature flag for fxsave/fxrestore instructions.Craig Topper2015-10-167-44/+76
| | | | llvm-svn: 250497
* Initial migration of AVR backendDylan McKay2015-10-163-0/+28
| | | | | | | | This patch adds the underlying infrastructure for an AVR backend to be included into LLVM. It is the first of a series of patches aimed at moving the out-of-tree AVR backend into the tree. It consists of adding a new`Triple` target 'avr'. llvm-svn: 250492
* [RS4GC] Dont' propagate call attrs related to patchable statepointsSanjoy Das2015-10-162-0/+51
| | | | | | | | The `"statepoint-id"` and `"statepoint-num-patch-bytes"` attributes are used solely to determine properties of the `gc.statepoint` being created. Once the `gc.statepoint` is in place, these should be removed. llvm-svn: 250491
* [RS4GC] Bring legalizeCallAttributes up to LLVM coding style; NFCSanjoy Das2015-10-161-13/+11
| | | | llvm-svn: 250490
* [RS4GC] Use "deopt" operand bundlesSanjoy Das2015-10-1626-36/+2047
| | | | | | | | | | | | | | | | | | | | | | Summary: This is a step towards using operand bundles to carry deopt state till RewriteStatepointsForGC. The change adds a flag to RewriteStatepointsForGC that teaches it to pick up deopt state from a `"deopt"` operand bundle attached to the `call` or `invoke` it is wrapping. The command line flag added, `-rs4gc-use-deopt-bundles`, will only exist for a short while. Once we are able to pipe deopt bundle state through the full optimization pipeline without problems, we will "constant fold" `-rs4gc-use-deopt-bundles` to `true`. Reviewers: swaroop.sridhar, reames Subscribers: llvm-commits, sanjoy Differential Revision: http://reviews.llvm.org/D13372 llvm-svn: 250489
* [IndVars] Rename getExtend; NFCSanjoy Das2015-10-161-17/+17
| | | | | | | Rename `IndVarSimplify::getExtend` to `IndVarSimplify::createExtendInst` to make it obvious that it creates `llvm::Instruction` s. llvm-svn: 250484
* [IndVars] Have `cloneArithmeticIVUser` guess betterSanjoy Das2015-10-162-14/+102
| | | | | | | | | | | | | | | | | | | | | Summary: `cloneArithmeticIVUser` currently trips over expression like `add %iv, -1` when `%iv` is being zero extended -- it tries to construct the widened use as `add %iv.zext, zext(-1)` and (correctly) fails to prove equivalence to `zext(add %iv, -1)` (here the SCEV for `%iv` is `{1,+,1}`). This change teaches `IndVars` to try sign extending the non-IV operand if that makes the newly constructed IV use equivalent to the widened narrow IV use. Reviewers: atrick, hfinkel, reames Subscribers: sanjoy, llvm-commits Differential Revision: http://reviews.llvm.org/D13717 llvm-svn: 250483
* [IndVars] Extract out a few local variables; NFCSanjoy Das2015-10-161-24/+32
| | | | llvm-svn: 250482
* [IndVars] Split `WidenIV::cloneIVUser`; NFCSanjoy Das2015-10-161-25/+71
| | | | | | | | | | | | | | | Summary: This NFC splitting is intended to make a later diff easier to follow. It just tail duplicates `cloneIVUser` into `cloneArithmeticIVUser` and `cloneBitwiseIVUser`. Reviewers: atrick, hfinkel, reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13716 llvm-svn: 250481
* WebAssembly: update syntaxJF Bastien2015-10-1623-825/+973
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Follow the same syntax as for the spec repo. Both have evolved slightly independently and need to converge again. This, along with wasmate changes, allows me to do the following: echo "int add(int a, int b) { return a + b; }" > add.c ./out/bin/clang -O2 -S --target=wasm32-unknown-unknown add.c -o add.wack ./experimental/prototype-wasmate/wasmate.py add.wack > add.wast ./sexpr-wasm-prototype/out/sexpr-wasm add.wast -o add.wasm ./sexpr-wasm-prototype/third_party/v8-native-prototype/v8/v8/out/Release/d8 -e "print(WASM.instantiateModule(readbuffer('add.wasm'), {print:print}).add(42, 1337));" As you'd expect, the d8 shell prints out the right value. Reviewers: sunfish Subscribers: jfb, llvm-commits, dschuff Differential Revision: http://reviews.llvm.org/D13712 llvm-svn: 250480
* Add emacs c++ mode hint.Lang Hames2015-10-161-1/+1
| | | | llvm-svn: 250479
* [llvm-readobj/ELF] Dump DT_VERDEF/DT_VERDEFNUM correctly.Davide Italiano2015-10-153-0/+11
| | | | llvm-svn: 250464
* Revert "[safestack] Fast access to the unsafe stack pointer on AArch64/Android."Evgeniy Stepanov2015-10-158-72/+73
| | | | | | Breaks the hexagon buildbot. llvm-svn: 250461
* Replace a forward declaration with an #include.Adrian Prantl2015-10-151-1/+2
| | | | | | | When building with modules the forward-declared inner class DebugLocStream::ListBuilder causes clang to fall over. llvm-svn: 250459
* [safestack] Fast access to the unsafe stack pointer on AArch64/Android.Evgeniy Stepanov2015-10-158-73/+72
| | | | | | | | | | | | | | | | Android libc provides a fixed TLS slot for the unsafe stack pointer, and this change implements direct access to that slot on AArch64 via __builtin_thread_pointer() + offset. This change also moves more code into TargetLowering and its target-specific subclasses to get rid of target-specific codegen in SafeStackPass. This change does not touch the ARM backend because ARM lowers builting_thread_pointer as aeabi_read_tp, which is not available on Android. llvm-svn: 250456
* [CMake] Adding LLVM_CREATE_XCODE_TOOLCHAIN to the CMake documentation page.Chris Bieneman2015-10-151-0/+6
| | | | llvm-svn: 250451
* [CMake] [Darwin] Add support for generating Xcode-compatible toolchains that ↵Chris Bieneman2015-10-151-0/+72
| | | | | | | | | | | | | | | | | | | xcodebuild and xcrun can search Summary: Sometimes you want to install a custom compiler and use it like the system compiler without overriding the system compiler. This patch lets you create xctoolchains that the darwin command line tools can use. To use this patch set LLVM_CREATE_XCODE_TOOLCHAIN=On in your CMake invocation and build the `install-code-toolchain` target. After installation you can set the envar EXTERNAL_TOOLCHAINS_DIR to your installed Toolchains directory, and the TOOLCHAINS envar to the toolchain identifier (ex org.llvm.3.8.0svn). This will then cause /usr/bin/clang to call your newly installed clang. Reviewers: Bigcheese, bogner Subscribers: tobiasfar, llvm-commits Differential Revision: http://reviews.llvm.org/D13605 llvm-svn: 250450
* Add a missing include of cstddef needed for size_t.Adrian Prantl2015-10-151-0/+1
| | | | llvm-svn: 250446
* x86: preserve flags when folding atomic operationsJF Bastien2015-10-152-19/+47
| | | | | | | | | | D4796 taught LLVM to fold some atomic integer operations into a single instruction. The pattern was unaware that the instructions clobbered flags. I fixed some of this issue in D13680 but had missed INC/DEC. This patch adds the missing EFLAGS definition. llvm-svn: 250438
* docs: Stop using DEBUG() without DEBUG_TYPE in the ProgrammersManualJustin Bogner2015-10-152-19/+11
| | | | | | | | The DEBUG() macro has required that a DEBUG_TYPE be set since r206822. Update the programmers manual to reflect that, and also update the wording to point out that DEBUG_TYPE should be defined after #includes. llvm-svn: 250436
* [SelectionDAG] Remove dead code. NFC.Benjamin Kramer2015-10-158-178/+1
| | | | | | Carefully selected parts without deleting graph stuff and dumping methods. llvm-svn: 250434
OpenPOWER on IntegriCloud