Commit Graph

302779 Commits

Author SHA1 Message Date
Francis Visoiu Mistrih 2ae1be726a [CMake] Expose opt-remark tooling through libOptRemarks.dylib
* Create an install target for it
* Add it under tools/opt-remarks
* Add an export file for the dylib
* Install the llvm-c/OptRemarks.h header
* Add an API to query its version

rdar://45458839

llvm-svn: 346127
2018-11-05 11:57:44 +00:00
Sam Parker fec793c98f [ARM] Turn assert into condition in ARMCGP
Turn the assert in PrepareConstants into a conditon so that we can
handle mul instructions with negative immediates.

Differential Revision: https://reviews.llvm.org/D54094

llvm-svn: 346126
2018-11-05 11:26:04 +00:00
Sam Parker fcd8adab30 [ARM][ARMCGP] Remove unecessary zexts and truncs
r345840 slightly changed the way promotion happens which could
result in zext and truncs having the same source and destination
types. This fixes that issue.

We can now also remove the zext and trunc in the following case:
(zext (trunc (promoted op)), i32)

This means that we can no longer treat a value, that is only used by
a sink, to be safe to promote.

I've also added in some extra asserts and replaced a cast for a
dyn_cast.

Differential Revision: https://reviews.llvm.org/D54032

llvm-svn: 346125
2018-11-05 10:58:37 +00:00
Aleksandar Beserminji 767413360b [mips][msa] Fix broken test
Test builtins-mips-msa-error.c wasn't reporting errors.
This patch fixes the test, so further test cases can be added.

Differential Revision: https://reviews.llvm.org/D53984

llvm-svn: 346124
2018-11-05 10:22:51 +00:00
Kadir Cetinkaya 16950edcd4 Fix breakage on FrontendTest by initializing new field on constructor
llvm-svn: 346123
2018-11-05 10:01:34 +00:00
Hans Wennborg d604ea53ed Exclude wasm target from Windows packaging due to PR39448
llvm-svn: 346122
2018-11-05 09:31:43 +00:00
Roman Lebedev 7db25f2b38 [NFC][x86][AArch64] extract-bits.ll: add test with 'ashr'.
llvm-svn: 346121
2018-11-05 09:20:08 +00:00
Fangrui Song 342ca71145 [hwasan] Fix stack-uar.c after rCRT345110
Set -fno-discard-value-names so that the frame description string contains the variable name.

llvm-svn: 346120
2018-11-05 07:16:25 +00:00
Craig Topper 8f2f2a76b9 [DAGCombiner] Use tryFoldToZero to simplify some code and make it work correctly between LegalTypes and LegalOperations.
The original code avoided creating a zero vector after type legalization, but if we're after type legalization the type we have is legal. The real hazard we need to avoid is creating a build vector after op legalization. tryFoldToZero takes care of checking for this.

llvm-svn: 346119
2018-11-05 05:53:06 +00:00
Craig Topper 8d64abddd1 [DAGCombiner] Remove an unused argument from tryFoldToZero. NFC
llvm-svn: 346118
2018-11-05 05:53:03 +00:00
Dylan McKay 4c5a5c8db6 [AVR] Fix a backend bug that left extraneous operands after expansion
This patch fixes a bug in the AVR FRMIDX expansion logic.

The expansion would leave a leftover operand from the original FRMIDX,
but now attached to a MOVWRdRr instruction. The MOVWRdRr instruction
did not expect this operand and so LLVM rejected the machine
instruction.

This would trigger an assertion:

    Assertion failed: ((isImpReg || Op.isRegMask() || MCID->isVariadic() ||
                        OpNo < MCID->getNumOperands() || isMetaDataOp) &&
                        "Trying to add an operand to a machine instr that is already done!"),
    function addOperand, file llvm/lib/CodeGen/MachineInstr.cpp

Tim fixed this so that now the FRMIDX is expanded correctly into
a well-formed MOVWRdRr.

Patch by Tim Neumann

llvm-svn: 346117
2018-11-05 05:49:04 +00:00
Dean Michael Berris 1e255e7a7b [XRay] Update TSC math to handle wraparound
Summary:
Prior to this change, we can run into situations where the TSC we're
getting when exiting a function is less than the TSC we got when
entering it. This would sometimes cause the counter for cumulative call
times overflow, which was erroneously also being stored as a signed
64-bit integer.

This change addresses both these issues while adding provisions for
tracking CPU migrations. We do this because moving from one CPU to
another doesn't guarantee that the timestamp counter for some
architectures aren't guaranteed to be synchronised. For the moment, we
leave the provisions there until we can update the data format to
include the counting of CPU migrations we can catch.

We update the necessary tests as well, ensuring that our expectations
for the cycle accounting to be met in case of counter wraparound.

Reviewers: mboerger

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D54088

llvm-svn: 346116
2018-11-05 05:43:22 +00:00
Craig Topper 30b627e5c9 [X86] Custom type legalize v2i8/v2i16/v2i32 mul to use to pmuludq.
v2i8/v2i16/v2i32 are promoted to v2i64. pmuludq takes a v2i64 input and produces a v2i64 output. Since we don't about the upper bits of the type legalized multiply we can use the pmuludq to produce the multiply result for the bits we do care about.

llvm-svn: 346115
2018-11-05 05:02:12 +00:00
Dylan McKay 9a9ae99b30 [AVR] Disallow the LDDWRdPtrQ instruction with Z as the destination
This is an AVR-specific workaround for a limitation of the register
allocator that only exposes itself on targets with high register
contention like AVR, which only has three pointer registers.

The three pointer registers are X, Y, and Z.
In most nontrivial functions, Y is reserved for the frame pointer,
as per the calling convention. This leaves X and Z. Some instructions,
such as LPM ("load program memory"), are only defined for the Z
register. Sometimes this just leaves X.

When the backend generates a LDDWRdPtrQ instruction with Z as the
destination pointer, it usually trips up the register allocator
with this error message:

  LLVM ERROR: ran out of registers during register allocation

This patch is a hacky workaround. We ban the LDDWRdPtrQ instruction
from ever using the Z register as an operand. This gives the
register allocator a bit more space to allocate, fixing the
regalloc exhaustion error.

Here is a description from the patch author Peter Nimmervoll

  As far as I understand the problem occurs when LDDWRdPtrQ uses
  the ptrdispregs register class as target register. This should work, but
  the allocator can't deal with this for some reason. So from my testing,
  it seams like (and I might be totally wrong on this) the allocator reserves
  the Z register for the ICALL instruction and then the register class
  ptrdispregs only has 1 register left and we can't use Y for source and
  destination. Removing the Z register from DREGS fixes the problem but
  removing Y register does not.

More information about the bug can be found on the avr-rust issue
tracker at https://github.com/avr-rust/rust/issues/37.

A bug has raised to track the removal of this workaround and a proper
fix; PR39553 at https://bugs.llvm.org/show_bug.cgi?id=39553.

Patch by Peter Nimmervoll

llvm-svn: 346114
2018-11-05 05:00:44 +00:00
Kristof Umann 0a1f91c80c [analyzer] Restrict AnalyzerOptions' interface so that non-checker objects have to be registered
One of the reasons why AnalyzerOptions is so chaotic is that options can be
retrieved from the command line whenever and wherever. This allowed for some
options to be forgotten for a looooooong time. Have you ever heard of
"region-store-small-struct-limit"? In order to prevent this in the future, I'm
proposing to restrict AnalyzerOptions' interface so that only checker options
can be retrieved without special getters. I would like to make every option be
accessible only through a getter, but checkers from plugins are a thing, so I'll
have to figure something out for that.

This also forces developers who'd like to add a new option to register it
properly in the .def file.

This is done by

* making the third checker pointer parameter non-optional, and checked by an
  assert to be non-null.
* I added new, but private non-checkers option initializers, meant only for
  internal use,
* Renamed these methods accordingly (mind the consistent name for once with
  getBooleanOption!):
  - getOptionAsString -> getCheckerStringOption,
  - getOptionAsInteger -> getCheckerIntegerOption
* The 3 functions meant for initializing data members (with the not very
  descriptive getBooleanOption, getOptionAsString and getOptionAsUInt names)
  were renamed to be overloads of the getAndInitOption function name.
* All options were in some way retrieved via getCheckerOption. I removed it, and
  moved the logic to getStringOption and getCheckerStringOption. This did cause
  some code duplication, but that's the only way I could do it, now that checker
  and non-checker options are separated. Note that the non-checker version
  inserts the new option to the ConfigTable with the default value, but the
  checker version only attempts to find already existing entries. This is how
  it always worked, but this is clunky and I might end reworking that too, so we
  can eventually get a ConfigTable that contains the entire configuration of the
  analyzer.

Differential Revision: https://reviews.llvm.org/D53483

llvm-svn: 346113
2018-11-05 03:50:37 +00:00
Kristof Umann cb88cc674c Ensure the correct order of evaluation in part 2. of PlistMacroExpansion
Windows buildbots break with the previous commit '[analyzer][PlistMacroExpansion]
Part 2.: Retrieving the macro name and primitive expansion'. This patch attempts
to solve this issue.

llvm-svn: 346112
2018-11-05 02:37:29 +00:00
Kristof Umann 3800257fba Reland '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion'
llvm-svn: 346111
2018-11-05 02:14:36 +00:00
Craig Topper 60789b34e0 [X86] Fix typo in test comment. NFC
llvm-svn: 346110
2018-11-05 01:21:52 +00:00
David Carlier 511e1cf1ef [LLDB] Fix FreeBSD/Darwin build
Reviewers: JDevlieghere, tatyana-krasnukha

Reviwed By: tatyana-krasnukha

Differential Revision: https://reviews.llvm.org/D54084

llvm-svn: 346109
2018-11-04 23:19:25 +00:00
Vedant Kumar d2a895a972 [HotColdSplitting] Use TTI to inform outlining threshold
Using TargetTransformInfo allows the splitting pass to factor in the
code size cost of instructions as it decides whether or not outlining is
profitable.

This did not regress the overall amount of outlining seen on the handful
of internal frameworks I tested.

Thanks to Jun Bum Lim for suggesting this!

Differential Revision: https://reviews.llvm.org/D53835

llvm-svn: 346108
2018-11-04 23:11:57 +00:00
Petr Hosek 6c652b7f11 [Driver] Use -Bstatic/dynamic for libc++ on Fuchsia
-static relies on lld's behavior, but -Bstatic/dynamic is supported
across all linkers.

Differential Revision: https://reviews.llvm.org/D54082

llvm-svn: 346107
2018-11-04 22:38:47 +00:00
Craig Topper 6d3c713689 [X86] Add nounwind to some tests to remove cfi directives from checks. NFC
llvm-svn: 346106
2018-11-04 21:37:45 +00:00
Craig Topper a3210b2713 [X86] Regenerate test checks to merge 32 and 64 bit. Remove stale check prefixes. NFC
llvm-svn: 346105
2018-11-04 21:37:43 +00:00
Marshall Clow 89176c72e7 Fix the test for partition_copy so it is not ridiculously slow. Also, detab.
llvm-svn: 346104
2018-11-04 17:57:25 +00:00
Sylvestre Ledru 99682d0af7 Add support of the next Ubuntu (Ubuntu 19.04 - Disco Dingo)
llvm-svn: 346103
2018-11-04 17:41:41 +00:00
Craig Topper ed6a0a817f [X86] Add vector shift by immediate to SimplifyDemandedBitsForTargetNode.
Summary: This also enables some constant folding from KnownBits propagation. This helps on some cases vXi64 case in 32-bit mode where constant vectors appear as vXi32 and a bitcast. This can prevent getNode from constant folding sra/shl/srl.

Reviewers: RKSimon, spatel

Reviewed By: spatel

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D54069

llvm-svn: 346102
2018-11-04 17:31:27 +00:00
Sylvestre Ledru bc5c3f5727 Update our URLs in clang doc to use https
llvm-svn: 346101
2018-11-04 17:02:00 +00:00
Kamil Rytarowski a0a44e9c78 Fix NetBSD build after "Move path resolution logic out of FileSpec"
D53915

llvm-svn: 346100
2018-11-04 16:53:16 +00:00
Dave Lee 3d2de274c7 Update framework-header-fix to force system sed
Summary:
There are 2 changes here:

1. Use system sed instead of the sed found in the user's path. This
     fixes this script in the case the user has gnu-sed in their $PATH before
     bsd sed since `-i ''` isn't compatible and you need `-i` instead.

2. `set -e` in this script so it fails as soon as one of these commands
     fail instead of throwing errors for each file if they fail

Since this is only ran on macOS, and we're already using this
absolute path below, this seems like a safe addition

Reviewers: kastiglione, beanz

Reviewed By: kastiglione

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D49776

llvm-svn: 346099
2018-11-04 15:55:28 +00:00
Kamil Rytarowski 538d678737 Disable recursive interception for tzset in MSan
This fixes sanitization of this library call on NetBSD.
Extracted as a part of D42050.

llvm-svn: 346098
2018-11-04 15:30:38 +00:00
Sanjay Patel e7c94ef1de [ValueTracking] determine sign of 0.0 from select when matching min/max FP
In PR39475:
https://bugs.llvm.org/show_bug.cgi?id=39475
..we may fail to recognize/simplify fabs() in some cases because we do not 
canonicalize fcmp with a -0.0 operand.

Adding that canonicalization can cause regressions on min/max FP tests, so 
that's this patch: for the purpose of determining whether something is min/max, 
let the value returned by the select determine how we treat a 0.0 operand in the fcmp.

This patch doesn't actually change the -0.0 to +0.0. It just changes the analysis, so 
we don't fail to recognize equivalent min/max patterns that only differ in the 
signbit of 0.0.

Differential Revision: https://reviews.llvm.org/D54001

llvm-svn: 346097
2018-11-04 14:28:48 +00:00
Kristof Umann d96bdd2402 Revert '[analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion'
llvm-svn: 346096
2018-11-04 14:18:37 +00:00
Kristof Umann 7430213d8e [analyzer][PlistMacroExpansion] Part 2.: Retrieving the macro name and primitive expansion
This patch adds a couple new functions to acquire the macro's name, and also
expands it, although it doesn't expand the arguments, as seen from the test files

Differential Revision: https://reviews.llvm.org/D52794

llvm-svn: 346095
2018-11-04 13:59:44 +00:00
Pavel Labath b075bbd9da Fix log statement in r346093
Thanks to Dávid Bolvanský for pointing that out.

llvm-svn: 346094
2018-11-04 12:54:29 +00:00
Pavel Labath be828518c9 NativeProcessProtocol: Simplify breakpoint setting code
Summary:
A fairly simple operation as setting a breakpoint (writing a breakpoint
opcode) at a given address was going through three classes:
NativeProcessProtocol which called NativeBreakpointList, which then
called SoftwareBrekpoint, only to end up again in NativeProcessProtocol
to do the actual writing itself. This is unnecessarily complex and can
be simplified by moving all of the logic into NativeProcessProtocol
class itself, removing a lot of boilerplate.

One of the reeasons for this complexity was that (it seems)
NativeBreakpointList class was meant to hold both software and hardware
breakpoints. However, that never materialized, and hardware breakpoints
are stored in a separate map holding only hardware breakpoints.
Essentially, this patch makes software breakpoints follow that approach
by replacing the heavy SoftwareBraekpoint with a light struct of the
same name, which holds only the data necessary to describe one
breakpoint. The rest of the logic is in the main class. As, at the
lldb-server level, handling software and hardware breakpoints is very
different, this seems like a reasonable state of things.

Reviewers: krytarowski, zturner, clayborg

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D52941

llvm-svn: 346093
2018-11-04 10:58:08 +00:00
Craig Topper 3292ea03d3 [DAGCombiner] Remove 'else' after return. NFC
This makes this code consistent with the nearly identical code in visitZERO_EXTEND.

llvm-svn: 346090
2018-11-04 06:56:32 +00:00
Jan Kratochvil b5602a6c70 Fix duplicate testcase filename
dotest.py started reporting:
	Exception: Found multiple tests with the name TestSampleTest.py
After the commit of:
	https://reviews.llvm.org/D54056

llvm-svn: 346089
2018-11-04 06:13:09 +00:00
Petr Hosek e6e04242e3 [Driver] Always match resource dir in Fuchsia driver tests
This makes the tests stricter by not only matching the runtime file
name, but the entire path into the resource directory.

Differential Revision: https://reviews.llvm.org/D54064

llvm-svn: 346088
2018-11-04 03:53:07 +00:00
Craig Topper 1ba86188cf [SelectionDAG] Remove special methods for creating *_EXTEND_VECTOR_INREG nodes. Move asserts into getNode.
These methods were just wrappers around getNode with additional asserts (identical and repeated 3 times). But getNode already has a switch that can be used to hold these asserts that allows them to be shared for all 3 opcodes. This also enables checking on the places that create these nodes without using the wrappers.

The rest of the patch is just changing all callers to use getNode directly.

llvm-svn: 346087
2018-11-04 02:10:18 +00:00
Jan Vesely 0ba9339cde Remove redundant OVERRRIDES file
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346086
2018-11-04 00:54:46 +00:00
Jan Vesely fd9d787b18 configure: Provide symlink for amdgcn-mesa3d instead of configure hack
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346085
2018-11-04 00:54:45 +00:00
Jan Vesely ee93cda9b4 travis: Check tahiti-amdgcn-mesa-mesa3d.bc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346084
2018-11-04 00:54:43 +00:00
Jan Vesely fa94c1a879 amdgcn-amdhsa: Convert get_{global,local}_size to clc for all llvm versions
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346083
2018-11-04 00:39:30 +00:00
Jan Vesely f663e7e6da amdgcn: Move __clc_amdgcn_s_waitcnt definition to clc file
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346082
2018-11-04 00:39:27 +00:00
Jan Vesely 0e95b6a579 amdgcn: Convert get_num_groups to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346081
2018-11-04 00:39:25 +00:00
Jan Vesely 97283de27d amdgcn: Convert get_global_size to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346080
2018-11-04 00:39:20 +00:00
Jan Vesely ea2f32b75d amdgcn: Convert get_local_size to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-By: Aaron Watry <awatry@gmail.com>
llvm-svn: 346079
2018-11-04 00:39:16 +00:00
Jan Vesely 2d32cd1585 r600: Convert barrier to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 346078
2018-11-04 00:35:15 +00:00
Jan Vesely 35b7ac4c30 r600: Convert get_num_groups to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 346077
2018-11-04 00:35:12 +00:00
Jan Vesely cc6c2ef3b4 r600: Convert get_global_size to clc
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 346076
2018-11-04 00:35:08 +00:00