Simon Pilgrim [Mon, 14 Jan 2019 15:28:53 +0000 (15:28 +0000)]
[DAGCombiner] Enable sub saturation constant folding
llvm-svn: 351072
Simon Pilgrim [Mon, 14 Jan 2019 15:08:51 +0000 (15:08 +0000)]
[X86] Add sub saturation constant folding and self tests.
llvm-svn: 351071
Simon Pilgrim [Mon, 14 Jan 2019 14:16:24 +0000 (14:16 +0000)]
[DAGCombiner] Add add/sub saturation undef handling
Match ConstantFolding.cpp:
(add_sat x, undef) -> -1
(sub_sat x, undef) -> 0
llvm-svn: 351070
Sam McCall [Mon, 14 Jan 2019 14:13:24 +0000 (14:13 +0000)]
[VFS] Fix unused variable warning. NFC
llvm-svn: 351069
Petar Avramovic [Mon, 14 Jan 2019 14:12:43 +0000 (14:12 +0000)]
[MIPS GlobalISel] Fix release build make-check after r351046
Add 'REQUIRES: asserts' to test that uses debug output in
order to fix r351046 for buildbots that use release build.
llvm-svn: 351068
Simon Pilgrim [Mon, 14 Jan 2019 14:02:24 +0000 (14:02 +0000)]
[DAGCombiner] add saturation instructions are commutative
llvm-svn: 351067
Simon Pilgrim [Mon, 14 Jan 2019 13:47:07 +0000 (13:47 +0000)]
[X86] Add add/sub saturation undef tests.
llvm-svn: 351066
Aleksandr Urakov [Mon, 14 Jan 2019 13:08:13 +0000 (13:08 +0000)]
[Core] Use the implementation method GetAddressOf in ValueObjectConstResultChild
Summary:
This patch allows to retrieve an address object for `ValueObject`'s children
retrieved through e.g. `GetChildAtIndex` or `GetChildMemberWithName`. It just
uses the corresponding method of the implementation object `m_impl` to achieve
that.
Reviewers: zturner, JDevlieghere, clayborg, labath, serge-sans-paille
Reviewed By: clayborg
Subscribers: leonid.mashinskiy, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D56147
llvm-svn: 351065
Nico Weber [Mon, 14 Jan 2019 12:50:40 +0000 (12:50 +0000)]
gn build: Add gn.py wrapper script that adds --dotfile= and --root= parameters
Since people weren't enthused about moving the .gn file to the toplevel in
D56419, here's a script to make gn at least somewhat more pleasant to invoke
(useful for gn clean, gn args --list, gn desc, etc).
Differential Revision: https://reviews.llvm.org/D56565
llvm-svn: 351064
Nico Weber [Mon, 14 Jan 2019 12:42:35 +0000 (12:42 +0000)]
clang-cl: Fix help text for /O<flags>: '/O2y-' means '/O2 /Oy-', not '/O2 /y-'
Differential Revision: https://reviews.llvm.org/D56489
llvm-svn: 351062
Nico Weber [Mon, 14 Jan 2019 12:41:13 +0000 (12:41 +0000)]
clang-cl: Align help texts for /O1 and O2
Makes it a bit easier to see what exactly the difference is.
Also use "same as" instead of "equivalent to", because that's faster to read.
Differential Revision: https://reviews.llvm.org/D56488
llvm-svn: 351061
Simon Pilgrim [Mon, 14 Jan 2019 12:34:31 +0000 (12:34 +0000)]
[DAGCombiner] Enable add saturation constant folding
llvm-svn: 351060
Aleksandar Beserminji [Mon, 14 Jan 2019 12:28:51 +0000 (12:28 +0000)]
[mips] Optimize shifts for types larger than GPR size (mips2/mips3)
With this patch, shifts are lowered to optimal number of instructions
necessary to shift types larger than the general purpose register size.
This resolves PR/32293.
Thanks to Kyle Butt for reporting the issue!
Differential Revision: https://reviews.llvm.org/D56320
llvm-svn: 351059
Jeremy Morse [Mon, 14 Jan 2019 12:13:12 +0000 (12:13 +0000)]
[DebugInfo] Remove un-necessary logic from HoistThenElseCodeToIf
Following PR39807, the way in which SimplifyCFG hoists common code on
branch paths was fixed in r347782. However this left extra code hanging
around HoistThenElseCodeToIf that wasn't necessary and needlessly
complicated matters -- we no longer need to look up through the 'if'
basic block to find a location for hoisted 'select' insts, we can instead
use the location chosen by applyMergedLocation.
This patch deletes that extra logic, and updates a regression test to
reflect the new logic (selects get the merged location, not a previous
insts location).
Differential Revision: https://reviews.llvm.org/D55272
llvm-svn: 351058
Simon Pilgrim [Mon, 14 Jan 2019 12:12:42 +0000 (12:12 +0000)]
[DAGCombiner] Add add saturation constant folding tests.
Exposes an issue with sadd_sat for computeOverflowKind, so I've disabled it for now.
llvm-svn: 351057
Diana Picus [Mon, 14 Jan 2019 12:04:08 +0000 (12:04 +0000)]
[ARM GlobalISel] Import MOVi32imm into GlobalISel
Make it possible for TableGen to produce code for selecting MOVi32imm.
This allows reasonably recent ARM targets to select a lot more constants
than before.
We achieve this by adding GISelPredicateCode to arm_i32imm. It's
impossible to use the exact same code for both DAGISel and GlobalISel,
since one uses "Subtarget->" and the other "STI." to refer to the
subtarget. Moreover, in GlobalISel we don't have ready access to the
MachineFunction, so we need to add a bit of code for obtaining it from
the instruction that we're selecting. This is also the reason why it
needs to remain a PatLeaf instead of the more specific IntImmLeaf.
llvm-svn: 351056
Simon Pilgrim [Mon, 14 Jan 2019 11:56:59 +0000 (11:56 +0000)]
[SelectionDAG] Add type sanity assertions for add/sub saturation node creation.
llvm-svn: 351055
David Stuttard [Mon, 14 Jan 2019 11:55:24 +0000 (11:55 +0000)]
[AMDGPU] Add support for TFE/LWE in image intrinsics. 2nd try
TFE and LWE support requires extra result registers that are written in the
event of a failure in order to detect that failure case.
The specific use-case that initiated these changes is sparse texture support.
This means that if image intrinsics are used with either option turned on, the
programmer must ensure that the return type can contain all of the expected
results. This can result in redundant registers since the vector size must be a
power-of-2.
This change takes roughly 6 parts:
1. Modify the instruction defs in tablegen to add new instruction variants that
can accomodate the extra return values.
2. Updates to lowerImage in SIISelLowering.cpp to accomodate setting TFE or LWE
(where the bulk of the work for these instruction types is now done)
3. Extra verification code to catch cases where intrinsics have been used but
insufficient return registers are used.
4. Modification to the adjustWritemask optimisation to account for TFE/LWE being
enabled (requires extra registers to be maintained for error return value).
5. An extra pass to zero initialize the error value return - this is because if
the error does not occur, the register is not written and thus must be zeroed
before use. Also added a new (on by default) option to ensure ALL return values
are zero-initialized that is required for sparse texture support.
6. Disable the inst_combine optimization in the presence of tfe/lwe (later TODO
for this to re-enable and handle correctly).
There's an additional fix now to avoid a dmask=0
For an image intrinsic with tfe where all result channels except tfe
were unused, I was getting an image instruction with dmask=0 and only a
single vgpr result for tfe. That is incorrect because the hardware
assumes there is at least one vgpr result, plus the one for tfe.
Fixed by forcing dmask to 1, which gives the desired two vgpr result
with tfe in the second one.
The TFE or LWE result is returned from the intrinsics using an aggregate
type. Look in the test code provided to see how this works, but in essence IR
code to invoke the intrinsic looks as follows:
%v = call {<4 x float>,i32} @llvm.amdgcn.image.load.1d.v4f32i32.i32(i32 15,
i32 %s, <8 x i32> %rsrc, i32 1, i32 0)
%v.vec = extractvalue {<4 x float>, i32} %v, 0
%v.err = extractvalue {<4 x float>, i32} %v, 1
This re-submit of the change also includes a slight modification in
SIISelLowering.cpp to work-around a compiler bug for the powerpc_le
platform that caused a buildbot failure on a previous submission.
Differential revision: https://reviews.llvm.org/D48826
Change-Id: If222bc03642e76cf98059a6bef5d5bffeda38dda
Work around for ppcle compiler bug
Change-Id: Ie284cf24b2271215be1b9dc95b485fd15000e32b
llvm-svn: 351054
Anastasia Stulova [Mon, 14 Jan 2019 11:44:22 +0000 (11:44 +0000)]
[OpenCL] Set generic addr space of 'this' in special class members.
Set address spaces of 'this' param correctly for implicit special
class members.
This also changes initialization conversion sequence to separate
address space conversion from other qualifiers in case of binding
reference to a temporary. In this case address space conversion
should happen after the binding (unlike for other quals). This is
needed to materialize it correctly in the alloca address space.
Initial patch by Mikael Nilssoni!
Differential Revision: https://reviews.llvm.org/D56066
llvm-svn: 351053
Kadir Cetinkaya [Mon, 14 Jan 2019 11:24:07 +0000 (11:24 +0000)]
[clangd] Fix a reference invalidation
Summary: Fix for the breakage in http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52811/consoleFull#-
42777206a1ca8a51-895e-46c6-af87-
ce24fa4cd561
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D56656
llvm-svn: 351052
Sam McCall [Mon, 14 Jan 2019 11:06:48 +0000 (11:06 +0000)]
[clangd] Unlink VFS working dir from OS working dir.
A lot of our previous FS manipulation was thread-unsafe in practice with
the RealFS implementation.
This switches to a different RealFS mode where path-manipulation is used
to simulate multiple working dirs.
r351050 both added this mode and removed the cache. If we want to
move back to the old implementation we need to put the cache back.
llvm-svn: 351051
Sam McCall [Mon, 14 Jan 2019 10:56:35 +0000 (10:56 +0000)]
[VFS] Allow multiple RealFileSystem instances with independent CWDs.
Summary:
Previously only one RealFileSystem instance was available, and its working
directory is shared with the process. This doesn't work well for multithreaded
programs that want to work with relative paths - the vfs::FileSystem is assumed
to provide the working directory, but a thread cannot control this exclusively.
The new vfs::createPhysicalFileSystem() factory copies the process's working
directory initially, and then allows it to be independently modified.
This implementation records the working directory path, and glues it to relative
paths to provide the correct absolute path to the sys::fs:: functions.
This will give different results in unusual situations (e.g. the CWD is moved).
The main alternative is the use of openat(), fstatat(), etc to ask the OS to
resolve paths relative to a directory handle which can be kept open. This is
more robust. There are two reasons not to do this initially:
1. these functions are not available on all supported Unixes, and are somewhere
between difficult and unavailable on Windows. So we need a path-based
fallback anyway.
2. this would mean also adding support at the llvm::sys::fs level, which is a
larger project. My clearest idea is an OS-specific `BaseDirectory` object
that can be optionally passed to functions there. Eventually this could be
backed by either paths or a fd where openat() is supported.
This is a large project, and demonstrating here that a path-based fallback
works is a useful prerequisite.
There is some subtlety to the path-manipulation mechanism:
- when setting the working directory, both Specified=makeAbsolute(path) and
Resolved=realpath(path) are recorded. These may differ in the presence of
symlinks.
- getCurrentWorkingDirectory() and makeAbsolute() use Specified - this is
similar to the behavior of $PWD and sys::path::current_path
- IO operations like openFileForRead use Resolved. This is similar to the
behavior of an openat() based implementation, that doesn't see changes
in symlinks.
There may still be combinations of operations and FS states that yield unhelpful
behavior. This is hard to avoid with symlinks and FS abstractions :(
The caching behavior of the current working directory is removed in this patch.
getRealFileSystem() is now specified to link to the process CWD, so the caching
is incorrect.
The user who needed this so far is clangd, which will immediately switch to
createPhysicalFileSystem().
Reviewers: ilya-biryukov, bkramer, labath
Subscribers: ioeric, kadircet, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D56545
llvm-svn: 351050
Francis Visoiu Mistrih [Mon, 14 Jan 2019 10:55:55 +0000 (10:55 +0000)]
Replace "no-frame-pointer-*" function attributes with "frame-pointer"
Part of the effort to refactoring frame pointer code generation. We used
to use two function attributes "no-frame-pointer-elim" and
"no-frame-pointer-elim-non-leaf" to represent three kinds of frame
pointer usage: (all) frames use frame pointer, (non-leaf) frames use
frame pointer, (none) frame use frame pointer. This CL makes the idea
explicit by using only one enum function attribute "frame-pointer"
Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as
llc.
"no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still
supported for easy migration to "frame-pointer".
tests are mostly updated with
// replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’
grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g"
// replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’
grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g"
Patch by Yuanfang Chen (tabloid.adroit)!
Differential Revision: https://reviews.llvm.org/D56351
llvm-svn: 351049
Sam McCall [Mon, 14 Jan 2019 10:40:41 +0000 (10:40 +0000)]
[clang-tidy] update FunctionSizeCheck for D56444
Reviewers: JonasToth, aaron.ballman
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D56552
llvm-svn: 351048
Sam McCall [Mon, 14 Jan 2019 10:31:42 +0000 (10:31 +0000)]
[AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.
Summary:
This fixes ASTContext's parent map for nodes in such classes (e.g. operator()).
https://bugs.llvm.org/show_bug.cgi?id=39949
This also changes the observed shape of the AST for implicit RAVs.
- this includes AST MatchFinder: cxxRecordDecl() now matches lambda classes,
functionDecl() matches the call operator, and the parent chain is body -> call
operator -> lambda class -> lambdaexpr rather than body -> lambdaexpr.
- this appears not to matter for the ASTImporterLookupTable builder
- this doesn't matter for the other RAVs in-tree.
In order to do this, we remove the TraverseLambdaBody hook. The problem is it's
hard/weird to ensure this hook is called when traversing via the implicit class.
There were just two users of this hook in-tree, who use it to skip bodies.
I replaced these with explicitly traversing the captures only. Another approach
would be recording the bodies when the lambda is visited, and then recognizing
them later.
I'd be open to suggestion on how to preserve this hook, instead.
Reviewers: aaron.ballman, JonasToth
Subscribers: cfe-commits, rsmith, jdennett
Differential Revision: https://reviews.llvm.org/D56444
llvm-svn: 351047
Petar Avramovic [Mon, 14 Jan 2019 10:27:05 +0000 (10:27 +0000)]
[MIPS GlobalISel] Add pre legalizer combiner pass
Introduce GlobalISel pre legalizer pass for MIPS.
It will be used to cope with instructions that require
combining before legalization.
Differential Revision: https://reviews.llvm.org/D56269
llvm-svn: 351046
Max Kazantsev [Mon, 14 Jan 2019 10:26:26 +0000 (10:26 +0000)]
[BasicBlockUtils] Generalize DeleteDeadBlock to deal with multiple dead blocks
Utility function `DeleteDeadBlock` expects that all predecessors of a block being
deleted are already deleted, with the exception of single-block loop. It makes it
hard to use for deletion of a set of blocks that may contain cyclic dependencies.
The is no correct order of invocations of this function that does not produce
dangling pointers on already deleted blocks.
This patch introduces a generalized version of this function `DeleteDeadBlocks`
that allows us to remove multiple blocks at once, even if there are cycles among
them. The only requirement is that no block being deleted should have a predecessor
that is not being deleted.
The logic of `DeleteDeadBlocks` is following:
for each block
create relevant DT updates;
remove all instructions (replace with undef if needed);
replace terminator with unreacheable;
apply DT updates;
for each block
delete block;
Therefore, `DeleteDeadBlock` becomes a particular case of
the general algorithm called for a single block.
Differential Revision: https://reviews.llvm.org/D56120
Reviewed By: skatkov
llvm-svn: 351045
Daniel Cederman [Mon, 14 Jan 2019 10:15:20 +0000 (10:15 +0000)]
[Sparc] Add Sparc V8 support
Summary:
Adds the register class implementation for Sparc.
Adds support for DW_CFA_GNU_window_save.
Adds save and restore context functionality.
Adds getArch() function to each Registers_ class to be able to separate
between DW_CFA_AARCH64_negate_ra_state and DW_CFA_GNU_window_save which
are both represented by the same constant.
On Sparc the return address is the address of the call instruction, so
an offset needs to be added when returning to skip the call instruction
and its delay slot. If the function returns a struct it is also necessary
to skip one extra instruction on Sparc V8.
Reviewers: jyknight, mclow.lists, mstorsjo, compnerd
Reviewed By: jyknight, compnerd
Subscribers: jgorbe, mgorny, christof, llvm-commits, fedor.sergeev, JDevlieghere, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D55763
llvm-svn: 351044
Dmitry Venikov [Mon, 14 Jan 2019 10:10:51 +0000 (10:10 +0000)]
[llvm-symbolizer] Add -addresses, -a as aliases for -print-address
Summary: Provides -addresses, -a as aliases for -print-address. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40067.
Reviewers: jhenderson, ruiu, rnk, fjricci
Reviewed By: jhenderson
Subscribers: rupprecht, llvm-commits
Differential Revision: https://reviews.llvm.org/D56635
llvm-svn: 351043
Thomas Preud'homme [Mon, 14 Jan 2019 10:10:48 +0000 (10:10 +0000)]
Fix defines.txt
Support arbitrary suffix when matching FileCheck executable name in
defines.txt to successfully match FileCheck.EXE on Microsoft Windows.
llvm-svn: 351042
Sam McCall [Mon, 14 Jan 2019 10:01:17 +0000 (10:01 +0000)]
[clangd] Index main-file symbols (bug 39761)
Patch by Nathan Ridge!
Differential Revision: https://reviews.llvm.org/D55185
llvm-svn: 351041
Diana Picus [Mon, 14 Jan 2019 09:45:49 +0000 (09:45 +0000)]
[asan] Add fallback for Thumb after r350139
This reverts r350806 which marked some tests as UNSUPPORTED on ARM and
instead reintroduces the old code path only for Thumb, since that seems
to be the only target that broke.
It would still be nice to find the root cause of the breakage, but with
the branch point for LLVM 8.0 scheduled for next week it's better to put
things in a stable state while we investigate.
Differential Revision: https://reviews.llvm.org/D56594
llvm-svn: 351040
Thomas Preud'homme [Mon, 14 Jan 2019 09:29:10 +0000 (09:29 +0000)]
Detect incorrect FileCheck variable CLI definition
Summary:
While the backend code of FileCheck relies on definition of variable
from the command-line to have an equal sign '=' and a variable name
before that, the frontend does not actually enforce it. This leads to
FileCheck crashing when invoked with invalid syntax for the -D option.
This patch adds the missing validation in the frontend. It also makes
the -D option an AlwaysPrefix option to be able to detect -D=FOO as
being a define without variable and -D as missing its value.
Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions)
Reviewers: jdenny
Subscribers: JonChesterfield, hiraditya, kristina, probinson,
llvm-commits
Differential Revision: https://reviews.llvm.org/D55940
llvm-svn: 351039
Thomas Preud'homme [Mon, 14 Jan 2019 09:28:53 +0000 (09:28 +0000)]
Add support for prefix-only CLI options
Summary:
Add support for options that always prefix their value, giving an error
if the value is in the next argument or if the option is given a value
assignment (ie. opt=val). This is the desired behavior for the -D option
of FileCheck for instance.
Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions and introduced when creating
D56549)
Reviewers: jdenny
Subscribers: llvm-commits, probinson, kristina, hiraditya,
JonChesterfield
Differential Revision: https://reviews.llvm.org/D56549
llvm-svn: 351038
Stefan Granitz [Mon, 14 Jan 2019 09:24:50 +0000 (09:24 +0000)]
[CMake] LLVM exports utility targets since r350959, so we can use them without standalone-checks now
llvm-svn: 351037
Craig Topper [Mon, 14 Jan 2019 08:46:51 +0000 (08:46 +0000)]
[X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR instead.
Fixes PR40259
llvm-svn: 351036
Craig Topper [Mon, 14 Jan 2019 08:46:45 +0000 (08:46 +0000)]
[X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select in IR instead.
Fixes PR40259
llvm-svn: 351035
Craig Topper [Mon, 14 Jan 2019 08:46:42 +0000 (08:46 +0000)]
[X86] Add new test file that was supposed to go with r351028.
llvm-svn: 351034
Craig Topper [Mon, 14 Jan 2019 02:59:08 +0000 (02:59 +0000)]
[X86] Update type profile for DBPSADBW to indicate the immediate is an i8 not just any int.
Removes some type checks from X86GenDAGISel.inc
llvm-svn: 351033
Craig Topper [Mon, 14 Jan 2019 01:56:59 +0000 (01:56 +0000)]
[X86] Remove unused intrinsic handlers. NFC
llvm-svn: 351032
Craig Topper [Mon, 14 Jan 2019 01:44:09 +0000 (01:44 +0000)]
[X86] Remove FPCLASS intrinsic handler. Use INTR_TYPE_2OP instead. NFC
llvm-svn: 351031
Nico Weber [Mon, 14 Jan 2019 00:45:27 +0000 (00:45 +0000)]
lld/include/lld/Core/TODO.txt
- fix minor grammar stuff (I'm not a native speaker either, but it's hopefully a net improvement)
- mention that lld/coff is used in production
- update AArch64, ARM to production quality
- remove lld/include/lld/Core/TODO.txt which looks outdated
Differential Revision: https://reviews.llvm.org/D56600
llvm-svn: 351030
Craig Topper [Mon, 14 Jan 2019 00:03:55 +0000 (00:03 +0000)]
[X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1 vector.
We'll do the scalar<->vXi1 conversions with bitcasts in IR.
Fixes PR40258
llvm-svn: 351029
Craig Topper [Mon, 14 Jan 2019 00:03:50 +0000 (00:03 +0000)]
[X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a vXi1 vector.
The input mask can be represented with an AND in IR.
Fixes PR40258
llvm-svn: 351028
Petr Hosek [Sun, 13 Jan 2019 22:15:37 +0000 (22:15 +0000)]
[libcxx] Mark do_open, do_get and do_close parameters unused when catopen is missing
When catopen is missing, do_open, do_get and do_close end up being
no-op, and as such their parameters will be unused which triggers a
warning/error when building with -Wunused-parameter.
Differential Revision: https://reviews.llvm.org/D56023
llvm-svn: 351027
Simon Pilgrim [Sun, 13 Jan 2019 22:08:26 +0000 (22:08 +0000)]
[DAGCombiner] If add_sat(x,y) can't overflow -> add(x,y)
NOTE: We need more powerful signed overflow detection in computeOverflowKind
llvm-svn: 351026
Simon Pilgrim [Sun, 13 Jan 2019 21:53:12 +0000 (21:53 +0000)]
Fix unused variable warning. NFCI.
llvm-svn: 351025
Simon Pilgrim [Sun, 13 Jan 2019 21:50:24 +0000 (21:50 +0000)]
[DAGCombiner] Some very basic add/sub saturation combines.
Handle combines with zero and constant canonicalization for adds.
llvm-svn: 351024
Simon Pilgrim [Sun, 13 Jan 2019 21:21:46 +0000 (21:21 +0000)]
[X86] Add some basic add/sub saturation combine tests.
The actual combines will be added in a future commit.
llvm-svn: 351023
Craig Topper [Sun, 13 Jan 2019 19:33:30 +0000 (19:33 +0000)]
[LegalizeDAG] Remove 'NeedInvert' code from expansion of BR_CC. Replace with an assert.
I accidentally triggered this code while doing some experiments and it doesn't look lke it could possibly work.
It calls 'getNOT' on a node that should be a CondCode.
I think to do this right we would need to swap the branch target and the fallthrough target. But that's not easy to do. Or we could create an explicit SetCC and feed that into a new BR_CC?
llvm-svn: 351022
Nikita Popov [Sun, 13 Jan 2019 16:41:26 +0000 (16:41 +0000)]
[X86] Rename overly verbose method; NFC
As suggested on D56636.
llvm-svn: 351021
James Y Knight [Sun, 13 Jan 2019 16:09:28 +0000 (16:09 +0000)]
Remove TypeBuilder.h, and fix the few locations using it.
This shortcut mechanism for creating types was added 10 years ago, but
has seen almost no uptake since then, neither internally nor in
external projects.
The very small number of characters saved by using it does not seem
worth the mental overhead of an additional type-creation API, so,
delete it.
Differential Revision: https://reviews.llvm.org/D56573
llvm-svn: 351020
Roman Lebedev [Sun, 13 Jan 2019 12:54:34 +0000 (12:54 +0000)]
[OpenMP] Fix LIBOMP_USE_DEBUGGER=ON build (PR38612)
Summary:
Two things:
1. Those two variables had the wrong sigdness, which was resulting in "sign mismatch in comparison" warning.
2. The whole `kmp_debugger.cpp` wasn't being built, or rather, it was being built as-if `USE_DEBUGGER` was off,
thus, nothing provided the definition of `__kmp_omp_debug_struct_info`, `__kmp_debugging`.
Makes sense, because `USE_DEBUGGER` is set in `kmp_config.h`, which is not included explicitly.
It is included by `kmp.h`, but that one is only included inside of the `#if USE_DEBUGGER` block..
I *think* this is the only source file with this issue,
everything else seem to `#include` either `kmp.h` or `kmp_config.h`.
The alternative solution would be to add `add_compile_options(-include kmp_config.h)` in CMake.
I did verify that `__kmp_omp_debug_struct_info` becomes available with this patch.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=38612 | PR38612 ]].
Reviewers: AndreyChurbanov, jlpeyton, Hahnfeld
Reviewed By: jlpeyton
Subscribers: guansong, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D55783
llvm-svn: 351019
Craig Topper [Sun, 13 Jan 2019 02:59:59 +0000 (02:59 +0000)]
[X86] Add more ISD nodes to handle masked versions of VCVT(T)PD2DQZ128/VCVT(T)PD2UDQZ128 which only produce 2 result elements and zeroes the upper elements.
We can't represent this properly with vselect like we normally do. We also have to update the instruction definition to use a VK2WM mask instead of VK4WM to represent this.
Fixes another case from PR34877
llvm-svn: 351018
Craig Topper [Sun, 13 Jan 2019 02:59:57 +0000 (02:59 +0000)]
[X86] Add X86ISD::VMFPROUND to handle the masked case of VCVTPD2PSZ128 which only produces 2 result elements and zeroes the upper elements.
We can't represent this properly with vselect like we normally do. We also have to update the instruction definition to use a VK2WM mask instead of VK4WM to represent this.
Fixes another case from PR34877.
llvm-svn: 351017
Benjamin Kramer [Sat, 12 Jan 2019 18:36:22 +0000 (18:36 +0000)]
Give helper classes/functions local linkage. NFC.
llvm-svn: 351016
Stephen Kelly [Sat, 12 Jan 2019 17:07:05 +0000 (17:07 +0000)]
NFC: Make utility private
No callers are external to the class anymore.
llvm-svn: 351015
Stephen Kelly [Sat, 12 Jan 2019 16:53:27 +0000 (16:53 +0000)]
[ASTDump] NFC: Move dump of individual Stmts to TextNodeDumper
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D55340
llvm-svn: 351014
Simon Pilgrim [Sat, 12 Jan 2019 16:38:56 +0000 (16:38 +0000)]
[X86] More aggressive shuffle mask widening in combineExtractWithShuffle
Use demanded extract index to set most of the shuffle mask to undef, making it easier to widen and peek through.
llvm-svn: 351013
Stephen Kelly [Sat, 12 Jan 2019 16:35:37 +0000 (16:35 +0000)]
Implement TemplateArgument dumping in terms of Visitor
Summary: Split the output streaming from the traversal to other AST nodes.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D55491
llvm-svn: 351012
Stephen Kelly [Sat, 12 Jan 2019 15:45:05 +0000 (15:45 +0000)]
[ASTDump] Change parameter to StringRef
llvm-svn: 351011
Sanjay Patel [Sat, 12 Jan 2019 15:27:15 +0000 (15:27 +0000)]
[LoopVectorizer] give more advice in remark about failure to vectorize call
Something like this is requested by:
https://bugs.llvm.org/show_bug.cgi?id=40265
...and it seems like a common enough case that we should acknowledge it.
Differential Revision: https://reviews.llvm.org/D56551
llvm-svn: 351010
Stephen Kelly [Sat, 12 Jan 2019 15:23:30 +0000 (15:23 +0000)]
[Algorithm] Add make_const_ref corresponding to make_const_ptr
Reviewers: aaron.ballman
Subscribers: dexonsmith, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D56622
llvm-svn: 351009
Sanjay Patel [Sat, 12 Jan 2019 15:12:28 +0000 (15:12 +0000)]
[DAGCombiner] fold insert_subvector of insert_subvector
This pattern:
t33: v8i32 = insert_subvector undef:v8i32, t35, Constant:i64<0>
t21: v16i32 = insert_subvector undef:v16i32, t33, Constant:i64<0>
...shows up in PR33758:
https://bugs.llvm.org/show_bug.cgi?id=33758
...although this patch doesn't make any difference to the final result on that yet.
In the affected tests here, it looks like it just makes RA wiggle. But we might
as well squash this to prevent it interfering with other pattern-matching.
Differential Revision:
https://reviews.llvm.org/D56604
llvm-svn: 351008
Benjamin Kramer [Sat, 12 Jan 2019 12:43:53 +0000 (12:43 +0000)]
[analyzer] Fix unused variable warnings in Release builds
This was just an inlined version of isa<CXXConstructExpr>. NFC.
llvm-svn: 351007
George Rimar [Sat, 12 Jan 2019 12:17:24 +0000 (12:17 +0000)]
[llvm-objdump] - Change the output for --all-headers.
This is for https://bugs.llvm.org/show_bug.cgi?id=40008,
it starts printing the file headers when --all-headers is given and
do a minor cosmetic change.
Differential revision: https://reviews.llvm.org/D56588
llvm-svn: 351006
Simon Pilgrim [Sat, 12 Jan 2019 12:00:43 +0000 (12:00 +0000)]
Use getShiftAmountTy for shift amounts.
llvm-svn: 351005
Nico Weber [Sat, 12 Jan 2019 11:56:47 +0000 (11:56 +0000)]
gn build: Unbreak Windows build
I didn't break all that much during upstreaming, just needs two small fixes:
- fix spelling of MCJITTests.def file
- make libLTO a shared_library to put it in bin/ on Windows where it is in the
CMake build too
Differential Revision: https://reviews.llvm.org/D56630
llvm-svn: 351004
Nikita Popov [Sat, 12 Jan 2019 11:43:04 +0000 (11:43 +0000)]
[X86] Add more usub.sat vector tests; NFC
Add additional vXi32 and vXi64 tests.
llvm-svn: 351003
Michal Gorny [Sat, 12 Jan 2019 11:18:35 +0000 (11:18 +0000)]
[NetBSD] Enable additional sanitizer types
Differential Revision: https://reviews.llvm.org/D56607
llvm-svn: 351002
Simon Atanasyan [Sat, 12 Jan 2019 11:12:08 +0000 (11:12 +0000)]
[ORC][MIPS] Fill delay-slot after `jr` instruction
MIPS `jr` instruction uses a delay-slot. To escape execution of
arbitrary instruction we should either fill the delay-slot by `nop`
instruction or swap `jr` instruction and logically preceding
instruction. This fix implements the second method to generate a bit
more effective code.
llvm-svn: 351001
Simon Atanasyan [Sat, 12 Jan 2019 11:12:04 +0000 (11:12 +0000)]
[ORC][MIPS] Setup t9 register and call function through this register
MIPS ABI states that every function must be called through jalr $t9. In
other words, a function expect that t9 register points to the beginning
of its code. A function uses this register to calculate offset to the
Global Offset Table and save it to the `gp` register.
```
lui $gp, %hi(_gp_disp)
addiu $gp, %lo(_gp_disp)
addu $gp, $gp, $t9
```
If `t9` and as a result `$gp` point to the wrong place the following code
loads incorrect value from GOT and passes control to invalid code.
```
lw $v0,%call16(foo)($gp)
jalr $t9
```
OrcMips32 and OrcMips64 writeResolverCode methods pass control to the
resolved address, but do not setup `$t9` before the call. The `t9` holds
value of the beginning of `resolver` code so any attempts to call
routines via GOT failed.
This change fixes the problem. The `OrcLazy/hidden-visibility.ll` test
starts to pass correctly. Before the change it fails on MIPS because the
`exitOnLazyCallThroughFailure` called from the resolver code could not
call libc routine `exit` via GOT.
Differential Revision: http://reviews.llvm.org/D56058
llvm-svn: 351000
Simon Pilgrim [Sat, 12 Jan 2019 10:28:12 +0000 (10:28 +0000)]
[X86] Improve vXi64 ISD::ABS codegen with SSE41+
Make use of vblendvpd to select on the signbit
Differential Revision: https://reviews.llvm.org/D56544
llvm-svn: 350999
Simon Pilgrim [Sat, 12 Jan 2019 09:59:32 +0000 (09:59 +0000)]
[X86][AARCH64] Improve ISD::ABS support
This patch takes some of the code from D49837 to allow us to enable ISD::ABS support for all SSE vector types.
Differential Revision: https://reviews.llvm.org/D56544
llvm-svn: 350998
Nikita Popov [Sat, 12 Jan 2019 09:09:15 +0000 (09:09 +0000)]
Reapply "[DemandedBits] Use SetVector for Worklist"
DemandedBits currently uses a simple vector for the worklist, which
means that instructions may be inserted multiple times into it.
Especially in combination with the deep lattice, this may cause
instructions too be recomputed very often. To avoid this, switch
to a SetVector.
Reapplying with a smaller number of inline elements in the
SmallSetVector, to avoid running into the SmallDenseMap issue
described in D56455.
Differential Revision: https://reviews.llvm.org/D56362
llvm-svn: 350997
Martin Storsjo [Sat, 12 Jan 2019 08:30:09 +0000 (08:30 +0000)]
[llvm-objcopy] [COFF] Remove pointless Reader/Writer base classes. NFC.
These were copied as part of the original design from the ELF
backend, but aren't necessary at the moment.
Differential Revision: https://reviews.llvm.org/D56431
llvm-svn: 350996
Craig Topper [Sat, 12 Jan 2019 08:15:54 +0000 (08:15 +0000)]
[X86] Remove X86ISD::SELECT as its no longer used by any of our intrinsic lowering.
llvm-svn: 350995
Craig Topper [Sat, 12 Jan 2019 08:05:12 +0000 (08:05 +0000)]
[X86] Add ISD node for masked version of CVTPS2PH.
The 128-bit input produces 64-bits of output and fills the upper 64-bits with 0. The mask only applies to the lower elements. But we can't represent this with a vselect like we normally do.
This also avoids the need to have a special X86ISD::SELECT when avx512bw isn't enabled since vselect v8i16 isn't legal there.
Fixes another instruction for PR34877.
llvm-svn: 350994
Alex Bradbury [Sat, 12 Jan 2019 07:43:06 +0000 (07:43 +0000)]
[RISCV] Introduce codegen patterns for RV64M-only instructions
As discussed on llvm-dev
<http://lists.llvm.org/pipermail/llvm-dev/2018-December/128497.html>, we have
to be careful when trying to select the *w RV64M instructions. i32 is not a
legal type for RV64 in the RISC-V backend, so operations have been promoted by
the time they reach instruction selection. Information about whether the
operation was originally a 32-bit operations has been lost, and it's easy to
write incorrect patterns.
Similarly to the variable 32-bit shifts, a DAG combine on ANY_EXTEND will
produce a SIGN_EXTEND if this is likely to result in sdiv/udiv/urem being
selected (and so save instructions to sext/zext the input operands).
Differential Revision: https://reviews.llvm.org/D53230
llvm-svn: 350993
Alex Bradbury [Sat, 12 Jan 2019 07:32:31 +0000 (07:32 +0000)]
[RISCV] Add patterns for RV64I SLLW/SRLW/SRAW instructions
This restores support for selecting the SLLW/SRLW/SRAW instructions, which was
removed in rL348067 as the previous patterns made some unsafe assumptions.
Also see the related llvm-dev discussion
<http://lists.llvm.org/pipermail/llvm-dev/2018-December/128497.html>
Ultimately I didn't introduce a custom SelectionDAG node, but instead added a
DAG combine that inserts an AssertZext i5 on the shift amount for an i32
variable-length shift and also added an ANY_EXTEND DAG-combine which will
instead produce a SIGN_EXTEND for an i32 variable-length shift, increasing the
opportunity to safely select SLLW/SRLW/SRAW.
There are obviously different ways of addressing this (a number discussed in
the llvm-dev thread), so I'd welcome further feedback and comments.
Note that there are now some cases in
test/CodeGen/RISCV/rv64i-exhaustive-w-insts.ll where sraw/srlw/sllw is
selected even though sra/srl/sll could be used without any extra instructions.
Given both are semantically equivalent, there doesn't seem a good reason to
prefer one vs the other. Given that would require more logic to still select
sra/srl/sll in those cases, I've left it preferring the *w variants.
Differential Revision: https://reviews.llvm.org/D56264
llvm-svn: 350992
Craig Topper [Sat, 12 Jan 2019 06:13:44 +0000 (06:13 +0000)]
[X86] Remove unnecessary code from getMaskNode.
We no longer need to extend mask scalars before bitcasting them to vXi1. This was only needed for the truncate intrinsics. And was really a bug in our lowering of them.
llvm-svn: 350991
Jason Molenda [Sat, 12 Jan 2019 03:17:39 +0000 (03:17 +0000)]
Add SymbolFileBreakpad.
llvm-svn: 350990
Craig Topper [Sat, 12 Jan 2019 02:22:10 +0000 (02:22 +0000)]
[X86] When lowering v1i1/v2i1/v4i1/v8i1 load/store with avx512f, but not avx512dq, use v16i1 as the intermediate mask type instead of v8i1.
We still use i8 for the load/store type. So we need to convert to/from i16 to around the mask type.
By doing this we get an i8->i16 extload which we can then pattern match to a KMOVW if the access is aligned.
llvm-svn: 350989
Craig Topper [Sat, 12 Jan 2019 02:22:06 +0000 (02:22 +0000)]
[X86] Change some patterns that select MOVZX16rm8 to instead select MOVZX32rm8 and extract the subregister.
This should be a shorter encoding and is consistent with what we do for zext i8->i16
llvm-svn: 350988
Evandro Menezes [Sat, 12 Jan 2019 01:06:43 +0000 (01:06 +0000)]
[ARM] Fix typo
Fix typo in r350952.
llvm-svn: 350986
Craig Topper [Sat, 12 Jan 2019 00:55:27 +0000 (00:55 +0000)]
[X86] Add ISD nodes for masked truncate so we can properly represent when the output has more elements than the input due to needing to be 128 bits.
We can't properly represent this with a vselect since the upper elements of the result are supposed to be zeroed regardless of the mask.
This also reuses the new nodes even when the result type fits in 128 bits if the input is q/d and the result is w/b since vselect w/b using k-register condition isn't legal without avx512bw. Currently we're doing this even when avx512bw is enabled, but I might change that.
This fixes some of PR34877
llvm-svn: 350985
Stephen Kelly [Sat, 12 Jan 2019 00:42:59 +0000 (00:42 +0000)]
NFC: Port loop to cxx_range_for
llvm-svn: 350984
Evgeniy Stepanov [Sat, 12 Jan 2019 00:09:24 +0000 (00:09 +0000)]
[sanitizer] Move android's GetPageSize to a header (NFC)
No need to pay function call overhead for a function that returns a
constant.
llvm-svn: 350983
George Karpenkov [Fri, 11 Jan 2019 23:35:17 +0000 (23:35 +0000)]
[analyzer] Support for OSObjects out parameters in RetainCountChecker
rdar://
46357478
rdar://
47121327
Differential Revision: https://reviews.llvm.org/D56240
llvm-svn: 350982
George Karpenkov [Fri, 11 Jan 2019 23:35:04 +0000 (23:35 +0000)]
[analyzer] Introduce a convenience method for getting a CallEvent from an arbitrary Stmt
Differential Revision: https://reviews.llvm.org/D56300
llvm-svn: 350981
Peter Collingbourne [Fri, 11 Jan 2019 23:30:24 +0000 (23:30 +0000)]
sanitizer_common: Change gen_dynamic_list.py to take a -o argument instead of writing to stdout.
This makes the script a little more gn friendly; gn does not support
redirecting the output of a script.
Differential Revision: https://reviews.llvm.org/D56579
llvm-svn: 350980
Peter Collingbourne [Fri, 11 Jan 2019 23:18:51 +0000 (23:18 +0000)]
gn build: Add a stage2 toolchain for Android.
This makes it possible to build llvm-symbolizer for Android, which
is one of the prerequisites for running the sanitizer tests on Android.
Differential Revision: https://reviews.llvm.org/D56577
llvm-svn: 350979
Stella Stamenova [Fri, 11 Jan 2019 23:08:35 +0000 (23:08 +0000)]
[lldbsuite] Skip TestExitDuringStep on Windows
This test is flaky on Windows and will occasionally hang or fail.
llvm-svn: 350978
Peter Collingbourne [Fri, 11 Jan 2019 22:57:57 +0000 (22:57 +0000)]
gn build: Create a template for unix toolchains.
Also change the toolchain description to use current_os instead of
host_os so that the template can be used for cross builds, and add
a current_os to the win toolchain to match the unix toolchain.
Differential Revision: https://reviews.llvm.org/D56576
llvm-svn: 350977
Evandro Menezes [Fri, 11 Jan 2019 22:39:47 +0000 (22:39 +0000)]
[AArch64] Improve Exynos predicates
Expand the predicate using shifted arithmetic and logic instructions to also
consider the respective not shifted instructions.
llvm-svn: 350976
Rui Ueyama [Fri, 11 Jan 2019 22:31:35 +0000 (22:31 +0000)]
Add a release note about MSP430 support.
llvm-svn: 350975
Peter Collingbourne [Fri, 11 Jan 2019 22:15:53 +0000 (22:15 +0000)]
gn build: Merge r350958.
llvm-svn: 350974
Stefan Granitz [Fri, 11 Jan 2019 21:59:58 +0000 (21:59 +0000)]
[CMake] Fix standalone build after LLVM exports utility targets
LLVM started exporting targets for utilites with https://reviews.llvm.org/rL350959, which broke compiler-rt standalone builds because it was used to define FileCheck manually.
Changed this, so FileCheck gets imported now.
llvm-svn: 350973
Marshall Clow [Fri, 11 Jan 2019 21:57:12 +0000 (21:57 +0000)]
Change from a to a . Fixes PR#39871.
llvm-svn: 350972
Nikita Popov [Fri, 11 Jan 2019 21:18:00 +0000 (21:18 +0000)]
[ConstantFolding] Fold undef for integer intrinsics
This fixes https://bugs.llvm.org/show_bug.cgi?id=40110.
This implements handling of undef operands for integer intrinsics in
ConstantFolding, in particular for the bitcounting intrinsics (ctpop,
cttz, ctlz), the with.overflow intrinsics, the saturating math
intrinsics and the funnel shift intrinsics.
The undef behavior follows what InstSimplify does for the general cas
e of non-constant operands. For the bitcount intrinsics (where
InstSimplify doesn't do undef handling -- there cannot be a combination
of an undef + non-constant operand) I'm using a 0 result if the intrinsic
is defined for zero and undef otherwise.
Differential Revision: https://reviews.llvm.org/D55950
llvm-svn: 350971