Sanjay Patel [Sat, 25 Apr 2020 15:25:03 +0000 (11:25 -0400)]
[InstCombine] generalize canonicalization of masked equality comparisons
(X | MaskC) == C --> (X & ~MaskC) == C ^ MaskC
(X | MaskC) != C --> (X & ~MaskC) != C ^ MaskC
We have more analyis for 'and' patterns and already lean this way
in the existing code, so this should be neutral or better in IR.
If this does not do as well in codegen, the problem already exists
and we should fix that based on target costs/heuristics.
http://volta.cs.utah.edu:8080/z/oP3ecL
define void @src(i8 %x, i8 %OrC, i8 %C, i1* %p0, i1* %p1) {
%or = or i8 %x, %OrC
%eq = icmp eq i8 %or, %C
store i1 %eq, i1* %p0
%ne = icmp ne i8 %or, %C
store i1 %ne, i1* %p1
ret void
}
define void @tgt(i8 %x, i8 %OrC, i8 %C, i1* %p0, i1* %p1) {
%NotOrC = xor i8 %OrC, -1
%a = and i8 %x, %NotOrC
%NewC = xor i8 %C, %OrC
%eq = icmp eq i8 %a, %NewC
store i1 %eq, i1* %p0
%ne = icmp ne i8 %a, %NewC
store i1 %ne, i1* %p1
ret void
}
Florian Hahn [Sat, 25 Apr 2020 14:02:02 +0000 (15:02 +0100)]
[DSE] Add stat for remaining stores after DSE.
Using the existing NumFastStores statistic can be misleading when
comparing the impact of DSE patches.
For example, consider the case where a store gets removed from a
function before it is inlined into another function. A less
powerful DSE might only remove the store from functions it has
been inlined into, which will result in more stores being removed, but
no difference in the actual number of stores after DSE.
The new stat provides the absolute number of stores surviving after
DSE.
Reviewers: dmgreen, bryant, asbirlea, jfb
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D78830
Sanjay Patel [Fri, 24 Apr 2020 18:34:02 +0000 (14:34 -0400)]
[InstCombine] add tests for icmp with bitmask logic op; NFC
Juneyoung Lee [Sun, 15 Mar 2020 03:09:58 +0000 (12:09 +0900)]
[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into more constants/instructions
Summary:
This patch helps isGuaranteedNotToBeUndefOrPoison look into more constants and instructions (bitcast/alloca/gep/fcmp).
To deal with bitcast, Depth is added to isGuaranteedNotToBeUndefOrPoison.
This patch is splitted from https://reviews.llvm.org/D75808.
Checked with Alive2
Reviewers: reames, jdoerfert
Reviewed By: jdoerfert
Subscribers: sanwou01, spatel, llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76010
Florian Hahn [Sat, 25 Apr 2020 12:39:27 +0000 (13:39 +0100)]
[ValueLattice] Merging unknown with empty CR is unknown.
Currently an unknown/undef value is marked as overdefined when merged
with an empty range. An empty range can occur in unreachable/dead code.
When merging the new unknown state (= no value known yet) with an empty
range, there still isn't any information about the value yet and we can
stay in unknown.
This gives a few nice improvements on the number of instructions removed
by IPSCCP:
Same hash: 170 (filtered out)
Remaining: 67
Metric: sccp.IPNumInstRemoved
Program base patch diff
test-suite...rks/FreeBench/mason/mason.test 3.00 6.00 100.0%
test-suite...nchmarks/McCat/18-imp/imp.test 3.00 5.00 66.7%
test-suite...C/CFP2000/179.art/179.art.test 2.00 3.00 50.0%
test-suite...ijndael/security-rijndael.test 2.00 3.00 50.0%
test-suite...ks/Prolangs-C/agrep/agrep.test 40.00 58.00 45.0%
test-suite...ce/Applications/Burg/burg.test 26.00 37.00 42.3%
test-suite...cCat/03-testtrie/testtrie.test 3.00 4.00 33.3%
test-suite...Source/Benchmarks/sim/sim.test 29.00 36.00 24.1%
test-suite.../Applications/spiff/spiff.test 9.00 11.00 22.2%
test-suite...s/FreeBench/neural/neural.test 5.00 6.00 20.0%
test-suite...pplications/treecc/treecc.test 66.00 79.00 19.7%
test-suite...langs-C/football/football.test 85.00 101.00 18.8%
test-suite...ce/Benchmarks/PAQ8p/paq8p.test 90.00 105.00 16.7%
test-suite...oxyApps-C++/miniFE/miniFE.test 37.00 43.00 16.2%
test-suite...rks/FreeBench/pifft/pifft.test 26.00 30.00 15.4%
test-suite...lications/sqlite3/sqlite3.test 481.00 548.00 13.9%
test-suite...marks/7zip/7zip-benchmark.test 4875.00 5522.00 13.3%
test-suite.../CINT2000/176.gcc/176.gcc.test 1117.00 1197.00 7.2%
test-suite...0.perlbench/400.perlbench.test 1618.00 1732.00 7.0%
Reviewers: efriedma, nikic, davide
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D78667
Igor Kudrin [Sat, 25 Apr 2020 11:58:00 +0000 (18:58 +0700)]
[LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used.
When discarding local symbols with --discard-all or --discard-locals,
the ones which are used in relocations should be preserved. LLD used
the simplest approach and just ignored those switches when -r or
--emit-relocs was specified.
The patch implements handling the --discard-* switches for the cases
when relocations are kept by identifying used local symbols and allowing
removing only unused ones. This makes the behavior of LLD compatible
with GNU linkers.
Differential Revision: https://reviews.llvm.org/D77807
Igor Kudrin [Sat, 25 Apr 2020 11:26:03 +0000 (18:26 +0700)]
[DebugInfo][DWARF64] Fix dumping pre-standard .debug_str_offsets.dwo sections.
The sizes of offsets in the `.debug_str_offsets.dwo` section depend on
the format of compilation or type units referencing them: 4 bytes for
DWARF32 units and 8 bytes for DWARF64 ones. The fix uses parsed units
to determine the actual size of offsets in the corresponding part of
the `.debug_str_offsets.dwo` section.
Differential Revision: https://reviews.llvm.org/D78555
Igor Kudrin [Sat, 25 Apr 2020 10:23:56 +0000 (17:23 +0700)]
[llvm-dwp] Refuse DWARFv5 input DWP files.
The library can parse DWARFv5 unit index sections of DWP files, but
llvm-dwp is not ready to process them. Refuse such input files for now.
Differential Revision: https://reviews.llvm.org/D77143
Simon Pilgrim [Sat, 25 Apr 2020 11:57:53 +0000 (12:57 +0100)]
MCJIT.h - reduce unnecessary includes to forward declarations. NFC.
Kadir Cetinkaya [Sat, 25 Apr 2020 11:55:38 +0000 (13:55 +0200)]
[clangd] Disable dependency-output lit test on windows
Kadir Cetinkaya [Fri, 24 Apr 2020 21:52:19 +0000 (23:52 +0200)]
[clangd] Disable all dependency outputs
Summary: Fixes https://github.com/clangd/clangd/issues/322
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78833
Tyker [Fri, 24 Apr 2020 20:34:55 +0000 (22:34 +0200)]
[AssumeBundles] Refactor asssume builder
Summary:
refactor assume bulider for the next patch.
the assume builder now generate only one assume per attribute kind and per value they are on. to do this it takes the highest. this is desirable because currently, for all attributes the higest value is the most valuable.
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78013
Benjamin Kramer [Sat, 25 Apr 2020 09:50:52 +0000 (11:50 +0200)]
Give helpers internal linkage. NFC.
Ehud Katz [Sat, 25 Apr 2020 08:44:47 +0000 (11:44 +0300)]
[CodeExtractor] Fix extraction of a value used only by intrinsics outside of region
We should only skip `lifetime` and `dbg` intrinsics when searching for users.
Other intrinsics are legit users that can't be ignored.
Without this fix, the testcase would result in an invalid IR. `memcpy`
will have a reference to the, now, external value (local to the
extracted loop function).
Fix PR42194
Differential Revision: https://reviews.llvm.org/D78749
Rob Suderman [Sat, 25 Apr 2020 08:23:28 +0000 (01:23 -0700)]
Memory corruption issure for DenseStringElementsAttr
Summary: There was a memory corruption issue where the lifespan of the ArrayRef<StringRef> would fail. Directly passing the data will avoid the issue.
Reviewers: rriddle
Reviewed By: rriddle
Subscribers: mehdi_amini, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78850
Rob Suderman [Sat, 25 Apr 2020 08:17:09 +0000 (01:17 -0700)]
[mlir] Add support for sparse DenseStringElements.
Summary: Added support for sparse strings elements. This is a follow up from the original DenseStringElements.
Differential Revision: https://reviews.llvm.org/D78844
Uday Bondhugula [Sat, 25 Apr 2020 04:11:23 +0000 (09:41 +0530)]
[MLIR]][DOC] Fix dimension validity constraint in affine dialect doc
Fix affine dialect documentation on valid dimensional values: they also
include affine.parallel IVs.
Differential Revision: https://reviews.llvm.org/D78855
Craig Topper [Sat, 25 Apr 2020 06:11:17 +0000 (23:11 -0700)]
[X86] Add cost model tests for truncating from v2i8/v4i8/v8i8/v16i8 to vXi1. NFC
Craig Topper [Sat, 25 Apr 2020 05:12:21 +0000 (22:12 -0700)]
[CallSite removal] Rename CallSite.h to AbstractCallSite.h. NFC
The CallSite and ImmutableCallSite were removed in a previous
commit. So rename the file to match the remaining class and
the name of the cpp that implements it.
Pratyai Mazumder [Fri, 24 Apr 2020 20:27:54 +0000 (13:27 -0700)]
[SanitizerCoverage] Add `__sanitizer_cov_bool_flag_init` as the weak interface functions.
Summary:
Following up the discussion on D77638 (and following rGd6cfed6060c283dc4a6bf9ca294dcd732e8b9f72
as example), defining `__sanitizer_cov_bool_flag_init` as the weak interface
functions in various compiler-rt/ files.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: dberris, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D77857
Andrew Browne [Sat, 25 Apr 2020 02:23:31 +0000 (19:23 -0700)]
Revert "ADT: SmallVector size/capacity use word-size integers when elements are small"
This reverts commit
b5f0eae1dc3c09c020cdf9d07238dec9acdacf5f.
clang-cmake-armv7-quick/llvm/llvm/lib/Support/SmallVector.cpp:81:22:
error: duplicate explicit instantiation of 'SmallVectorBase<unsigned int>'
Craig Topper [Sat, 25 Apr 2020 01:56:33 +0000 (18:56 -0700)]
[X86] Improve accuracy of cost for v16i64->v16i8 truncate with avx512.
The 2 vpmovqds are only 1 uop each.
Stella Laurenzo [Mon, 20 Apr 2020 02:12:39 +0000 (19:12 -0700)]
Define SDBM key methods in its own cpp file.
Summary:
* Follows the convention of the tablegen-generated dialects.
* Ensures that vague linkage rules place the definitions in the dialect's object files.
* Allows code that uses RTTI to include MLIR headers (compiled without RTTI) without
type_info link errors.
Reviewers: rriddle
Reviewed By: rriddle
Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78039
Andrew Browne [Wed, 22 Apr 2020 06:32:31 +0000 (23:32 -0700)]
ADT: SmallVector size/capacity use word-size integers when elements are small
SmallVector currently uses 32bit integers for size and capacity to reduce
sizeof(SmallVector). This limits the number of elements to UINT32_MAX.
For a SmallVector<char>, this limits the SmallVector size to only 4GB.
Buffering bitcode output uses SmallVector<char>, but needs >4GB output.
This changes SmallVector size and capacity to conditionally use word-size
integers if the element type is small (<4 bytes). For larger elements types,
the vector size can reach ~16GB with 32bit size.
Making this conditional on the element type provides both the smaller
sizeof(SmallVector) for larger types which are unlikely to grow so large,
and supports larger capacities for smaller element types.
Adrian Prantl [Sat, 25 Apr 2020 01:37:45 +0000 (18:37 -0700)]
Invert an #ifdef in XcodeSDKModuleTests.cpp and actually make the test work.
Carl Ritson [Sat, 25 Apr 2020 00:34:46 +0000 (09:34 +0900)]
[SlotIndexes] Add insertion point for insertMBBIntoMaps
Summary:
Allow the specification of an insertion point (MachineInstr)
for insertMBBIntoMaps.
This makes it possible to update slot indexes and live intervals
when trivially splitting a block by specifying the point of the
split as the insertion point for the block in the maps.
Reviewers: qcolombet, arsenm, kariddi, MaskRay, tpr
Reviewed By: kariddi
Subscribers: MatzeB, wdng, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78417
Eric Schweitz [Fri, 24 Apr 2020 23:24:40 +0000 (16:24 -0700)]
[flang] Support for making unique internal names.
Differential Revision: https://reviews.llvm.org/D78838
Sam McCall [Wed, 22 Apr 2020 12:24:12 +0000 (14:24 +0200)]
[clangd] Look for compilation database in `build` subdirectory of parents.
Summary:
This matches the conventional location of cmake build directories.
It also allows creating a `build` symlink, which seems more flexible than the
compile_commands.json symlinks.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78629
Benjamin Kramer [Sat, 25 Apr 2020 00:00:54 +0000 (02:00 +0200)]
Replicate attributes on definition to make MSVC less noisy
warning C4565: 'llvm::allocate_buffer': redefinition; the symbol was previously declared with __declspec(restrict)
Adrian Prantl [Fri, 24 Apr 2020 23:49:37 +0000 (16:49 -0700)]
Add a getter to retrieve the XcodeSDK from Module and unit-test it. (NFC)
This API is used by swift-lldb.
(Recommit with missing file git-added)
Adrian Prantl [Fri, 24 Apr 2020 23:59:48 +0000 (16:59 -0700)]
Revert "Add a getter to retrieve the XcodeSDK from Module and unit-test it. (NFC)"
This reverts commit
345df863ce649860bea9040fe5c2f10780d29080.
(Forgot to git-add the new file)
Adrian Prantl [Fri, 24 Apr 2020 23:49:37 +0000 (16:49 -0700)]
Add a getter to retrieve the XcodeSDK from Module and unit-test it. (NFC)
This API is used by swift-lldb.
Volodymyr Sapsai [Thu, 23 Apr 2020 23:37:16 +0000 (16:37 -0700)]
[ObjC generics] Fix not inheriting type bounds in categories/extensions.
When a category/extension doesn't repeat a type bound, corresponding
type parameter is substituted with `id` when used as a type argument. As
a result, in the added test case it was causing errors like
> type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T'
We are already checking that type parameters should be consistent
everywhere (see `checkTypeParamListConsistency`) and update
`ObjCTypeParamDecl` to have correct underlying type. And when we use the
type parameter as a method return type or a method parameter type, it is
substituted to the bounded type. But when we use the type parameter as a
type argument, we check `ObjCTypeParamType` that wasn't updated and
remains `id`.
Fix by updating not only `ObjCTypeParamDecl` UnderlyingType but also
TypeForDecl as we use the underlying type to create a canonical type for
`ObjCTypeParamType` (see `ASTContext::getObjCTypeParamType`).
This is a different approach to fixing the issue. The previous one was
02c2ab3d8872416589bd1a6ca3dfb96ba373a3b9 which was reverted in
4c539e8da1b3de38a53ef3f7497f5c45a3243b61. The problem with the previous
approach was that `ObjCTypeParamType::desugar` was returning underlying
type for `ObjCTypeParamDecl` without applying any protocols stored in
`ObjCTypeParamType`. It caused inconsistencies in comparing types before
and after desugaring.
Re-applying after fixing intermittent test failures.
rdar://problem/
54329242
Reviewed By: erik.pilkington
Differential Revision: https://reviews.llvm.org/D72872
Sean Silva [Fri, 24 Apr 2020 22:54:22 +0000 (15:54 -0700)]
[shape] Add inferReturnTypes to a couple ops.
- ShapeOfOp
- BroadcastOp
Differential Revision: https://reviews.llvm.org/D78822
Sean Silva [Fri, 24 Apr 2020 22:54:04 +0000 (15:54 -0700)]
[shape] More constant folding
- shape split_at
- shape.broadcast
- shape.concat
- shape.to_extent_tensor
Differential Revision: https://reviews.llvm.org/D78821
Eric Christopher [Fri, 24 Apr 2020 23:02:52 +0000 (16:02 -0700)]
Fix a dangling-gsl warning and avoid transitively including string.
Adrian Prantl [Fri, 24 Apr 2020 22:47:42 +0000 (15:47 -0700)]
Relax testcase. The Clang module debug info may return additional
attributes such as __unsafe_unretained that is not present in DWARF.
Sean Silva [Fri, 24 Apr 2020 21:03:44 +0000 (14:03 -0700)]
[shape] Basic constant folding.
- Implement a first constant fold for shape.shape_of (more ops coming in subsequent patches)
- Implement the right builder interfaces for ShapeType and other types
- Splits shape.constant into shape.const_size and shape.const_shape which plays better with dyn_cast and building vs one polymorphic op.
Also, fix the RUN line in ops.mlir to properly verify round-tripping.
Craig Topper [Fri, 24 Apr 2020 22:46:31 +0000 (15:46 -0700)]
[X86][ArgumentPromotion] Allow Argument Promotion if caller and callee disagree on 512-bit vectors support if the arguments are scalar.
If one of caller/callee has disabled ZMM registers due to
prefer-vector-width=256, we were previously
disabling argument promotion as the ABI might be incompatible since
one side will split 512-bit vectors in this case.
But if we can see that the types are all scalar this shouldn't be
a problem.
This patch assumes that pointer element type reflects the type that
the argument will be promoted to.
Differential Revision: https://reviews.llvm.org/D78770
Stephen Neuendorffer [Fri, 24 Apr 2020 22:28:16 +0000 (15:28 -0700)]
[MLIR] Fix typo in lib/Interfaces
This broke BUILD_SHARED_LIBS=on
Adrian Prantl [Fri, 24 Apr 2020 22:21:54 +0000 (15:21 -0700)]
Disable path-sensitive test on Windows.
Snehasish Kumar [Fri, 24 Apr 2020 21:35:19 +0000 (14:35 -0700)]
Use .text.unlikely and .text.eh prefixes for MachineBasicBlock sections.
Summary:
Instead of adding a ".unlikely" or ".eh" suffix for machine basic blocks,
this change updates the behaviour to use an appropriate prefix
instead. This allows lld to group basic block sections together
when -z,keep-text-section-prefix is specified and matches the behaviour
observed in gcc.
Reviewers: tmsriram, mtrofin, efriedma
Reviewed By: tmsriram, efriedma
Subscribers: eli.friedman, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78742
Fangrui Song [Fri, 24 Apr 2020 20:39:02 +0000 (13:39 -0700)]
[XRay] Change Sled.Function to PC-relative for sled version 2 and make llvm-xray support sled version 2 addresses
Follow-up of D78082 and D78590.
Otherwise, because xray_instr_map is now read-only, the absolute
relocation used for Sled.Function will cause a text relocation.
peter klausler [Fri, 24 Apr 2020 00:07:45 +0000 (17:07 -0700)]
[flang] More CHARACTER runtime support + unit test
Summary:
This is a continuation of development of the runtime support library's functions for
CHARACTER data; specifically, it implements CHARACTER comparisons.
It includes a new unit test, and moves an #include directive to the
runtime's unit testing main header.
Reviewers: tskeith, sscalpone, DavidTruby, jdoerfert
Reviewed By: tskeith
Subscribers: flang-commits, mgorny, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D78826
Amara Emerson [Fri, 24 Apr 2020 19:05:44 +0000 (12:05 -0700)]
[AArch64][GlobalISel] Fix sub-64b stack parameter passing on Darwin.
A previous bug fix for varargs introduced a regression where we would
incorrectly widen some stores to memory when passing i8/i16 parameters on the
stack. This didn't show up seemingly because it only happens when there is
no signext/zeroext parameter attribute, which I think for Darwin clang adds.
Swift however seems to be a different story, and a plain anyext on the parameter
triggered the bug.
To fix this, I've added a new ValueHandler::assignValueToAddress type override
which lets us distiguish between varargs and fixed args (we still need this
widening behaviour for varargs to fix the original bug in 2018).
rdar://
61353552
Louis Dionne [Fri, 24 Apr 2020 20:52:50 +0000 (16:52 -0400)]
[libc++] NFC: Expose a top-level parseScript function in the new format
Jean-Michel Gorius [Fri, 24 Apr 2020 20:52:31 +0000 (22:52 +0200)]
[llvm][CodeGen] Check for memory instructions when querying for alias status
Summary:
Add a check to make sure that MachineInstr::mayAlias returns prematurely if at least one of its instruction parameters does not access memory. This prevents calls to TargetInstrInfo::areMemAccessesTriviallyDisjoint with incompatible instructions.
A side effect of this change is to render the mayAlias helper in the AArch64 load/store optimizer obsolete. We can now directly call the MachineInstr::mayAlias member function.
Reviewers: hfinkel, t.p.northover, mcrosier, eli.friedman, efriedma
Reviewed By: efriedma
Subscribers: efriedma, kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78823
Yaxun (Sam) Liu [Fri, 24 Apr 2020 20:41:24 +0000 (16:41 -0400)]
David Blaikie [Thu, 23 Apr 2020 18:46:38 +0000 (11:46 -0700)]
Fix bug in SmallBitVector::find_next_unset
Summary: find_next_unset was returning size() instead of -1 in small-mode, when no unset bits are found.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D77985
Alexandre Ganea [Fri, 24 Apr 2020 20:43:10 +0000 (16:43 -0400)]
Revert "[MC] Fix quadratic behavior in addPendingLabel()"
This reverts commit
e98f73a629075ae3b9c4d5317bead5a122d69865.
Craig Topper [Fri, 24 Apr 2020 20:02:15 +0000 (13:02 -0700)]
[CostModel][X86][ARM] Teach getCastInstrCost to include the splitting factor when handling operations that type legalize to the same number of subvectors or scalar components
Previously, we just always returned 1. But that ignores that we have to do the operation for each subvector or scalar component.
Differential Revision: https://reviews.llvm.org/D78824
Ron Lieberman [Fri, 24 Apr 2020 20:33:37 +0000 (15:33 -0500)]
[libomptarget] Initialize reference parameter IsNew within Device::getOrAllocTgtPtr
The two locals IsNew and Pointer_IsNew were uninitialized at declaration, and then passed by
reference to Device.getOrAllocTgtPtr which in turn did not assign on all
paths within the function. This resulted in occasional runtime failures in one application.
Device::getOrAllocTgtPtr will now initialize IsNew to false on entry to function.
Differential Revision: https://reviews.llvm.org/D78744
Pengxuan Zheng [Fri, 24 Apr 2020 20:15:51 +0000 (13:15 -0700)]
[RISCV] Add instruction definition for dret
Summary:
The instruction dret is used to return from debug mode and is defined in the
RISC-V debug mode spec.
https://github.com/riscv/riscv-opcodes/blob/master/opcodes-system
Reviewers: apazos, asb, lenary, luismarques
Reviewed By: apazos
Subscribers: jfb, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78583
Tyker [Fri, 24 Apr 2020 19:38:12 +0000 (21:38 +0200)]
[NFC] Refactor SimplifyCFG to make propagating information easier.
Reviewers: jdoerfert
Reviewed By: jdoerfert
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77742
Adrian Prantl [Wed, 22 Apr 2020 21:22:54 +0000 (14:22 -0700)]
Add an internal bit to the XcodeSDK class.
For developing the OS itself there exists an "internal" variant of
each SDK. This patch adds support for these SDK directories to the
XcodeSDK class.
Differential Revision: https://reviews.llvm.org/D78675
Matt Arsenault [Fri, 24 Apr 2020 14:06:00 +0000 (10:06 -0400)]
AMDGPU: Break read2/write2 search range on a memory fence
This is to fix performance regressions introduced by
86c944d790728891801778b8d98c2c65a83f36a5.
The old search would collect all potentially mergeable instructions in
the entire block. In this case, the same address is written in
multiple places in the block on the other side of a fence. When sorted
by offset, the two unmergeable, identical addresses would be next to
each other and the merge would give up.
Break the search space when we encounter an instruction we won't be
able to merge across. This will keep the identical addresses in
different merge attempts.
This may also improve compile time by reducing the merge list size.
Jonas Devlieghere [Fri, 24 Apr 2020 19:50:06 +0000 (12:50 -0700)]
[lldb/Driver] Remove level of indentation (NFC)
Use an early return for when we couldn't create a pipe to source the
commands.
Louis Dionne [Fri, 24 Apr 2020 19:44:02 +0000 (15:44 -0400)]
[libc++] Properly import lit.formats from the new format
Fangrui Song [Fri, 24 Apr 2020 17:41:28 +0000 (10:41 -0700)]
[gold] Simplify with StringRef::consume_front. NFC
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D78819
River Riddle [Fri, 24 Apr 2020 19:25:05 +0000 (12:25 -0700)]
[mlir][DialectConversion] Add support for properly tracking replaceUsesOfBlockArgument
The current implementation of this method performs the replacement directly, and thus doesn't support proper back tracking.
Differential Revision: https://reviews.llvm.org/D78790
Louis Dionne [Fri, 24 Apr 2020 15:30:10 +0000 (11:30 -0400)]
[libc++] NFC: Refactor the new format substitutions into its own method
This way, we can reuse the substitution logic in the new DSL.
Lei Zhang [Fri, 24 Apr 2020 19:33:03 +0000 (15:33 -0400)]
Revert "[mlir][drr] NFC: avoid SmallVector when collecting substitution values"
This reverts commit
2f8b164ca220f8cd29d70c8359ed91e8fb8d9959, which
causes a breakage on Clang 5.
Louis Dionne [Fri, 24 Apr 2020 19:29:42 +0000 (15:29 -0400)]
[libc++] Get rid of pipe in command to check whether verify is supported
Alexandre Ganea [Fri, 24 Apr 2020 19:28:01 +0000 (15:28 -0400)]
[llvm-cov] Prevent llvm-cov from using too many threads
As reported here: https://reviews.llvm.org/D75153#1987272
Before, each instance of llvm-cov was creating one thread per hardware core, which wasn't needed probably because the number of inputs were small. This was probably causing a thread rlimit issue on large core count systems.
After this patch, the previous behavior is restored (to what was before rG8404aeb5):
If --num-threads is not specified, we create one thread per input, up to num.cores.
When specified, --num-threads indicates any number of threads, with no upper limit.
Differential Revision: https://reviews.llvm.org/D78408
River Riddle [Fri, 24 Apr 2020 19:18:18 +0000 (12:18 -0700)]
[mlir][DictionaryAttr] Add a new getWithSorted and use it when possible
The elements of a DictionaryAttr are sorted by name. In many situations, e.g NamedAttributeList, we can guarantee that the elements are sorted on construction and remove the need to perform extra checks. In places with lots of calls to attribute methods, this leads to a good performance improvement.
Differential Revision: https://reviews.llvm.org/D78781
Petr Hosek [Wed, 22 Apr 2020 23:41:03 +0000 (16:41 -0700)]
[Fuchsia] Build compiler-rt builtins for 32-bit x86
While we don't support 32-bit architectures in Fuchsia, these are needed
in the early boot phase on x86, so we build just these to satisfy that
use case.
Differential Revision: https://reviews.llvm.org/D78687
Michael Liao [Fri, 24 Apr 2020 19:03:48 +0000 (15:03 -0400)]
Fix `-Wparentheses` warnings. NFC.
Yaxun (Sam) Liu [Fri, 24 Apr 2020 18:57:10 +0000 (14:57 -0400)]
Revert "[CUDA][HIP] Fix host/device based overload resolution"
This reverts commit
c77a4078e01033aa2206c31a579d217c8a07569b.
Yaxun (Sam) Liu [Sat, 11 Apr 2020 16:45:00 +0000 (12:45 -0400)]
[CUDA][HIP] Fix host/device based overload resolution
Currently clang fails to compile the following CUDA program in device compilation:
__host__ int foo(int x) {
return 1;
}
template<class T>
__device__ __host__ int foo(T x) {
return 2;
}
__device__ __host__ int bar() {
return foo(1);
}
__global__ void test(int *a) {
*a = bar();
}
This is due to foo is resolved to the __host__ foo instead of __device__ __host__ foo.
This seems to be a bug since __device__ __host__ foo is a viable callee for foo whereas
clang is unable to choose it.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D77954
Adrian Prantl [Fri, 24 Apr 2020 18:11:23 +0000 (11:11 -0700)]
Delete cargo-cult code that doesn't affect the testsuite.
Louis Dionne [Fri, 24 Apr 2020 18:47:09 +0000 (14:47 -0400)]
[libc++] Quietly scp tarballs over with the remote executor
Otherwise, the progress-meter is printed.
Tyker [Fri, 24 Apr 2020 17:46:18 +0000 (19:46 +0200)]
[AssumeBundles] Use assume bundles in isKnownNonZero
Summary: Use nonnull and dereferenceable from an assume bundle in isKnownNonZero
Reviewers: jdoerfert, nikic, lebedev.ri, reames, fhahn, sstefan1
Reviewed By: jdoerfert
Subscribers: fhahn, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76149
Vedant Kumar [Fri, 24 Apr 2020 18:16:43 +0000 (11:16 -0700)]
AArch64: Remove reversedInstructionsWithoutDebug helper
When using reversedInstructionsWithoutDebug to construct a range from a
pair of MachineInstrBundleIterators, the range unexpectedly leaves out an
element. This results in mis-optimization as @mstorsjo points out in
https://reviews.llvm.org/D78157.
The problem is that when we convert a MachineInstrBundleIterator to a
reverse iterator, the result gets incremented:
MachineInstrBundleIterator(++I.getReverse())
The comment there explains that the "resulting iterator will dereference
... to the previous node, which is somewhat unexpected; but converting
the two endpoints in a range will give the same range in reverse". This
makes it hard to understand what reversedInstructionsWithoutDebug will
do: I've removed the helper to prevent similar mistakes in the future.
Adrian Prantl [Thu, 16 Apr 2020 22:20:07 +0000 (15:20 -0700)]
Add Objective-C property accessors loaded from Clang module DWARF to lookup
This patch fixes a bug when synthesizing an ObjC property from
-gmodules debug info. Because the method declaration that is injected
via the non-modular property implementation is not added to the
ObjCInterfaceDecl's lookup pointer, a second copy of the accessor
would be generated when processing the ObjCPropertyDecl. This can be
avoided by finding the existing method decl in
ClangExternalASTSourceCallbacks::FindExternalVisibleDeclsByName() and
adding it to the LookupPtr.
Differential Revision: https://reviews.llvm.org/D78333
Mircea Trofin [Fri, 24 Apr 2020 05:59:12 +0000 (22:59 -0700)]
[llvm][NFC][CallSite] Remove {Immutable}CallSite and CallSiteBase
Reviewers: dblaikie, craig.topper
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78794
Craig Topper [Fri, 24 Apr 2020 17:59:20 +0000 (10:59 -0700)]
[X86] Don't use types when getting the intrinsic declaration for x86_avx512_mask_vcvtph2ps_512.
This intrinsic isn't overloaded so we should query with types.
Doing so causes the backend to miss the intrinsic and not codegen it.
This eventually leads to a linker error.
Sanjay Patel [Fri, 24 Apr 2020 17:47:56 +0000 (13:47 -0400)]
[InstCombine] regenerate test checks; NFC
Values named 'tmp' can cause problems for the auto-generated check script.
Stella Laurenzo [Thu, 23 Apr 2020 23:52:16 +0000 (16:52 -0700)]
Add constructor to ShapedTypeComponents for unranked with element type.
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, Kayjukh, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78774
Simon Pilgrim [Fri, 24 Apr 2020 17:36:12 +0000 (18:36 +0100)]
[cmake] Add headers in TextAPI/Elf and TextAPI/MachO subdirectories
Simon Pilgrim [Fri, 24 Apr 2020 17:16:53 +0000 (18:16 +0100)]
AllocationOrder.h - split MCRegisterInfo.h include. NFC.
We only require to include MCRegister.h and SmallVector.h.
Christopher Tetreault [Fri, 24 Apr 2020 17:11:24 +0000 (10:11 -0700)]
[SVE] Do not store a bool for Scalable in VectorType
Summary:
- Whether or not a vector is scalable is a function of its type. Since
all instances of ScalableVectorType will have true for this value and
all instances of FixedVectorType will have false for this value, there
is no need to store it as a class member.
Reviewers: efriedma, fpetrogalli, kmclaughlin
Reviewed By: fpetrogalli
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78601
Craig Topper [Thu, 23 Apr 2020 23:54:07 +0000 (16:54 -0700)]
[CostModel][X86] Account for splitting cost when vector zext/sext type legalize to the same size vector.
Florian Hahn [Fri, 24 Apr 2020 16:48:03 +0000 (17:48 +0100)]
[DSE,MSSA] Improve debug output (NFC).
This patch slightly improves the formatting of the debug output, adds a
few missing outputs and makes some existing outputs more consistent with
the rest.
Alexandre Ganea [Fri, 24 Apr 2020 16:48:39 +0000 (12:48 -0400)]
[MC] Fix quadratic behavior in addPendingLabel()
Differential Revision: https://reviews.llvm.org/D78775
Samuel Thibault [Fri, 24 Apr 2020 01:23:44 +0000 (18:23 -0700)]
[Driver] Move GCC multilib/multiarch paths support from Linux.cpp to Gnu.cpp
The current code for GNU/Linux is actually completely generic, and can be moved to ToolChains/Gnu.cpp,
so that it can benefit GNU/Hurd and GNU/kFreeBSD.
Reviewed By: MaskRay, phosek
Differential Revision: https://reviews.llvm.org/D73845
Mircea Trofin [Mon, 20 Apr 2020 18:05:29 +0000 (11:05 -0700)]
[llvm][NFC] Factor out inlining pipeline as a module pipeline.
Summary:
This simplifies testing in scenarios where we want to set up module-wide
analyses for inlining. The patch enables treating inlining and its
function cleanups, as a module pass. The alternative would be for tests
to describe the pipeline, which is tedious and adds maintenance
overhead.
Reviewers: davidxl, dblaikie, jdoerfert, sstefan1
Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78512
Florian Hahn [Thu, 23 Apr 2020 19:37:26 +0000 (20:37 +0100)]
[DSE,MSSA] Skip checking write clobber for DomAccess (NFC).
There is no need to check if the starting access for is a write clobber
and all of its uses have already been checked.
Sanjay Patel [Fri, 24 Apr 2020 15:59:15 +0000 (11:59 -0400)]
[InstCombine] intersect FMF when reassociating FP min/max intrinsics
As discussed in PR45478:
https://bugs.llvm.org/show_bug.cgi?id=45478
...propagating FMF from the outer (second) call is not correct,
so intersect them instead.
I suspect we could do better (see TODO comment), but mismatched
FMF is probably too rare to care about.
Differential Revision: https://reviews.llvm.org/D78631
Jonas Devlieghere [Fri, 24 Apr 2020 16:03:51 +0000 (09:03 -0700)]
[lldb/Core] Don't crash in GetSoftwareBreakpointTrapOpcode for unknown triples
This patch ensures we don't crash in GetSoftwareBreakpointTrapOpcode for
not-yet-supported architectures but rather continue with degraded
behavior.
I found the issue in the context of an invalid ArchSpec, which should be
handled further up the chain. In this patch I've also added an assert to
cover that, so we can still catch those issues.
Differential revision: https://reviews.llvm.org/D78588
Pablo Barrio [Tue, 10 Mar 2020 15:05:49 +0000 (15:05 +0000)]
[AArch64] Allow PAC mnemonics in the HINT space with PAC disabled
Summary:
It is important to emit HINT instructions instead of PAC ones when
PAC is disabled. This allows compatibility with other assemblers
(e.g. GAS). This was implemented in commit
da33762de853.
Still, developers of assembly code will want to write code that is
compatible with both pre- and post-PAC CPUs. They could use HINT
mnemonics, but the new mnemonics are a lot more readable (e.g.
paciaz instead of hint #24), and they will result in the same
encodings. So, while LLVM should not *emit* the new mnemonics when
PAC is disabled, this patch will at least make LLVM *accept*
assembly code that uses them.
Reviewers: danielkiss, chill, olista01, LukeCheeseman, simon_tatham
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78372
Nico Weber [Fri, 24 Apr 2020 15:52:42 +0000 (11:52 -0400)]
[gn build] update two comments
Fangrui Song [Tue, 21 Apr 2020 18:31:15 +0000 (11:31 -0700)]
[XRay] Change ARM/AArch64/powerpc64le to use version 2 sled (PC-relative address)
Follow-up of D78082 (x86-64).
This change avoids dynamic relocations in `xray_instr_map` for ARM/AArch64/powerpc64le.
MIPS64 cannot use 64-bit PC-relative addresses because R_MIPS_PC64 is not defined.
Because MIPS32 shares the same code, for simplicity, we don't use PC-relative addresses for MIPS32 as well.
Tested on AArch64 Linux and ppc64le Linux.
Reviewed By: ianlevesque
Differential Revision: https://reviews.llvm.org/D78590
Simon Pilgrim [Fri, 24 Apr 2020 15:21:25 +0000 (16:21 +0100)]
ValueEnumerator.h - remove unnecessary includes. NFC.
The forward declarations are already present in the header.
Simon Pilgrim [Fri, 24 Apr 2020 15:19:00 +0000 (16:19 +0100)]
MipsTargetStreamer.h - remove unnecessary MipsABIFlagsSection forward declaration. NFC.
We need to include MipsABIFlagsSection.h already
Simon Pilgrim [Fri, 24 Apr 2020 15:18:10 +0000 (16:18 +0100)]
AMDGPUArgumentUsageInfo.h - cleanup includes and forward declarations. NFC.
Reduce Function.h include to (already existing) forward declaration.
Remove unused GCNSubtarget/TargetMachine forward declarations.
LLVM GN Syncbot [Fri, 24 Apr 2020 15:06:14 +0000 (15:06 +0000)]
[gn build] Port
7aaff8fd2da
Nico Weber [Fri, 24 Apr 2020 15:04:22 +0000 (11:04 -0400)]
[gn build] minimally merge
67b2dbd5a33583fe148fd12 even more
Louis Dionne [Fri, 24 Apr 2020 15:04:18 +0000 (11:04 -0400)]
[libc++] NFC: Remove unused parameters in the new test format
Luke Geeson [Thu, 9 Apr 2020 22:00:22 +0000 (23:00 +0100)]
[ARM] Armv8.6-a Matrix Mul cmd line support
This patch upstreams support for the Armv8.6-a Matrix Multiplication
Extension. A summary of the features can be found here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
This patch includes:
- Command line options to enable these features with +i8mm, +f32mm, or f64mm
Note: +f32mm and +f64mm are optional and so are not enabled by default
This is part of a patch series, starting with BFloat16 support and
the other components in the armv8.6a extension (in previous patches
linked in phabricator)
Based on work by:
- Luke Geeson
- Oliver Stannard
- Luke Cheeseman
Reviewers: t.p.northover, DavidSpickett
Reviewed By: DavidSpickett
Subscribers: DavidSpickett, ostannard, kristof.beyls, danielkiss,
cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77875
Luke Geeson [Thu, 9 Apr 2020 20:38:37 +0000 (21:38 +0100)]
[AArch32] Armv8.6a Matrix Mul Assembly Parsing Support
This patch upstreams support for the Armv8.6-a Matrix Multiplication
Extension. A summary of the features can be found here:
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/arm-architecture-developments-armv8-6-a
This patch includes:
- Assembly support for AArch32 and Assembly Parsing
D77872 has already added the MC representations of the instructions so that
they can be used in code gen; this patch fills in the details needed to
make assembly parsing work, and adds tests for asm and disasm
This is part of a patch series, starting with BFloat16 support and
the other components in the armv8.6a extension (in previous patches
linked in phabricator)
Based on work by:
- Luke Geeson
- Oliver Stannard
- Luke Cheeseman
Reviewers: t.p.northover, simon_tatham
Reviewed By: simon_tatham
Subscribers: simon_tatham, ostannard, kristof.beyls, hiraditya,
danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77874