summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Simplify some code in combineSetCC. NFCICraig Topper2017-11-251-10/+6
| | | | | | Make the condition for doing a std::swap simpler so we don't have to repeat the full checks. llvm-svn: 318970
* [X86] Qualify some vector specific code with VT.isVector(). NFCICraig Topper2017-11-251-2/+2
| | | | | | Other checks inside require a build_vector, but we this lets us stop earlier and makes the code more clear. llvm-svn: 318969
* [X86] Support folding to andnps with SSE1 only.Craig Topper2017-11-252-5/+6
| | | | | | With SSE1 only, we emit FAND and FXOR nodes for v4f32. llvm-svn: 318968
* [X86] Add some early DAG combines to turn v4i32 AND/OR/XOR into ↵Craig Topper2017-11-254-274/+101
| | | | | | | | | | FAND/FOR/FXOR whe only SSE1 is available. v4i32 isn't a legal type with sse1 only and would end up getting scalarized otherwise. This isn't completely ideal as it doesn't handle cases like v8i32 that would get split to v4i32. But it at least helps with code written using the clang intrinsic header. llvm-svn: 318967
* Recommit r318963 "[APInt] Don't print debug messages from the APInt knuth ↵Craig Topper2017-11-241-0/+10
| | | | | | | | | | | | | | division algorithm by default" The previous commit had the condition in the do/while backwards. Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log. This adds a new preprocessor flag to enable the prints in the knuth division code in APInt. Differential Revision: https://reviews.llvm.org/D40404 llvm-svn: 318966
* [X86] Prevent using X * rsqrt(X) to approximate sqrt when only sse1 is enabled.Craig Topper2017-11-242-113/+10
| | | | | | | | This optimization can occur after type legalization and emit a vselect with v4i32 type. But that type is not legal with sse1. This ultimately gets scalarized by the second type legalization that runs after vector op legalization, but that's really intended to handle the scalar types that might be introduced by legalizing vector ops. For now just stop this from happening by disabling the optimization with sse1. llvm-svn: 318965
* Revert 318963 "[APInt] Don't print debug messages from the APInt knuth ↵Craig Topper2017-11-241-10/+0
| | | | | | | | division algorithm by default" I seem to have botched the logic when switching to push_macro llvm-svn: 318964
* [APInt] Don't print debug messages from the APInt knuth division algorithm ↵Craig Topper2017-11-241-0/+10
| | | | | | | | | | | | by default Debug builds currently print out low level details of the Knuth division algorithm when -debug is used. This information isn't useful in most cases and just adds noise to the log. This adds a new preprocessor flag to enable the prints in the knuth division code in APInt. Differential Revision: https://reviews.llvm.org/D40404 llvm-svn: 318963
* Delete dead code.Rafael Espindola2017-11-241-6/+2
| | | | | | The parent constructor is already setting the binding. llvm-svn: 318962
* Fix MSVC double-float implicit truncation warning. NFCISimon Pilgrim2017-11-241-1/+1
| | | | llvm-svn: 318961
* [clang-format] Deduplicate using declarationsKrasimir Georgiev2017-11-242-4/+39
| | | | | | | | | | | | | | Summary: This deduplicated equivalent using declarations within a block. Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D40435 llvm-svn: 318960
* clang-format: [JS] do not break in ArrayType[].Martin Probst2017-11-242-0/+5
| | | | | | | | | | | | | | | | | | | | | | | Summary: Wrapping between the type name and the array type indicator creates invalid syntax in TypeScript. Before: const xIsALongIdent: YJustBarelyFitsLinex []; // illegal syntax. After: const xIsALongIdent: YJustBarelyFitsLinex[]; Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D40436 llvm-svn: 318959
* clang-format: [JS] do not wrap before yield.Martin Probst2017-11-242-2/+3
| | | | | | | | | | | | Summary: The same rules apply as for `return`. Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D40431 llvm-svn: 318958
* clang-format: [JS] space between ! assert and in.Martin Probst2017-11-242-2/+4
| | | | | | | | | | | | | | | | Summary: Before: x = y!in z; After: x = y! in z; Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D40433 llvm-svn: 318957
* [CodeGenPrepare] Check that erased sunken address are not reusedSimon Dardis2017-11-243-5/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | CodeGenPrepare sinks address computations from one basic block to another and attempts to reuse address computations that have already been sunk. If the same address computation appears twice with the first instance as an operand of a load whose result is an operand to a simplifable select, CodeGenPrepare simplifies the select and recursively erases the now dead instructions. CodeGenPrepare then attempts to use the erased address computation for the second load. Fix this by erasing the cached address value if it has zero uses before looking for the address value in the sunken address map. This partially resolves PR35209. Thanks to Alexander Richardson for reporting the issue! This fixed version relands r318032 which was reverted in r318049 due to sanitizer buildbot failures. Reviewers: john.brawn Differential Revision: https://reviews.llvm.org/D39841 llvm-svn: 318956
* [AMDGPU][MC][GFX9] Added v_interp_p2_f16 and v_interp_p2_legacy_f16Dmitry Preobrazhensky2017-11-243-2/+90
| | | | | | | | | | See bug 33629: https://bugs.llvm.org//show_bug.cgi?id=33629 Reviewers: artem.tamazov, SamWot, arsenm Differential Revision: https://reviews.llvm.org/D39488 llvm-svn: 318955
* [AVR] Use the short form of 'clr <reg>'Dylan McKay2017-11-244-14/+15
| | | | | | | r318895 made it so that the simpler instruction aliases are printed rather than their expanded form. llvm-svn: 318954
* Make helpers static. NFC.Benjamin Kramer2017-11-244-12/+14
| | | | llvm-svn: 318953
* [SCEV] : Simplify loop to range-loop.NFC.Javed Absar2017-11-241-2/+2
| | | | llvm-svn: 318952
* [clang-tidy] rename_check.py: fix header guard handlingAlexander Kornienko2017-11-241-2/+2
| | | | llvm-svn: 318951
* [clang-tidy] Move a few more checks from misc to bugprone.Alexander Kornienko2017-11-2446-162/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang_tidy/rename_check.py misc-assert-side-effect bugprone-assert-side-effect clang_tidy/rename_check.py misc-bool-pointer-implicit-conversion bugprone-bool-pointer-implicit-conversion clang_tidy/rename_check.py misc-fold-init-type bugprone-fold-init-type clang_tidy/rename_check.py misc-forward-declaration-namespace bugprone-forward-declaration-namespace clang_tidy/rename_check.py misc-inaccurate-erase bugprone-inaccurate-erase clang_tidy/rename_check.py misc-move-forwarding-reference bugprone-move-forwarding-reference clang_tidy/rename_check.py misc-multiple-statement-macro bugprone-multiple-statement-macro clang_tidy/rename_check.py misc-use-after-move bugprone-use-after-move clang_tidy/rename_check.py misc-virtual-near-miss bugprone-virtual-near-miss Manually fixed a reference to UseAfterMoveCheck in the hicpp module. Manually fixed header guards. Reviewers: hokein Reviewed By: hokein Subscribers: nemanjai, mgorny, javed.absar, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D40426 llvm-svn: 318950
* [CGP] Make optimizeMemoryInst able to combine more kinds of ExtAddrMode fieldsJohn Brawn2017-11-242-13/+445
| | | | | | | | | | | | | This patch extends the recent work in optimizeMemoryInst to make it able to combine more ExtAddrMode fields than just the BaseReg. This fixes some benchmark regressions introduced by r309397, where GVN PRE is hoisting a getelementptr such that it can no longer be combined into the addressing mode of the load or store that uses it. Differential Revision: https://reviews.llvm.org/D38133 llvm-svn: 318949
* [mips] Set microMIPS ASE flagAleksandar Beserminji2017-11-244-1/+25
| | | | | | | | | | This patch fixes an issue where microMIPS ASE flag is not set when a function has micromips attribute or when .set micromips directive is used. Differential Revision: https://reviews.llvm.org/D40316 llvm-svn: 318948
* [AMDGPU][MC][GFX9] Added support of 'inst_offset' modifier for compatibility ↵Dmitry Preobrazhensky2017-11-242-2/+9
| | | | | | | | | | | | with SP3 See bug 35329: https://bugs.llvm.org//show_bug.cgi?id=35329 Reviewers: arsenm, vpykhtin, artem.tamazov Differential Revision: https://reviews.llvm.org/D40350 llvm-svn: 318947
* [clangd] Sort list of sources in CMakeLists.txt. NFCIlya Biryukov2017-11-241-1/+1
| | | | llvm-svn: 318946
* Avoid copying the data of in-memory preamblesIlya Biryukov2017-11-242-3/+5
| | | | | | | | | | | | | | Summary: Preambles are large and we should avoid copying them. Reviewers: bkramer, klimek Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40302 llvm-svn: 318945
* [clangd] Ensure preamble outlives the ASTIlya Biryukov2017-11-242-51/+45
| | | | | | | | | | | | | | | | Summary: In-memory preambles will not be copied anymore, so we need to make sure they outlive the AST. Reviewers: bkramer, sammccall, klimek Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40301 llvm-svn: 318944
* [Tooling] Acknowledge that many CompilationDatabases don't support enumeration.Sam McCall2017-11-242-27/+24
| | | | | | | | | | | | Summary: Provide default implementations so that only getCompileCommands() is mandatory. Reviewers: ioeric Subscribers: cfe-commits, bkramer, klimek Differential Revision: https://reviews.llvm.org/D40409 llvm-svn: 318943
* clang-format: [JS] handle destructuring `of`.Martin Probst2017-11-242-2/+8
| | | | | | | | | | | | | | | | | | | | | Summary: Previously, clang-format would drop a space character between `of` and then following (non-identifier) token if the preceding token was part of a destructuring assignment (`}` or `]`). Before: for (const [a, b] of[]) {} After: for (const [a, b] of []) {} Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D40411 llvm-svn: 318942
* [clang-tidy] rename_check.py misc-dangling-handle bugprone-dangling-handleAlexander Kornienko2017-11-2410-18/+22
| | | | | | | | | | | | Reviewers: hokein Reviewed By: hokein Subscribers: mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40389 llvm-svn: 318941
* [ELF] Rename .bss.rel.ro to .data.rel.ro.bss for some Linker Scripts.Peter Smith2017-11-242-1/+37
| | | | | | | | | | | | | | | | | | | LLD uses .bss.rel.ro for read-only copy relocations whereas the ld.bfd and gold linkers use .data.rel.ro. In some linker scripts including ld.bfd's internal linker script, the relro sections are placed sequentially assuming .data.rel.ro is used. LLD's use of .bss.rel.ro means that the copy relocations get matched into the .bss section causing the relro sections to be non-contiguous. This change checks for a .data.rel.ro OutputSection when a linker script with the SECTIONS command is used. The section will match in the .data.rel.ro output section and will maintain contiguous relro. Differential Revision: https://reviews.llvm.org/D40365 Fixes PR35265 llvm-svn: 318940
* [ELF] Make tests with undefined symbols more explicit.Igor Kudrin2017-11-246-7/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D40253 llvm-svn: 318939
* Use lambdas to store lazy-evaluated .dynamic entries.Rui Ueyama2017-11-242-98/+96
| | | | | | Differential Revision: https://reviews.llvm.org/D40338 llvm-svn: 318938
* Make a test stricter.Rafael Espindola2017-11-232-2/+20
| | | | | | | | It now has a DT_NEEDED that could be removed by --gc-sections and one that cannot. Without this all tests would pass if --gc-sections just removed all DT_NEEDED. llvm-svn: 318937
* [YAMLParser] Fix unused variable warning.Benjamin Kramer2017-11-231-1/+1
| | | | llvm-svn: 318936
* [YAMLParser] Don't crash on null keys in KeyValueNodes.Benjamin Kramer2017-11-232-3/+6
| | | | | | Found by clangd-fuzzer! llvm-svn: 318935
* [X86] Don't invert NewCC variable while processing the jcc/setcc/cmovcc ↵Craig Topper2017-11-232-7/+31
| | | | | | | | | | instructions in optimizeCompareInstr. The NewCC variable is calculated outside of the loop that processes jcc/setcc/cmovcc instructions. If we invert it during the loop it can cause an incorrect value to be used by a later iteration. Instead only read it during the loop and use a new variable to store the possibly inverted value. Fixes PR35399. llvm-svn: 318934
* [X86] Teach isel that X86ISD::CMPM_RND zeros the upper bits of the mask ↵Craig Topper2017-11-233-3/+117
| | | | | | register. llvm-svn: 318933
* [X86] Remove some unneeded opcodes from getVectorMaskingNode. NFCCraig Topper2017-11-231-3/+0
| | | | | | We never reach here with these opcodes. llvm-svn: 318932
* [X86] Add X86ISD::CMPM_RND to getVectorMaskingNode to select ISD::AND ↵Craig Topper2017-11-231-0/+1
| | | | | | | | instead of ISD::VSELECT A later DAG combine will turn the VSELECT into an AND, but we have the other mask compare opcodes here so add this one too. llvm-svn: 318931
* [X86] Remove some dead code leftover from when i1 was a legal type. NFCICraig Topper2017-11-231-22/+3
| | | | llvm-svn: 318930
* [X86] Remove some dead code. NFCCraig Topper2017-11-231-4/+2
| | | | | | AVX512 code never reaches here so we don't need to handle X86ISD::CMPM as an opcode. llvm-svn: 318929
* [clangd] Tracing improvementsSam McCall2017-11-238-35/+91
| | | | | | | | | | | | | | | | | | | | Summary: [clangd] Tracing improvements Compose JSON using JSONExpr Allow attaching metadata to spans (and avoid it if tracing is off) Attach IDs and responses of JSON RPCs to their spans The downside is that large responses make the trace viewer sluggish. We should make our responses less huge :-) Or fix trace viewer. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40132 llvm-svn: 318928
* [clangd] Make completion scores use 0-1 floats internally.Sam McCall2017-11-238-62/+74
| | | | | | | | | | | | | | | Summary: This scale is much easier to mix with other signals, such as fuzzy match strength. Mostly NFC, but it does reorder some low-priority items that get folded together at a score of 0 (see completion-qualifiers.test). Removed the exact sortText from the testcases, because it's the ranking that we want to test. Reviewers: hokein Subscribers: ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D40089 llvm-svn: 318927
* [clang-tidy] rename_check.py misc-argument-comment bugprone-argument-commentAlexander Kornienko2017-11-2314-60/+57
| | | | | | | | | | | | | | Summary: + manually convert the unit test to lit test. Reviewers: hokein Reviewed By: hokein Subscribers: mgorny, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D40392 llvm-svn: 318926
* [clangd] Drop impossible completions (unavailable or inaccessible)Sam McCall2017-11-2311-93/+80
| | | | | | | | | | | | Summary: (There must be some reason why D38077 didn't just do this, but I don't get it!) Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39836 llvm-svn: 318925
* [ELF] Skip over empty sections when checking for contiguous relroPeter Smith2017-11-232-1/+79
| | | | | | | | | | | | When checking for contiguous relro sections we can skip over empty sections. If there is an empty non-relro section in the middle of a contiguous block of relro sections then it cannot be written to so it is safe to include in PT_GNU_RELRO header. If there is a contiguous block of empty relro sections then no PT_GNU_RELRO header is required for them. Differential Revision: https://reviews.llvm.org/D40364 llvm-svn: 318924
* MSan: remove an unnecessary cast. NFC for userspace instrumenetation.Alexander Potapenko2017-11-231-3/+3
| | | | llvm-svn: 318923
* [clang-tidy] rename_check.py: fix a bug in check presence detectionAlexander Kornienko2017-11-231-1/+1
| | | | llvm-svn: 318922
* Fixing a typo; NFC.Aaron Ballman2017-11-231-1/+1
| | | | llvm-svn: 318921
OpenPOWER on IntegriCloud