summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix buildbot error in SIRegisterInfo.cpp.Zinovy Nis2019-10-201-3/+4
| | | | llvm-svn: 375373
* [InstCombine] Add tests for uadd/sub.sat(a, b) == 0; NFCNikita Popov2019-10-201-0/+44
| | | | llvm-svn: 375372
* [InstCombine] Shift amount reassociation in shifty sign bit test (PR43595)Roman Lebedev2019-10-204-32/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This problem consists of several parts: * Basic sign bit extraction - `trunc? (?shr %x, (bitwidth(x)-1))`. This is trivial, and easy to do, we have a fold for it. * Shift amount reassociation - if we have two identical shifts, and we can simplify-add their shift amounts together, then we likely can just perform them as a single shift. But this is finicky, has one-use restrictions, and shift opcodes must be identical. But there is a super-pattern where both of these work together. to produce sign bit test from two shifts + comparison. We do indeed already handle this in most cases. But since we get that fold transitively, it has one-use restrictions. And what's worse, in this case the right-shifts aren't required to be identical, and we can't handle that transitively: If the total shift amount is bitwidth-1, only a sign bit will remain in the output value. But if we look at this from the perspective of two shifts, we can't fold - we can't possibly know what bit pattern we'd produce via two shifts, it will be *some* kind of a mask produced from original sign bit, but we just can't tell it's shape: https://rise4fun.com/Alive/cM0 https://rise4fun.com/Alive/9IN But it will *only* contain sign bit and zeros. So from the perspective of sign bit test, we're good: https://rise4fun.com/Alive/FRz https://rise4fun.com/Alive/qBU Superb! So the simplest solution is to extend `reassociateShiftAmtsOfTwoSameDirectionShifts()` to also have a sudo-analysis mode that will ignore extra-uses, and will only check whether a) those are two right shifts and b) they end up with bitwidth(x)-1 shift amount and return either the original value that we sign-checking, or null. This does not have any functionality change for the existing `reassociateShiftAmtsOfTwoSameDirectionShifts()`. All that being said, as disscussed in the review, this yet again increases usage of instsimplify in instcombine as utility. Some day that may need to be reevaluated. https://bugs.llvm.org/show_bug.cgi?id=43595 Reviewers: spatel, efriedma, vsk Reviewed By: spatel Subscribers: xbolva00, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68930 llvm-svn: 375371
* [ConstantRange] makeGuaranteedNoWrapRegion(): `shl` supportRoman Lebedev2019-10-202-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If all the shifts amount are already poison-producing, then we can add more poison-producing flags ontop: https://rise4fun.com/Alive/Ocwi Otherwise, we should only consider the possible range of shift amts that don't result in poison. For unsigned range not not overflow, we must not shift out any set bits, and the actual limit for `x` can be computed by backtransforming the maximal value we could ever get out of the `shl` - `-1` through `lshr`. If the `x` is any larger than that then it will overflow. Likewise for signed range, but just in signed domain.. This is based on the general idea outlined by @nikic in https://reviews.llvm.org/D68672#1714990 Reviewers: nikic, sanjoy Reviewed By: nikic Subscribers: hiraditya, llvm-commits, nikic Tags: #llvm Differential Revision: https://reviews.llvm.org/D69217 llvm-svn: 375370
* [ConstantRange] Optimize nowrap region test, remove redundant tests; NFCNikita Popov2019-10-201-103/+23
| | | | | | | | | | | | Enumerate one less constant range in TestNoWrapRegionExhaustive, which was unnecessary. This allows us to bump the bit count from 3 to 5 while keeping reasonable timing. Drop four tests for multiply nowrap regions, as these cover subsets of the exhaustive test. They do use a wider bitwidth, but I don't think it's worthwhile to have them additionally now. llvm-svn: 375369
* AMDGPU: Increase vcc liveness scan thresholdMatt Arsenault2019-10-206-16/+12
| | | | | | | Avoids a test regression in a future patch. Also add debug printing on this case, so I waste less time debugging folds in the future. llvm-svn: 375367
* AMDGPU: Split flat offsets that don't fit in DAGMatt Arsenault2019-10-2012-376/+443
| | | | | | | | | | We handle it this way for some other address spaces. Since r349196, SILoadStoreOptimizer has been trying to do this. This is after SIFoldOperands runs, which can change the addressing patterns. It's simpler to just split this earlier. llvm-svn: 375366
* AMDGPU: Fix missing OPERAND_IMMEDIATEMatt Arsenault2019-10-201-12/+13
| | | | llvm-svn: 375365
* AMDGPU: Add baseline tests for flat offset splittingMatt Arsenault2019-10-202-0/+2916
| | | | llvm-svn: 375364
* AMDGPU: Don't re-get the subtargetMatt Arsenault2019-10-201-21/+9
| | | | | | It's already available in the class. llvm-svn: 375363
* [AMDGPU] Fix assertion due to initializer listYaxun Liu2019-10-202-25/+36
| | | | | | | | | | | | | Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable. For most targets, GetAddrOfGlobalVar returns either the llvm global variable or a bitcast of the llvm global variable. However, for AMDGPU target, GetAddrOfGlobalVar returns the addrspace cast or addrspace cast plus bitcast of the llvm global variable. To get the llvm global variable, these casts need to be stripped, otherwise there is assertion. This patch fixes that. Differential Revision: https://reviews.llvm.org/D69129 llvm-svn: 375362
* [yaml2obj][obj2yaml] - Do not create a symbol table by default.George Rimar2019-10-2062-87/+178
| | | | | | | | | | | | | | | | | | This patch tries to resolve problems faced in D68943 and uses some of the code written by Konrad Wilhelm Kleine in that patch. Previously, yaml2obj tool always created a .symtab section. This patch changes that. With it we only create it when have a "Symbols:" tag in the YAML document or when we need to create it because it is used by another section(s). obj2yaml follows the new behavior and does not print "Symbols:" anymore when there is no symbol table. Differential revision: https://reviews.llvm.org/D69041 llvm-svn: 375361
* [LLD][ELF] - Update tests after yaml2obj tool update.George Rimar2019-10-202-2/+0
| | | | | | yaml2obj doesn't create .symtab by default anymore. llvm-svn: 375360
* Fix minor warning in DWARFVerifier.Zinovy Nis2019-10-201-2/+2
| | | | llvm-svn: 375357
* AMDGPU: Don't error on calls to null or undefMatt Arsenault2019-10-203-0/+64
| | | | | | Calls to constants should probably be generally handled. llvm-svn: 375356
* eliminate nontrivial Reset(...) from TypedPythonObjectLawrence D'Anna2019-10-194-46/+78
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This deletes `Reset(...)`, except for the no-argument form `Reset()` from `TypedPythonObject`, and therefore from `PythonString`, `PythonList`, etc. It updates the various callers to use assignment, `As<>`, `Take<>`, and `Retain<>`, as appropriate. followon to https://reviews.llvm.org/D69080 Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69133 llvm-svn: 375350
* [SCEV] Simplify umin/max of zext and sext of the same valuePhilip Reames2019-10-195-49/+82
| | | | | | | | This is a common idiom which arises after induction variables are widened, and we have two or more exit conditions. Interestingly, we don't have instcombine or instsimplify support for this either. Differential Revision: https://reviews.llvm.org/D69006 llvm-svn: 375349
* [X86] Pulled out helper to decode target shuffle element sentinel values to ↵Simon Pilgrim2019-10-191-13/+22
| | | | | | | | 'Zeroable' known undef/zero bits. NFCI. Renamed 'resolveTargetShuffleAndZeroables' to 'resolveTargetShuffleFromZeroables' to match. llvm-svn: 375348
* [TargetLowering][DAGCombine][MSP430] add/use hook for Shift Amount Threshold ↵Sanjay Patel2019-10-195-26/+31
| | | | | | | | | | | | | | | | | (1/2) Provides a TLI hook to allow targets to relax the emission of shifts, thus enabling codegen improvements on targets with no multiple shift instructions and cheap selects or branches. Contributes to a Fix for PR43559: https://bugs.llvm.org/show_bug.cgi?id=43559 Patch by: @joanlluch (Joan LLuch) Differential Revision: https://reviews.llvm.org/D69116 llvm-svn: 375347
* [ARM] Add dependency on GlobalISel for unit tests to fix shared libs buildNemanja Ivanovic2019-10-191-0/+1
| | | | | | | | | | | The unit test uses GlobalISel but the dependency is not listed in the CMakeLists.txt file which causes failures in shared libs build with GCC. This just adds the dependency. Differential revision: https://reviews.llvm.org/D69064 llvm-svn: 375346
* [MSP430] Shift Amount Threshold in DAGCombine (Baseline Tests); NFCSanjay Patel2019-10-191-0/+178
| | | | | | | | Patch by: @joanlluch (Joan LLuch) Differential Revision: https://reviews.llvm.org/D69099 llvm-svn: 375345
* [X86][SSE] lowerV16I8Shuffle - tryToWidenViaDuplication - undef unpack argsSimon Pilgrim2019-10-198-300/+309
| | | | | | tryToWidenViaDuplication lowers using the shuffle_v8i16(unpack_v16i8(shuffle_v8i16(x),shuffle_v8i16(x))) pattern, but the unpack only needs the even/odd 16i8 args if the original v16i8 shuffle mask references the even/odd elements - which isn't true for many extension style shuffles. llvm-svn: 375342
* [X86][SSE] LowerUINT_TO_FP_i64 - only use HADDPD for size/fast-hopsSimon Pilgrim2019-10-195-44/+79
| | | | | | | | We were always generating a single source HADDPD, but really we should only do this if shouldUseHorizontalOp says its a good idea. Differential Revision: https://reviews.llvm.org/D69175 llvm-svn: 375341
* Refine check for `_LIBCPP_C_HAS_NO_GETS` on FreeBSDDimitry Andric2019-10-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: In D67316 we added `_LIBCPP_C_HAS_NO_GETS` to signal that the C library does not provide `gets()`, and added a test for FreeBSD 13 or higher, using the compiler-defined `__FreeBSD__` macro. Unfortunately this did not work that well for FreeBSD's own CI process, since the gcc compilers used for some architectures define `__FreeBSD__` to match the build host, not the target. Instead, we should use the `__FreeBSD_version` macro from the userland header `<osreldate.h>`, which is more fine-grained. See also <https://reviews.freebsd.org/D22034>. Reviewers: EricWF, mclow.lists, emaste, ldionne Reviewed By: emaste, ldionne Subscribers: dexonsmith, bsdjhb, krytarowski, christof, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D69174 llvm-svn: 375340
* Explicit in the doc the current list of projects (with easy copy and paste)Sylvestre Ledru2019-10-191-0/+2
| | | | llvm-svn: 375339
* Revert "[Implicit Modules] Add -cc1 option -fmodules-strict-context-hash ↵Michael J. Spencer2019-10-195-85/+1
| | | | | | | | which includes search paths and diagnostics." and "[Docs] Fix header level." The test doesn't work on Windows. I'll fix it and recommit later. llvm-svn: 375338
* Make it clear in the doc that 'all' in LLVM_ENABLE_PROJECTS does install ALL ↵Sylvestre Ledru2019-10-191-1/+1
| | | | | | projects llvm-svn: 375337
* convert LLDBSwigPythonCallTypeScript to ArgInfo::max_positional_argsLawrence D'Anna2019-10-193-5/+32
| | | | | | | | | | | | | | | | | | | | Summary: This patch converts another user of ArgInfo::count over to use ArgInfo::max_positional_args instead. I also add a test to make sure both documented signatures for python type formatters work. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69153 llvm-svn: 375334
* [LLDB] bugfix: command script add -f doesn't work for some callablesLawrence D'Anna2019-10-197-19/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When users define a debugger command from python, they provide a callable object. Because the signature of the function has been extended, LLDB needs to inspect the number of parameters the callable can take. The rule it was using to decide was weird, apparently not tested, and giving wrong results for some kinds of python callables. This patch replaces the weird rule with a simple one: if the callable can take 5 arguments, it gets the 5 argument version of the signature. Otherwise it gets the old 4 argument version. It also adds tests with a bunch of different kinds of python callables with both 4 and 5 arguments. Reviewers: JDevlieghere, clayborg, labath, jingham Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D69014 llvm-svn: 375333
* [analyzer] PR43551: Do not dereferce void* in UndefOrNullArgVisitor.Artem Dergachev2019-10-192-8/+29
| | | | | | | | Patch by Kristóf Umann! Differential Revision: https://reviews.llvm.org/D68591 llvm-svn: 375329
* [analyzer] Fix a crash on tracking Objective-C 'self' as a control dependency.Artem Dergachev2019-10-192-7/+44
| | | | | | | 'self' was previously never tracked, but now it can be tracked because it may be part of a condition. llvm-svn: 375328
* [Docs] Fix header level.Michael J. Spencer2019-10-191-1/+1
| | | | llvm-svn: 375327
* Add -Wbitwise-conditional-parentheses to warn on mixing '|' and '&' with "?:"Richard Trieu2019-10-195-2/+41
| | | | | | | | | | | | | | | | | | | | Extend -Wparentheses to cover mixing bitwise-and and bitwise-or with the conditional operator. There's two main cases seen with this: unsigned bits1 = 0xf0 | cond ? 0x4 : 0x1; unsigned bits2 = cond1 ? 0xf0 : 0x10 | cond2 ? 0x5 : 0x2; // Intended order of evaluation: unsigned bits1 = 0xf0 | (cond ? 0x4 : 0x1); unsigned bits2 = (cond1 ? 0xf0 : 0x10) | (cond2 ? 0x5 : 0x2); // Actual order of evaluation: unsigned bits1 = (0xf0 | cond) ? 0x4 : 0x1; unsigned bits2 = cond1 ? 0xf0 : ((0x10 | cond2) ? 0x5 : 0x2); Differential Revision: https://reviews.llvm.org/D66043 llvm-svn: 375326
* Avoid including CodeView/SymbolRecord.h from MCStreamer.hReid Kleckner2019-10-196-53/+62
| | | | | | Move the types needed out so they can be forward declared instead. llvm-svn: 375325
* [Implicit Modules] Add -cc1 option -fmodules-strict-context-hash which ↵Michael J. Spencer2019-10-195-1/+85
| | | | | | | | includes search paths and diagnostics. Differential Revision: https://reviews.llvm.org/D68528 llvm-svn: 375322
* AMDGPU: Remove optnone from a testMatt Arsenault2019-10-191-3/+1
| | | | | | | | | It's not clear why the test had this. I'm unable to break the original case with the original patch reverted with or without optnone. This avoids a failure in a future commit. llvm-svn: 375321
* Prune a LegacyDivergenceAnalysis and MachineLoopInfo include eachReid Kleckner2019-10-1926-7/+31
| | | | | | Now X86ISelLowering doesn't depend on many IR analyses. llvm-svn: 375320
* Prune Analysis includes from SelectionDAG.hReid Kleckner2019-10-1913-40/+44
| | | | | | Only forward declarations are needed here. Follow-on to r375311. llvm-svn: 375319
* New tautological warning for bitwise-or with non-zero constant always true.Richard Trieu2019-10-198-9/+102
| | | | | | | | | | | | | | | | | | Taking a value and the bitwise-or it with a non-zero constant will always result in a non-zero value. In a boolean context, this is always true. if (x | 0x4) {} // always true, intended '&' This patch creates a new warning group -Wtautological-bitwise-compare for this warning. It also moves in the existing tautological bitwise comparisons into this group. A few other changes were needed to the CFGBuilder so that all bool contexts would be checked. The warnings in -Wtautological-bitwise-compare will be off by default due to using the CFG. Fixes: https://bugs.llvm.org/show_bug.cgi?id=42666 Differential Revision: https://reviews.llvm.org/D66046 llvm-svn: 375318
* [profile] Use -fPIC -shared in a test instead of -dynamiclibVedant Kumar2019-10-191-1/+1
| | | | | | | This is more portable than -dynamiclib. Also, fix the path to an input file that broke when the test was moved in r375315. llvm-svn: 375317
* Move endian constant from Host.h to SwapByteOrder.h, prune includeReid Kleckner2019-10-1919-37/+47
| | | | | | | | | | | | | | Works on this dependency chain: ArrayRef.h -> Hashing.h -> --CUT-- Host.h -> StringMap.h / StringRef.h ArrayRef is very popular, but Host.h is rarely needed. Move the IsBigEndianHost constant to SwapByteOrder.h. Clients of that header are more likely to need it. llvm-svn: 375316
* [profile] Disable instrprof-get-filename-merge-mode.c on WindowsVedant Kumar2019-10-191-0/+0
| | | | | | | The Windows bots are failing with: clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument] llvm-svn: 375315
* Sema: Create a no-op implicit cast for lvalue function conversions.Peter Collingbourne2019-10-196-40/+62
| | | | | | | | | | This fixes an assertion failure in the case where an implicit conversion for a function call involves an lvalue function conversion, and makes the AST for initializations involving implicit lvalue function conversions more accurate. Differential Revision: https://reviews.llvm.org/D66437 llvm-svn: 375313
* Skip (more) PExpect tests under ASAN, I can't get them to work reliably.Adrian Prantl2019-10-191-0/+3
| | | | llvm-svn: 375312
* Prune two MachineInstr.h includes, fix up depsReid Kleckner2019-10-1923-36/+52
| | | | | | | | | | MachineInstr.h included AliasAnalysis.h, which includes a world of IR constructs mostly unneeded in CodeGen. Prune it. Same for DebugInfoMetadata.h. Noticed with -ftime-trace. llvm-svn: 375311
* [clang][driver] Print compilation phases with indentation.Michael Liao2019-10-191-5/+24
| | | | | | | | | | | | Reviewers: tra, sfantao, echristo Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69124 llvm-svn: 375310
* [hip][cuda] Fix the extended lambda name mangling issue.Michael Liao2019-10-199-38/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - HIP/CUDA host side needs to use device kernel symbol name to match the device side binaries. Without a consistent naming between host- and device-side compilations, it's risky that wrong device binaries are executed. Consistent naming is usually not an issue until unnamed types are used, especially the lambda. In this patch, the consistent name mangling is addressed for the extended lambdas, i.e. the lambdas annotated with `__device__`. - In [Itanium C++ ABI][1], the mangling of the lambda is generally unspecified unless, in certain cases, ODR rule is required to ensure consisent naming cross TUs. The extended lambda is such a case as its name may be part of a device kernel function, e.g., the extended lambda is used as a template argument and etc. Thus, we need to force ODR for extended lambdas as they are referenced in both device- and host-side TUs. Furthermore, if a extended lambda is nested in other (extended or not) lambdas, those lambdas are required to follow ODR naming as well. This patch revises the current lambda mangle numbering to force ODR from an extended lambda to all its parent lambdas. - On the other side, the aforementioned ODR naming should not change those lambdas' original linkages, i.e., we cannot replace the original `internal` with `linkonce_odr`; otherwise, we may violate ODR in general. This patch introduces a new field `HasKnownInternalLinkage` in lambda data to decouple the current linkage calculation based on mangling number assigned. [1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html Reviewers: tra, rsmith, yaxunl, martong, shafik Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68818 llvm-svn: 375309
* [analyzer] Specify the C++ standard in more tests.Artem Dergachev2019-10-1929-42/+42
| | | | | | Makes life easier for downstream developers with different default standard. llvm-svn: 375308
* P1152R4: Fix deprecation warnings in libc++ testsuite and in uses of ↵Richard Smith2019-10-194-8/+31
| | | | | | | | | | | | | | | | is_invocable that would internally conjure up a deprecated function type. Summary: The implementation of P1152R4 in Clang has resulted in some deprecation warnings appearing in the libc++ and libc++abi test suite. Fix or suppress these warnings. Reviewers: mclow.lists, EricWF Subscribers: christof, ldionne, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D68879 llvm-svn: 375307
* [c++20] Add rewriting from comparison operators to <=> / ==.Richard Smith2019-10-1921-199/+966
| | | | | | | | | | | | | | | | | This adds support for rewriting <, >, <=, and >= to a normal or reversed call to operator<=>, for rewriting != to a normal or reversed call to operator==, and for rewriting <=> and == to reversed forms of those same operators. Note that this is a breaking change for various C++17 code patterns, including some in use in LLVM. The most common patterns (where an operator== becomes ambiguous with a reversed form of itself) are still accepted under this patch, as an extension (with a warning). I'm hopeful that we can get the language rules fixed before C++20 ships, and the extension warning is aimed primarily at providing data to inform that decision. llvm-svn: 375306
OpenPOWER on IntegriCloud