summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify CpuIs code to use include from LLVMErich Keane2017-11-152-119/+24
| | | | | | | | | | | | LLVM exposes a file in the backend (X86TargetParser.def) that contains information about the correct list of CpuIs values. This patch removes 2 of the copied and pasted versions of this list from clang and instead includes the data from the .def file. Differential Revision: https://reviews.llvm.org/D40054 llvm-svn: 318234
* [profile] Update InstrProfData.inc to sync with llvmVedant Kumar2017-11-141-1/+1
| | | | llvm-svn: 318230
* [PGO] Detect more structural changes with the stable hashVedant Kumar2017-11-1419-64/+649
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifting from Bob Wilson's notes: The hash value that we compute and store in PGO profile data to detect out-of-date profiles does not include enough information. This means that many significant changes to the source will not cause compiler warnings about the profile being out of date, and worse, we may continue to use the outdated profile data to make bad optimization decisions. There is some tension here because some source changes won't affect PGO and we don't want to invalidate the profile unnecessarily. This patch adds a new hashing scheme which is more sensitive to loop nesting, conditions, and out-of-order control flow. Here are examples which show snippets which get the same hash under the current scheme, and different hashes under the new scheme: Loop Nesting Example -------------------- // Snippet 1 while (foo()) { while (bar()) {} } // Snippet 2 while (foo()) {} while (bar()) {} Condition Example ----------------- // Snippet 1 if (foo()) bar(); baz(); // Snippet 2 if (foo()) bar(); else baz(); Out-of-order Control Flow Example --------------------------------- // Snippet 1 while (foo()) { if (bar()) {} baz(); } // Snippet 2 while (foo()) { if (bar()) continue; baz(); } In each of these cases, it's useful to differentiate between the snippets because swapping their profiles gives bad optimization hints. The new hashing scheme considers some logical operators in an effort to detect more changes in conditions. This isn't a perfect scheme. E.g, it does not produce the same hash for these equivalent snippets: // Snippet 1 bool c = !a || b; if (d && e) {} // Snippet 2 bool f = d && e; bool c = !a || b; if (f) {} This would require an expensive data flow analysis. Short of that, the new hashing scheme looks reasonably complete, based on a scan over the statements we place counters on. Profiles which use the old version of the PGO hash remain valid and can be used without issue (there are tests in tree which check this). rdar://17068282 Differential Revision: https://reviews.llvm.org/D39446 llvm-svn: 318229
* [PGO] Bump the indexed profile format versionVedant Kumar2017-11-142-2/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D39447 llvm-svn: 318228
* [CMake][runtimes] Don't process common options in runtimes buildPetr Hosek2017-11-141-4/+0
| | | | | | | | | | | This is no longer needed for any of the runtimes build and it breaks in case we don't have the working compiler yet, e.g. when building a compiler that uses compiler-rt and libc++ as a default runtime, because these common options check whether these are available. Differential Revision: https://reviews.llvm.org/D39932 llvm-svn: 318227
* [X86] Fix the parameter order in the default implementation of X86_VENDOR ↵Craig Topper2017-11-141-1/+1
| | | | | | | | macro in X86TargetParser.def The default implementation doesn't do anything so the order doesn't matter, but good for cleanliness. llvm-svn: 318226
* [CMake][runtimes] Set compiler as working even for default targetPetr Hosek2017-11-141-3/+8
| | | | | | | | | | | Even when building builtins and runtimes for the default target we shouldn't assume that the just built compiler is already useable. When the compiler uses compiler-rt and libc++ as the default runtime and C++ library, it won't be usable until we finish building runtimes. Differential Revision: https://reviews.llvm.org/D39715 llvm-svn: 318224
* AMDGPU: Handle or in multi-use shl ptr combineMatt Arsenault2017-11-142-2/+36
| | | | llvm-svn: 318223
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-142-231/+259
| | | | | | minor fixes (NFC). llvm-svn: 318221
* Fix switch-lower-peel-top-case.ll isel pass is not registered errorHans Wennborg2017-11-141-1/+1
| | | | | | | | | | The test was doing -stop-after=isel, but that pass is actually the AMDGPUDAGToDAGISel pass, which might not be built when targeting x86_64. This changes the test to -stop-after=expand-isel-pseudos instead. Follow-up to r318202. llvm-svn: 318220
* Update xcode project file to track ArchSpec.cppJason Molenda2017-11-141-6/+12
| | | | | | move and LibCxxBitset.cpp addition. llvm-svn: 318218
* [EntryExitInstrumenter] Placate GCC, the semicolon is redundant. NFCI.Davide Italiano2017-11-141-3/+2
| | | | llvm-svn: 318217
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-142-259/+338
| | | | | | minor fixes (NFC). llvm-svn: 318216
* [refactor][selection] canonicalize decl ref callee to the call exprAlex Lorenz2017-11-142-13/+74
| | | | | | | We would like to extract the full call when just the callee function is selected llvm-svn: 318215
* Try to fix the instrument-functions testsHans Wennborg2017-11-142-4/+4
| | | | | | | | | On e.g. PPC the return value and argument were marked 'signext'. This makes the test expectations a bit more flexible. Follow-up to r318199. llvm-svn: 318214
* [AMDGPU] updated PAL metadata record keysTim Renouf2017-11-142-23/+26
| | | | | | | | | | | | Summary: The ABI changed before specification was finalized. Reviewers: kzhuravl, dstuttard Subscribers: wdng, nhaehnle, yaxunl, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D39807 llvm-svn: 318213
* [Reassociate] use dyn_cast instead of isa+cast; NFCISanjay Patel2017-11-141-9/+9
| | | | llvm-svn: 318212
* [cfi-verify] Add DOT graph printing for GraphResult objects.Mitch Phillips2017-11-146-4/+64
| | | | | | | | | | | | | | Allows users to view GraphResult objects in a DOT directed-graph format. This feature can be turned on through the --print-graphs flag. Also enabled pretty-printing of instructions in output. Together these features make analysis of unprotected CF instructions much easier by providing a visual control flow graph. Reviewers: pcc Subscribers: llvm-commits, kcc, vlad.tsyrklevich Differential Revision: https://reviews.llvm.org/D39819 llvm-svn: 318211
* [GISel]: Rework legalization algorithm for better elimination ofAditya Nandakumar2017-11-1469-1040/+1894
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | artifacts along with DCE Legalization Artifacts are all those insts that are there to make the type system happy. Currently, the target needs to say all combinations of extends and truncs are legal and there's no way of verifying that post legalization, we only have *truly* legal instructions. This patch changes roughly the legalization algorithm to process all illegal insts at one go, and then process all truncs/extends that were added to satisfy the type constraints separately trying to combine trivial cases until they converge. This has the added benefit that, the target legalizerinfo can only say which truncs and extends are okay and the artifact combiner would combine away other exts and truncs. Updated legalization algorithm to roughly the following pseudo code. WorkList Insts, Artifacts; collect_all_insts_and_artifacts(Insts, Artifacts); do { for (Inst in Insts) legalizeInstrStep(Inst, Insts, Artifacts); for (Artifact in Artifacts) tryCombineArtifact(Artifact, Insts, Artifacts); } while(!Insts.empty()); Also, wrote a simple wrapper equivalent to SetVector, except for erasing, it avoids moving all elements over by one and instead just nulls them out. llvm-svn: 318210
* CMake: Turn LLVM_ENABLE_LIBXML2 into a tri-state optionHans Wennborg2017-11-142-1/+5
| | | | | | | | | In addition to the current ON and OFF options, this adds the FORCE_ON option, which causes a configuration error if libxml2 cannot be used. Differential revision: https://reviews.llvm.org/D40050 llvm-svn: 318209
* Add two new macros: _LIBCPP_NODISCARD_AFTER_CXX17 and ↵Marshall Clow2017-11-143-0/+63
| | | | | | _LIBCPP_CONSTEXPR_AFTER_CXX17, along with a way to turn off the NODISCARD one: _LIBCPP_DISABLE_NODISCARD_AFTER_CXX17. No one is using these yet, but we will be ... soon llvm-svn: 318208
* Reland "[mips][mt][6/7] Add support for mftr, mttr instructions."Simon Dardis2017-11-1411-14/+447
| | | | | | | | | | | | | | | | | | | | This adjusts the tests to hopfully pacify the llvm-clang-x86_64-expensive-checks-win buildbot. Unlike many other instructions, these instructions have aliases which take coprocessor registers, gpr register, accumulator (and dsp accumulator) registers, floating point registers, floating point control registers and coprocessor 2 data and control operands. For the moment, these aliases are treated as pseudo instructions which are expanded into the underlying instruction. As a result, disassembling these instructions shows the underlying instruction and not the alias. Reviewers: slthakur, atanasyan Differential Revision: https://reviews.llvm.org/D35253 llvm-svn: 318207
* [CodeGen] Fix the test case added in r318202Rong Xu2017-11-141-1/+1
| | | | | | Add the -mtriple option to filter some platforms. llvm-svn: 318206
* [refactor][selection] canonicalize member expr callee to the fullAlex Lorenz2017-11-142-1/+64
| | | | | | | | member call expression We would like to extract the full call when just the callee is selected. llvm-svn: 318205
* native_powr: Switch implementation to native_exp2 and native_log2Jan Vesely2017-11-144-1/+18
| | | | | | | | | | v2: don't use assume check only for x<0, the other conditions are handled transparently v3: don't check inputs at all, nan propagation works as expected Reviewer: Jeroen Ketema Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 318204
* Make salvageDebugInfo of casts work for dbg.declare and dbg.addrReid Kleckner2017-11-142-6/+103
| | | | | | | | | | | | | | | | | | | | | Summary: Instcombine (and probably other passes) sometimes want to change the type of an alloca. To do this, they generally create a new alloca with the desired type, create a bitcast to make the new pointer type match the old pointer type, replace all uses with the cast, and then simplify the casts. We already knew how to salvage dbg.value instructions when removing casts, but we can extend it to cover dbg.addr and dbg.declare. Fixes a debug info quality issue uncovered in Chromium in http://crbug.com/784609 Reviewers: aprantl, vsk Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D40042 llvm-svn: 318203
* [CodeGen] Peel off the dominant case in switch statement in loweringRong Xu2017-11-147-8/+236
| | | | | | | | | | This patch peels off the top case in switch statement into a branch if the probability exceeds a threshold. This will help the branch prediction and avoids the extra compares when lowering into chain of branches. Differential Revision: http://reviews.llvm.org/D39262 llvm-svn: 318202
* Fix unused variable warning.Richard Smith2017-11-141-1/+0
| | | | llvm-svn: 318201
* Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter ↵Hans Wennborg2017-11-1411-88/+121
| | | | | | | | | | | | | | | | attributes This updates -mcount to use the new attribute names (LLVM r318195), and switches over -finstrument-functions to also use these attributes rather than inserting instrumentation in the frontend. It also adds a new flag, -finstrument-functions-after-inlining, which makes the cygprofile instrumentation get inserted after inlining rather than before. Differential Revision: https://reviews.llvm.org/D39331 llvm-svn: 318199
* Rename CountingFunctionInserter and use for both mcount and cygprofile ↵Hans Wennborg2017-11-1420-85/+316
| | | | | | | | | | | | | | | | | | | | | | calls, before and after inlining Clang implements the -finstrument-functions flag inherited from GCC, which inserts calls to __cyg_profile_func_{enter,exit} on function entry and exit. This is useful for getting a trace of how the functions in a program are executed. Normally, the calls remain even if a function is inlined into another function, but it is useful to be able to turn this off for users who are interested in a lower-level trace, i.e. one that reflects what functions are called post-inlining. (We use this to generate link order files for Chromium.) LLVM already has a pass for inserting similar instrumentation calls to mcount(), which it does after inlining. This patch renames and extends that pass to handle calls both to mcount and the cygprofile functions, before and/or after inlining as controlled by function attributes. Differential Revision: https://reviews.llvm.org/D39287 llvm-svn: 318195
* [OPENMP] Fix DSA analysis for threadprivates after deserialization.Alexey Bataev2017-11-142-4/+13
| | | | | | | If threadprivate vaible is deserialized, it is not marked as threadprivate in DSAStack. llvm-svn: 318194
* [SLPVectorizer] Failure to beneficially vectorize 'copyable' elements in ↵Dinar Temirbulatov2017-11-143-272/+438
| | | | | | | | | | | | | | | | | | | | | | | | | | | integer binary ops. Patch tries to improve vectorization of the following code: void add1(int * __restrict dst, const int * __restrict src) { *dst++ = *src++; *dst++ = *src++ + 1; *dst++ = *src++ + 2; *dst++ = *src++ + 3; } Allows to vectorize even if the very first operation is not a binary add, but just a load. Fixed issues related to previous commit. Reviewers: spatel, mzolotukhin, mkuper, hfinkel, RKSimon, filcab, ABataev Reviewed By: ABataev, RKSimon Subscribers: llvm-commits, RKSimon Differential Revision: https://reviews.llvm.org/D28907 llvm-svn: 318193
* [llvm-objcopy] Improve command line option help messagesJake Ehrlich2017-11-141-5/+6
| | | | | | | | | | I was being inconsistent with the way I was capitalizing help messages for command line options. Additionally --remove-section wasn't using value_desc even though it benefited from it. Differential Revision: https://reviews.llvm.org/D39978 llvm-svn: 318190
* AMDGPU: Error on stack size overflowMatt Arsenault2017-11-143-6/+26
| | | | llvm-svn: 318189
* [SystemZ] Do not crash when selecting an OR of two constantsUlrich Weigand2017-11-142-2/+21
| | | | | | | | | | | In rare cases, common code will attempt to select an OR of two constants. This confuses the logic in splitLargeImmediate, causing an internal error during isel. Fixed by simply leaving this case to common code to handle. This fixes PR34859. llvm-svn: 318187
* [AArch64] Adjust the cost model for Exynos M1 and M2Evandro Menezes2017-11-141-11/+9
| | | | | | Fix the modeling of loads and stores of registers pairs. llvm-svn: 318186
* [llvm-strings] Add support for the -a/--all optionsMartin Storsjo2017-11-142-0/+9
| | | | | | | | | | | | They don't actually change nay behaviour, as llvm-strings currently checks the whole object without looking at individual sections anyway. This allows using llvm-strings in a context that explicitly passes the -a option. Differential Revision: https://reviews.llvm.org/D40020 llvm-svn: 318185
* [ARM, AArch64] Fix an assert message, Darwin isn't the only target ↵Martin Storsjo2017-11-142-2/+4
| | | | | | supporting TLS. NFC. llvm-svn: 318184
* Simplify irreducible loop metadata test code.Hiroshi Yamauchi2017-11-142-111/+17
| | | | | | | | | | | | | | | | Summary: Shorten the irreducible loop metadata test code by removing insignificant instructions. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40043 llvm-svn: 318182
* [CodeGenPrepare] Disable div bypass when working set size is huge.Easwaran Raman2017-11-142-3/+32
| | | | | | | | | | | | | | | | | | | Summary: Bypass of slow divs based on operand values is currently disabled for -Os. Do the same when profile summary is available and the working set size of the application is huge. This is similar to how loop peeling is guarded by hasHugeWorkingSetSize. In the div bypass case, the generated extra code (and the extra branch) tendss to outweigh the benefits of the bypass. This results in noticeable performance improvement on an internal application. Reviewers: davidxl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39992 llvm-svn: 318179
* [SystemZ] Fix invalid codegen using RISBMux on out-of-range bitsUlrich Weigand2017-11-142-1/+513
| | | | | | | | Before using the 32-bit RISBMux set of instructions we need to verify that the input bits are actually within range of the 32-bit instruction. This fixer PR35289. llvm-svn: 318177
* Set hasSideEffects=0 for ↵Alex Bradbury2017-11-142-5/+10
| | | | | | | | | | | | | | | | | | TargetOpcode::{CFI_INSTRUCTION,EH_LABEL,GC_LABEL,ANNOTATION_LABEL} D37065 (committed as rL317674) explicitly set hasSideEffects for all TargetOpcode::* instructions where it was inferred previously. This is a follow-up to that patch, setting hasSideEffects=0 for CFI_INSTRUCTION, EH_LABEL, GC_LABEL and ANNOTATION_LABEL. All LLVM tests pass after this change. This patch also modifies MachineInstr::isLabel returns true for a TargetOpcode::ANNOTATION_LABEL, which ensures that an annotation label won't be incorrectly considered safe to move. Differential Revision: https://reviews.llvm.org/D39941 llvm-svn: 318174
* Mark intrinsics operating on the whole warp as IntrInaccessibleMemOnlyArtem Belevich2017-11-143-38/+49
| | | | | | | It's needed to model the fact that they do access data from other threads in a warp and thus can't be CSE'd. llvm-svn: 318173
* [mips] Simplify test for 5.0.1 (NFC)Simon Dardis2017-11-141-18/+9
| | | | | | | Simplify testing that an emergency spill slot is used when MSA is used so that it can be included in the 5.0.1 release. llvm-svn: 318172
* Adjust test after r318159Adam Nemet2017-11-141-0/+1
| | | | llvm-svn: 318170
* [refactor][extract] avoid extracting expressions from types in functionsAlex Lorenz2017-11-142-4/+20
| | | | llvm-svn: 318169
* [llvm-objcopy] Add -strip-non-alloc option to remove all non-allocated sectionsJake Ehrlich2017-11-142-0/+37
| | | | | | | | | This change adds a new flag not present in GNU objcopy that we call --strip-non-alloc. Differential Revision: https://reviews.llvm.org/D39926 llvm-svn: 318168
* CodeGen: Fix TargetLowering::LowerCallTo for sret value typeYaxun Liu2017-11-142-4/+4
| | | | | | | | | | | | | | TargetLowering::LowerCallTo assumes that sret value type corresponds to a pointer in default address space, which is incorrect, since sret value type should correspond to a pointer in alloca address space, which may not be the default address space. This causes assertion for amdgcn target in amdgiz environment. This patch fixes that. Differential Revision: https://reviews.llvm.org/D39996 llvm-svn: 318167
* [llvm-objcopy] Support the rest of the ELF formatsJake Ehrlich2017-11-144-6/+103
| | | | | | | | | | | | We haven't been supporting anything but ELF64LE since the start. Luckily this was always accounted for and the change is pretty trivial. B35281 requests this change for ELF32LE. This change adds support for ELF32LE, ELF64BE, and ELF32BE with all supported features that already existed for ELF64LE. Differential Revision: https://reviews.llvm.org/D39977 llvm-svn: 318166
* [PredicateInfo] Stable sort ValueDFS to remove non-deterministic orderingMandeep Singh Grang2017-11-141-1/+1
| | | | | | | | | | | | | | Summary: This fixes failure in Transforms/Util/PredicateInfo/testandor.ll uncovered by D39245. Reviewers: dberlin Reviewed By: dberlin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39630 llvm-svn: 318165
OpenPOWER on IntegriCloud