summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Merge some of the autoupgrade handling for masked intrinsics that just ↵Craig Topper2018-04-091-170/+149
| | | | | | | | need to upgrade to an unmasked version plus a select. NFCI These are were previously grouped in small groups of similarish intrinsics. But all the intrinsics have the same number of arguments and the same order. So we can move them all into a larger group for handling. llvm-svn: 329549
* Remove immediate dominator heuristic for error block detection.Michael Kruse2018-04-097-136/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the heuristic in - Polly :: lib/Support/ScopHelper.cpp The heuristic forces blocks that directly follow a loop header to not to be considered error blocks. It was introduced in r249611 with the following commit message: > This replaces the support for user defined error functions by a > heuristic that tries to determine if a call to a non-pure function > should be considered "an error". If so the block is assumed not to be > executed at runtime. While treating all non-pure function calls as > errors will allow a lot more regions to be analyzed, it will also > cause us to dismiss a lot again due to an infeasible runtime context. > This patch tries to limit that effect. A non-pure function call is > considered an error if it is executed only in conditionally with > regards to a cheap but simple heuristic. In the code below `CCK_Abort2()` would be considered as an error block, but not `CCK_Abort1()` due to this heuristic. ``` for (int i = 0; i < n; i+=1) { if (ErrorCondition1) CCK_Abort1(); // No __attribute__((noreturn)) if (ErrorCondition2) CCK_Abort2(); // No __attribute__((noreturn)) } ``` This does not seem useful. Checking error conditions in the beginning of some work is quite common. It causes a switch default-case to be not considered an error block in SPEC's cactuBSSN. The comment justifying the heuristic mentions a "load", which does not seem to be applicable here. It has been proposed to remove the heuristic. In addition, the patch fixes the following test cases: - Polly :: ScopDetect/mod_ref_read_pointer.ll - Polly :: ScopInfo/max-loop-depth.ll - Polly :: ScopInfo/mod_ref_access_pointee_arguments.ll - Polly :: ScopInfo/mod_ref_read_pointee_arguments.ll - Polly :: ScopInfo/mod_ref_read_pointer.ll - Polly :: ScopInfo/mod_ref_read_pointers.ll The test cases failed after removing the heuristic. Differential Revision: https://reviews.llvm.org/D45274 Contributed-by: Lorenzo Chelini <l.chelini@icloud.com> llvm-svn: 329548
* [IRCE] Relax restriction on collected range checksMax Kazantsev2018-04-093-15/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In IRCE, we have a very old legacy check that works when we collect comparisons that we treat as range checks. It ensures that the value against which the indvar is compared is loop invariant and is also positive. This latter condition remained there since the times when IRCE was only able to handle signed latch comparison. As the optimization evolved, it now learned how to intersect signed or unsigned ranges, and this logic has no reliance on the fact that the right border of each range should be positive. The old implementation of this non-negativity check was also naive enough and just looked into ranges (while most of other IRCE logic tries to use power of SCEV implications), so this check did not allow to deal with the most simple case that looks like follows: int size; // not known non-negative int length; //known non-negative; i = 0; if (size != 0) { do { range_check(i < size); range_check(i < length); ++i; } while (i < size) } In this case, even if from some dominating conditions IRCE could parse loop structure, it could only remove the range check against `length` and simply ignored the check against `size`. In this patch we remove this obsolete check. It will allow IRCE to pick comparison against `size` as a potential range check and then let Range Intersection logic decide whether it is OK to eliminate it or not. Differential Revision: https://reviews.llvm.org/D45362 Reviewed By: samparker llvm-svn: 329547
* [NFC] fix trivial typos in comments and error messageHiroshi Inoue2018-04-097-7/+7
| | | | | | "is is" -> "is", "are are" -> "are" llvm-svn: 329546
* Revert "[CMake] Use custom command and target to install libc++ headers"Petr Hosek2018-04-094-239/+40
| | | | | | This reverts commit r329544 which is failing on libcxx standalone bots. llvm-svn: 329545
* [CMake] Use custom command and target to install libc++ headersPetr Hosek2018-04-094-40/+239
| | | | | | | | | | | | | | | | | | | Using file(COPY FILE...) has several downsides. Since the file command is only executed at configuration time, any changes to headers made after the initial CMake execution are ignored. This can lead to subtle errors since the just built Clang will be using stale libc++ headers. Furthermore, since the headers are copied prior to executing the build system, this may hide missing dependencies on libc++ from other LLVM components. This changes replaces the use of file(COPY FILE...) command with a custom command and target which addresses all aforementioned issues and matches the implementation already used by other LLVM components that also install headers like Clang builtin headers. Differential Revision: https://reviews.llvm.org/D44773 llvm-svn: 329544
* [XRay][llvm+clang] Consolidate attribute list filesDean Michael Berris2018-04-0914-20/+139
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change consolidates the always/never lists that may be provided to clang to externally control which functions should be XRay instrumented by imbuing attributes. The files follow the same format as defined in https://clang.llvm.org/docs/SanitizerSpecialCaseList.html for the sanitizer blacklist. We also deprecate the existing `-fxray-instrument-always=` and `-fxray-instrument-never=` flags, in favour of `-fxray-attr-list=`. This fixes http://llvm.org/PR34721. Reviewers: echristo, vlad.tsyrklevich, eugenis Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D45357 llvm-svn: 329543
* Remove MachineLoopInfo dependency from AsmPrinter.Michael Zolotukhin2018-04-098-25/+39
| | | | | | | | | | | | | | | | | | | Summary: Currently MachineLoopInfo is used in only two places: 1) for computing IsBasicBlockInsideInnermostLoop field of MCCodePaddingContext, and it is never used. 2) in emitBasicBlockLoopComments, which is called only if `isVerbose()` is true. Despite that, we currently have a dependency on MachineLoopInfo, which makes pass manager to compute it and MachineDominator Tree. This patch removes the use (1) and makes the use (2) lazy, thus avoiding some redundant recomputations. Reviewers: opaparo, gadi.haber, rafael, craig.topper, zvi Subscribers: rengolin, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D44812 llvm-svn: 329542
* [test] Fix Container::insert(value_type const&) testsEric Fiselier2018-04-0810-405/+293
| | | | | | | | | | | Patch from Joe Loser. Several unit tests meaning to test the behavior of lvalue insertion incorrectly pass rvalues. Fixes bug PR # 27394 Reviewed as https://reviews.llvm.org/D44411 llvm-svn: 329541
* [TargetSchedule] shrink interface for init(); NFCISanjay Patel2018-04-0812-19/+16
| | | | | | | | | | The TargetSchedModel is always initialized using the TargetSubtargetInfo's MCSchedModel and TargetInstrInfo, so we don't need to extract those and pass 3 parameters to init(). Differential Revision: https://reviews.llvm.org/D44789 llvm-svn: 329540
* [X86] Add SchedWrites for CMOV and SETCC. Use them to remove InstRWs.Craig Topper2018-04-0811-92/+79
| | | | | | | | | | | | | | | | | | | Summary: Cmov and setcc previously used WriteALU, but on Intel processors at least they are more restricted than basic ALU ops. This patch adds new SchedWrites for them and removes the InstRWs. I had to leave some InstRWs for CMOVA/CMOVBE and SETA/SETBE because those have an extra uop relative to the other condition codes on Intel CPUs. The test changes are due to fixing a missing ZnAGU dependency on the memory form of setcc. Reviewers: RKSimon, andreadb, GGanesh Reviewed By: RKSimon Subscribers: GGanesh, llvm-commits Differential Revision: https://reviews.llvm.org/D45380 llvm-svn: 329539
* [X86][Znver1] Remove InstRWs for BLENDVPS/PDCraig Topper2018-04-082-16/+4
| | | | | | | | | | | | | | | | | Summary: This removes the InstRWs for BLENDVPS/PD in favor of WriteFVarBlend. The latency listed was 3 cycles but WriteFVarBlend is defined as 1 cycle latency. The 1 cycle latency matches Agner Fog's data. The patterns were missing the VEX forms which is why there are no test changes. We don't test "-mcpu=znver1 -mattr=-avx" Reviewers: RKSimon, GGanesh Reviewed By: RKSimon Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44841 llvm-svn: 329538
* [dsymutil] Don't crash on empty CUJonas Devlieghere2018-04-084-1/+38
| | | | | | Add some additional checks so we don't crash on empty compile units. llvm-svn: 329537
* [Support] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: chandlerc, jordan_rose, bkramer Reviewed By: bkramer Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45140 llvm-svn: 329536
* [PowerPC] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: hfinkel, RKSimon Reviewed By: RKSimon Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D44870 llvm-svn: 329535
* [X86] Change std::sort to llvm::sort in response to r327219Mandeep Singh Grang2018-04-081-4/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key. To make use of that infrastructure we need to invoke llvm::sort instead of std::sort. Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches. Reviewers: chandlerc, craig.topper, RKSimon Reviewed By: chandlerc, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44874 llvm-svn: 329534
* NFC: Update NewGVN invariant.group testPiotr Padlewski2018-04-081-15/+16
| | | | llvm-svn: 329533
* [llvm-mca] Simplify code. NFCAndrea Di Biagio2018-04-081-33/+26
| | | | llvm-svn: 329532
* Mark invariant.group as experimentalPiotr Padlewski2018-04-082-2/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D33235 llvm-svn: 329531
* [LIR] Reorder header. NFCXin Tong2018-04-081-1/+1
| | | | llvm-svn: 329530
* [X86] Regenerate and + immediate mask testsSimon Pilgrim2018-04-081-6/+59
| | | | | | Added i686 checks llvm-svn: 329529
* [X86][PKU] Regenerate rdpkru/wrpkru intrinsic testsSimon Pilgrim2018-04-081-16/+33
| | | | | | Added i686 checks llvm-svn: 329528
* [X86][SSE3] Regenerate mwait/monitor intrinsic testsSimon Pilgrim2018-04-081-18/+47
| | | | | | Added i686 checks llvm-svn: 329527
* NFC: delete ValueMap move ctorPiotr Padlewski2018-04-081-0/+4
| | | | llvm-svn: 329526
* DAGCombiner: Combine SDIV with non-splat vector pow2 divisorZvi Rackover2018-04-082-3598/+1380
| | | | | | | | | | | | | | | | Summary: Extend existing SDIV combine for pow2 constant divider to handle non-splat vectors of pow2 constants. Reviewers: RKSimon, craig.topper, spatel, hfinkel, efriedma Reviewed By: RKSimon Subscribers: magabari, llvm-commits Differential Revision: https://reviews.llvm.org/D42479 llvm-svn: 329525
* [X86][Btver2] Add vector extract costsSimon Pilgrim2018-04-088-54/+73
| | | | llvm-svn: 329524
* [ADT] Fix MapVector when 'Map::mapped_type != unsigned'.Eric Fiselier2018-04-082-6/+49
| | | | | | | | | | | Previously MapVector assumed `Map::mapped_type` was `unsigned`. This caused problems when using MapVector with a user-specified map where this didn't hold (For example StringMap<unsigned>). This patch adjusts MapVector to use the same type as the underlying map, avoiding reference binding errors in functions like `insert`. llvm-svn: 329523
* [LLVMTestingSupport] Add explicit linkage to LLVMSupportMichal Gorny2018-04-081-1/+4
| | | | | | | | | | Explicitly link LLVMTestingSupport library against LLVMSupport. This is necessary to fix linking errors when LLVMTestingSupport is built as a shared library (with BUILD_SHARED_LIBS=ON) and -Wl,-z,defs is used. Differential Revision: https://reviews.llvm.org/D45408 llvm-svn: 329522
* [Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-083-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple bases. Summary: Currently clang doesn't do qualified lookup when building indirect field decl references. This causes ambiguity when the field is in a base class to which there are multiple valid paths even though a qualified name is used. For example: ``` class B { protected: int i; union { int j; }; }; class X : public B { }; class Y : public B { }; class Z : public X, public Y { int a() { return X::i; } // works int b() { return X::j; } // fails }; ``` Reviewers: rsmith, aaron.ballman, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45411 llvm-svn: 329521
* Revert "[Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-082-20/+1
| | | | | | | | multiple bases." This reverts commit r329519. There are some unaddressed test failures. llvm-svn: 329520
* [Sema] Fix PR35832 - Ambiguity accessing anonymous struct/union with ↵Eric Fiselier2018-04-082-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | multiple bases. Summary: Currently clang doesn't do qualified lookup when building indirect field decl references. This causes ambiguity when the field is in a base class to which there are multiple valid paths even though a qualified name is used. For example: ``` class B { protected: int i; union { int j; }; }; class X : public B { }; class Y : public B { }; class Z : public X, public Y { int a() { return X::i; } // works int b() { return X::j; } // fails }; ``` Reviewers: rsmith, aaron.ballman, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45411 llvm-svn: 329519
* [Sema] Remove dead code in BuildAnonymousStructUnionMemberReference. NFCIEric Fiselier2018-04-081-54/+20
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch cleans up a bunch of dead or unused code in BuildAnonymousStructUnionMemberReference. The dead code was a branch that built a new CXXThisExpr when we weren't given a base object expression or base variable. However, BuildAnonymousFoo has only two callers. One of which always builds a base object expression first, the second only calls when the IndirectFieldDecl is not a C++ class member. Even within C this branch seems entirely unused. I tried diligently to write a test which hit it with no success. This patch removes the branch and replaces it with an assertion that we were given either a base object expression or a base variable. Reviewers: rsmith, aaron.ballman, majnemer, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45410 llvm-svn: 329518
* [Sema] Fix PR22637 - IndirectFieldDecl's discard qualifiers during template ↵Eric Fiselier2018-04-083-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instantiation. Summary: Currently Clang fails to propagate qualifiers from the `CXXThisExpr` to the rebuilt `FieldDecl` for IndirectFieldDecls. For example: ``` template <class T> struct Foo { struct { int x; }; int y; void foo() const { static_assert(__is_same(int const&, decltype((y)))); static_assert(__is_same(int const&, decltype((x)))); // assertion fails } }; template struct Foo<int>; ``` The fix is to delegate rebuilding of the MemberExpr to `BuildFieldReferenceExpr` which correctly propagates the qualifiers. Reviewers: rsmith, lebedev.ri, aaron.ballman, bkramer, rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45412 llvm-svn: 329517
* [DAGCombiner] Fold (zext (and/or/xor (shl/shr (load x), cst), cst))Guozhi Wei2018-04-074-0/+231
| | | | | | | | | | | | | | In our real world application, we found the following optimization is missed in DAGCombiner (zext (and/or/xor (shl/shr (load x), cst), cst)) -> (and/or/xor (shl/shr (zextload x), (zext cst)), (zext cst)) If the user of original zext is an add, it may enable further lea optimization on x86. This patch add a new function CombineZExtLogicopShiftLoad to do this optimization. Differential Revision: https://reviews.llvm.org/D44402 llvm-svn: 329516
* [libclang] Add clang_File_tryGetRealPathNameFangrui Song2018-04-074-0/+31
| | | | | | | | | | | | | | | | | | | | | Summary: clang_getFileName() may return a path relative to WorkingDir. On Arch Linux, during clang_indexTranslationUnit(), clang_getFileName() on CXIdxIncludedIncludedFileInfo::file may return "/../lib64/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/string", for `#include <string>`. I presume WorkingDir is somehow changed to /usr/lib or /usr/include and clang_getFileName() returns a path relative to WorkingDir. clang_File_tryGetRealPathName() returns "/usr/include/c++/7.3.0/string" which is more useful for the indexer in this case. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42893 llvm-svn: 329515
* Revert "Followup for r329293: Temporarily disable the breaking test on windows."Philip Pfaffe2018-04-071-2/+1
| | | | | | This reverts commit r329393 / b52ba35e7759cd4002221be1dbb63ec80fde21ec. llvm-svn: 329514
* Generalize the swiftcall API since being passed indirectly isn'tJohn McCall2018-04-072-10/+14
| | | | | | C++-specific anymore. llvm-svn: 329513
* [Driver] Update GCC libraries detection logic for Gentoo.Manoj Gupta2018-04-0716-23/+145
| | | | | | | | | | | | | | | | | Summary: 1. Find GCC's LDPATH from the actual GCC config file. 2. Avoid picking libraries from a similar named tuple if the exact tuple is installed. Reviewers: mgorny, chandlerc, thakis, rnk Reviewed By: mgorny, rnk Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D45233 llvm-svn: 329512
* [X86] Regenerate atom pshufb testSimon Pilgrim2018-04-071-3/+5
| | | | llvm-svn: 329511
* [X86] Combine vXi64 multiplies to MULDQ/MULUDQ during DAG combine instead of ↵Craig Topper2018-04-076-51/+69
| | | | | | | | lowering. Previously we used a custom lowering for this because of the AVX1 splitting requirement. But we can do the split during DAG combine if we check the types and subtarget llvm-svn: 329510
* [DAGCombiner] Add a combine to turn a build vector of zero extends of ↵Craig Topper2018-04-073-28/+73
| | | | | | extract vector elts into a vector zero extend and possibly an extract subvector. llvm-svn: 329509
* Allow equality comparisons between block pointers andJohn McCall2018-04-072-0/+64
| | | | | | | | block-pointer-compatible ObjC object pointer types. Patch by Dustin Howett! llvm-svn: 329508
* [llgo] Move SetSubprogramRobert Widmann2018-04-072-3/+4
| | | | | | | | | | | | | | Summary: Fixes the bots - I moved LLVMSetSubprogram into the DIBuilder bindings, so the Go bindings need to move as well. Reviewers: whitequark Reviewed By: whitequark Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45402 llvm-svn: 329505
* [CostModel][X86] Regenerate vector reduction cost tests with ↵Simon Pilgrim2018-04-071-104/+987
| | | | | | | update_analyze_test_checks.py NOTE: We're only really interested in the extractelement cost (which represents the entire reduction). llvm-svn: 329504
* [InstCombine] simplify code that propagates FMF; NFCSanjay Patel2018-04-071-12/+4
| | | | llvm-svn: 329503
* [CostModel][X86] Regenerate vector select cost tests with ↵Simon Pilgrim2018-04-071-59/+73
| | | | | | update_analyze_test_checks.py llvm-svn: 329502
* [InstCombine] add/move tests for fsub folds; NFCSanjay Patel2018-04-072-24/+100
| | | | | | | | There are a pair of folds that try to merge fneg into fsub with an intervening cast, but as shown in the FIXME tests, they can create extra instructions. llvm-svn: 329501
* [CostModel][X86] Regenerate vector integer truncation cost tests with ↵Simon Pilgrim2018-04-071-118/+191
| | | | | | update_analyze_test_checks.py llvm-svn: 329500
* [CostModel][X86] Regenerate silvermont (and added goldmont) cost tests with ↵Simon Pilgrim2018-04-071-46/+357
| | | | | | update_analyze_test_checks.py llvm-svn: 329499
* [CostModel][X86] Fix v32i16/v64i8 SETCC costs on AVX512BW targetsSimon Pilgrim2018-04-072-4/+13
| | | | llvm-svn: 329498
OpenPOWER on IntegriCloud