Elena Demikhovsky [Tue, 1 Dec 2015 12:30:40 +0000 (12:30 +0000)]
Fixed a failure in getSpaltValue()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254409
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Tue, 1 Dec 2015 12:08:36 +0000 (12:08 +0000)]
Fixed a failure in cost calculation for vector GEP
Cost calculation for vector GEP failed with due to invalid cast to GEP index operand.
The bug is fixed, added a test.
http://reviews.llvm.org/D14976
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254408
91177308-0d34-0410-b5e6-
96231b3b80d8
Hrvoje Varga [Tue, 1 Dec 2015 11:59:21 +0000 (11:59 +0000)]
[mips][microMIPS] Implement RECIP.fmt, RINT.fmt, ROUND.L.fmt, ROUND.W.fmt, SEL.fmt, SELEQZ.fmt, SELNEQZ.fmt and CLASS.fmt
Differential Revision: http://reviews.llvm.org/D13885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254405
91177308-0d34-0410-b5e6-
96231b3b80d8
Yury Gribov [Tue, 1 Dec 2015 11:40:55 +0000 (11:40 +0000)]
Introduce new @llvm.get.dynamic.area.offset.i{32, 64} intrinsics.
The @llvm.get.dynamic.area.offset.* intrinsic family is used to get the offset
from native stack pointer to the address of the most recent dynamic alloca on
the caller's stack. These intrinsics are intendend for use in combination with
@llvm.stacksave and @llvm.restore to get a pointer to the most recent dynamic
alloca. This is useful, for example, for AddressSanitizer's stack unpoisoning
routines.
Patch by Max Ostapenko.
Differential Revision: http://reviews.llvm.org/D14983
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254404
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 1 Dec 2015 11:05:39 +0000 (11:05 +0000)]
Allow known and unknown probabilities coexist in MBB's successor list.
Previously it is not allowed for each MBB to have successors with both known and
unknown probabilities. However, this may be too strict as at this stage we could
not always guarantee that. It is better to remove this restriction now, and I
will work on validating MBB's successors' probabilities first (for example,
check if the sum is approximate one).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254402
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Tue, 1 Dec 2015 10:48:51 +0000 (10:48 +0000)]
[AArch64] Add ARMv8.2-A Statistical Profiling Extension
The Statistical Profiling Extension is an optional extension to
ARMv8.2-A. Since it is an optional extension, I have added the
FeatureSPE subtarget feature to control it. The assembler-visible parts
of this extension are the new "psb csync" instruction, which is
equivalent to "hint #17", and a number of system registers.
Differential Revision: http://reviews.llvm.org/D15021
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254401
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Tue, 1 Dec 2015 10:33:56 +0000 (10:33 +0000)]
[ARM] Add ARMv8.2-A to TargetParser
Add ARMv8.2-A to TargetParser, so that it can be used by the clang
command-line options and the .arch directive.
Most testing of this will be done in clang, checking that the
command-line options that this enables work.
Differential Revision: http://reviews.llvm.org/D15037
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254400
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Tue, 1 Dec 2015 10:23:06 +0000 (10:23 +0000)]
[ARM] Add subtarget features for ARMv8.2-A
This adds subtarget features for ARMv8.2-A, which builds on (and
requires the features from) ARMv8.1-A. Most assembler-visible features
of ARMv8.2-A are system instructions, and are all required parts of the
architecture, so just depend on the HasV8_2aOps subtarget feature.
There is also one large, optional feature, which adds 16-bit floating
point versions of all existing floating-point instructions (VFP and
SIMD), this is represented by the FeatureFullFP16 subtarget feature.
Differential Revision: http://reviews.llvm.org/D15036
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254399
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 1 Dec 2015 10:07:41 +0000 (10:07 +0000)]
llvm/test/DebugInfo/X86/safestack-byval.ll: Give an explicit triple for now. It crashes for targeting *-win32.
Also revert r254375 and r254361.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254397
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 1 Dec 2015 10:07:37 +0000 (10:07 +0000)]
Move llvm/test/DebugInfo/Generic/safestack-byval.ll to X86. It depends on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254396
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 1 Dec 2015 07:49:27 +0000 (07:49 +0000)]
Introduce a range version of std::find, and use in SCEV
Reviewers: dblaikie, pcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15064
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254391
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 1 Dec 2015 07:49:23 +0000 (07:49 +0000)]
Introduce a range version of std::any_of, and use it in SCEV
Reviewers: dblaikie, pcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15063
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254390
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:16 +0000 (06:13 +0000)]
[X86] Fix patterns for memory forms of FP FSUBR and FDIVR. They need to have memory on the left hand side of the fsub/fdiv operations in their patterns.
Not sure how to test this. I noticed by inspection in the isel tables where the same pattern tried to produce DIV and DIVR or SUB and SUBR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254388
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:15 +0000 (06:13 +0000)]
[X86] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254387
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:13 +0000 (06:13 +0000)]
[X86] Use array_lengthof instead of calculating manually. Also change index types to size_t to match.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254386
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:10 +0000 (06:13 +0000)]
[Hexagon] Use std::begin() and std::end() instead of doing the same manually. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254385
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:08 +0000 (06:13 +0000)]
[Hexagon] Use array_lengthof and const correct and type correct the array and array size. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254384
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:06 +0000 (06:13 +0000)]
Use array_lengthof instead of manually calculating it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254383
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:04 +0000 (06:13 +0000)]
[Hexagon] Use ArrayRef to avoid needing to calculate an array size. Interestingly the original code may have had a bug because it was passing the byte size of a uint16_t array instead of the number of entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254382
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:13:01 +0000 (06:13 +0000)]
[ARM] Use range-based for loops to avoid the need for calculating an array size that I would have otherwise cconverted to array_lengthof. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254381
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 1 Dec 2015 06:12:59 +0000 (06:12 +0000)]
Use array_lengthof instead of manually calculating it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254380
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 1 Dec 2015 05:33:24 +0000 (05:33 +0000)]
[Windows] Partially revert r254363 until I can test the right fix.
Reported by: David Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254378
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 1 Dec 2015 05:29:22 +0000 (05:29 +0000)]
Replace all weight-based interfaces in MBB with probability-based interfaces, and update all uses of old interfaces.
(This is the second attempt to submit this patch. The first caused two assertion
failures and was reverted. See https://llvm.org/bugs/show_bug.cgi?id=25687)
The patch in http://reviews.llvm.org/D13745 is broken into four parts:
1. New interfaces without functional changes (http://reviews.llvm.org/D13908).
2. Use new interfaces in SelectionDAG, while in other passes treat probabilities
as weights (http://reviews.llvm.org/D14361).
3. Use new interfaces in all other passes.
4. Remove old interfaces.
This patch is 3+4 above. In this patch, MBB won't provide weight-based
interfaces any more, which are totally replaced by probability-based ones.
The interface addSuccessor() is redesigned so that the default probability is
unknown. We allow unknown probabilities but don't allow using it together
with known probabilities in successor list. That is to say, we either have a
list of successors with all known probabilities, or all unknown
probabilities. In the latter case, we assume each successor has 1/N
probability where N is the number of successors. An assertion checks if the
user is attempting to add a successor with the disallowed mixed use as stated
above. This can help us catch many misuses.
All uses of weight-based interfaces are now updated to use probability-based
ones.
Differential revision: http://reviews.llvm.org/D14973
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254377
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Tue, 1 Dec 2015 04:56:25 +0000 (04:56 +0000)]
[Hexagon] Disabling failing safestack test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254375
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 1 Dec 2015 04:20:06 +0000 (04:20 +0000)]
RegisterPressure: If we do not collect dead defs the list must be empty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254372
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 1 Dec 2015 04:20:04 +0000 (04:20 +0000)]
RegisterPressure: Remove support for recede()/advance() at MBB boundaries
Nobody was checking the returnvalue of recede()/advance() so we can
simply replace this code with asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254371
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 1 Dec 2015 04:20:01 +0000 (04:20 +0000)]
RegisterPressure: There is no need to make getCurSlot() public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254370
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 1 Dec 2015 04:19:58 +0000 (04:19 +0000)]
RegisterPressure: There is no need to make discoverLive{In|Out} public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254369
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 1 Dec 2015 04:19:56 +0000 (04:19 +0000)]
RegisterPressure: Split RegisterOperands analysis code from result object; NFC
This is in preparation to expose the RegisterOperands class as
RegisterPressure API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254368
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 1 Dec 2015 03:49:42 +0000 (03:49 +0000)]
Revert r254348: "Replace all weight-based interfaces in MBB with probability-based interfaces, and update all uses of old interfaces."
and the follow-up r254356: "Fix a bug in MachineBlockPlacement that may cause assertion failure during BranchProbability construction."
Asserts were firing in Chromium builds. See PR25687.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254366
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 1 Dec 2015 02:38:42 +0000 (02:38 +0000)]
[Windows] Follow-up r254363, remove return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254364
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Tue, 1 Dec 2015 02:35:04 +0000 (02:35 +0000)]
[Windows] Simplify assertion code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254363
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 1 Dec 2015 02:14:33 +0000 (02:14 +0000)]
Squelch unused variable warning in SIRegisterInfo.cpp.
Patch by Justin Lebar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254362
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 1 Dec 2015 01:15:03 +0000 (01:15 +0000)]
llvm/test/DebugInfo/Generic/safestack-byval.ll is using tls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254361
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 1 Dec 2015 01:14:58 +0000 (01:14 +0000)]
check-llvm: Introduce the new feature "tls".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254360
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 1 Dec 2015 01:07:20 +0000 (01:07 +0000)]
[llvm-dwp] Add missing Makefile for the old configure+make build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254358
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 1 Dec 2015 00:57:05 +0000 (00:57 +0000)]
[llvm-dwp] Add missing dependency from llvm tests on the llvm-dwp tool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254357
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 1 Dec 2015 00:55:42 +0000 (00:55 +0000)]
Fix a bug in MachineBlockPlacement that may cause assertion failure during BranchProbability construction.
The root cause is the rounding behavior in BranchProbability construction. We may consider to use truncation instead in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254356
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 1 Dec 2015 00:48:39 +0000 (00:48 +0000)]
[llvm-dwp] Initial partial prototype
This just concatenates the common DWP sections without doing any of the
fancy DWP things like:
1) update str_offsets
2) deduplicating strings
3) merging/creating cu/tu_index
Patches for these will follow shortly.
(also not sure about target triple/object file type for this tool - do I
really need a whole triple just to write an object file that contains
purely static/hardcoded bytes in each section? & I guess I should just
pick it based on the first input, maybe, rather than hardcoding for now
- but we only produce .dwo on ELF platforms with objcopy for now anyway)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254355
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 1 Dec 2015 00:48:34 +0000 (00:48 +0000)]
llvm-dwp: Initial layout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254354
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 1 Dec 2015 00:40:05 +0000 (00:40 +0000)]
[safestack] Protect byval function arguments.
Detect unsafe byval function arguments and move them to the unsafe
stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254353
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 1 Dec 2015 00:34:30 +0000 (00:34 +0000)]
Extend debug info for function parameters in SDAG.
SDAG currently can emit debug location for function parameters when
an llvm.dbg.declare points to either a function argument SSA temp,
or to an AllocaInst. This change extends this logic by adding a
fallback case when neither of the above is true.
This is required for SafeStack, which may copy the contents of a
byval function argument into something that is not an alloca, and
then describe the target as the new location of the said argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254352
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 1 Dec 2015 00:06:13 +0000 (00:06 +0000)]
[safestack] Fix handling of array allocas.
The current code does not take alloca array size into account and,
as a result, considers any access past the first array element to be
unsafe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254350
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Tue, 1 Dec 2015 00:02:51 +0000 (00:02 +0000)]
Replace all weight-based interfaces in MBB with probability-based interfaces, and update all uses of old interfaces.
The patch in http://reviews.llvm.org/D13745 is broken into four parts:
1. New interfaces without functional changes (http://reviews.llvm.org/D13908).
2. Use new interfaces in SelectionDAG, while in other passes treat probabilities
as weights (http://reviews.llvm.org/D14361).
3. Use new interfaces in all other passes.
4. Remove old interfaces.
This patch is 3+4 above. In this patch, MBB won't provide weight-based
interfaces any more, which are totally replaced by probability-based ones.
The interface addSuccessor() is redesigned so that the default probability is
unknown. We allow unknown probabilities but don't allow using it together
with known probabilities in successor list. That is to say, we either have a
list of successors with all known probabilities, or all unknown
probabilities. In the latter case, we assume each successor has 1/N
probability where N is the number of successors. An assertion checks if the
user is attempting to add a successor with the disallowed mixed use as stated
above. This can help us catch many misuses.
All uses of weight-based interfaces are now updated to use probability-based
ones.
Differential revision: http://reviews.llvm.org/D14973
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254348
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Nov 2015 23:54:19 +0000 (23:54 +0000)]
This reverts commit r254336 and r254344.
They broke a bot and I am debugging why.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254347
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Nov 2015 23:05:25 +0000 (23:05 +0000)]
Disable a consistency check.
Trying to figure out why it fails on a bot but passes locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254344
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 30 Nov 2015 22:39:36 +0000 (22:39 +0000)]
[InstCombine] add tests to show potential vector IR shuffle transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254342
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 30 Nov 2015 22:22:06 +0000 (22:22 +0000)]
[X86][FMA4] Prefer FMA4 to FMA
We currently output FMA instructions on targets which support both FMA4 + FMA (i.e. later Bulldozer CPUS bdver2/bdver3/bdver4).
This patch flips this so FMA4 is preferred; this is for several reasons:
1 - FMA4 is non-destructive reducing the need for mov instructions.
2 - Its more straighforward to commute and fold inputs (although the recent work on FMA has reduced this difference).
3 - All supported targets have FMA4 performance equal or better to FMA - Piledriver (bdver2) in particular has half the throughput when executing FMA instructions.
Its looks like no future AMD processor lines will support FMA4 after the Bulldozer series so we're not causing problems for later CPUs.
Differential Revision: http://reviews.llvm.org/D14997
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254339
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Nov 2015 22:01:43 +0000 (22:01 +0000)]
Start deciding earlier what to link.
A traditional linker is roughly split in symbol resolution and "copying
stuff".
The two tasks are badly mixed in lib/Linker.
This starts splitting them apart.
With this patch there are no direct call to linkGlobalValueBody or
linkGlobalValueProto. Everything is linked via WapValue.
This also includes a few fixes:
* A GV goes undefined if the comdat is dropped (comdat11.ll).
* We error if an internal GV goes undefined (comdat13.ll).
* We don't link an unused comdat.
The first two match the behavior of an ELF linker. The second one is
equivalent to running globaldce on the input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254336
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Mon, 30 Nov 2015 21:56:16 +0000 (21:56 +0000)]
Have 'optnone' respect the -fast-isel=false option.
This is primarily useful for debugging optnone v. ISel issues.
Differential Revision: http://reviews.llvm.org/D14792
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254335
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Mon, 30 Nov 2015 21:46:08 +0000 (21:46 +0000)]
[X86] Update test/CodeGen/X86/avg.ll with the help of update_llc_test_checks.py. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254334
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:32:10 +0000 (21:32 +0000)]
AMDGPU: Fix unused function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254333
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:16:07 +0000 (21:16 +0000)]
AMDGPU: Error if too many user SGPRs used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254332
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:16:03 +0000 (21:16 +0000)]
AMDGPU: Rework how private buffer passed for HSA
If we know we have stack objects, we reserve the registers
that the private buffer resource and wave offset are passed
and use them directly.
If not, reserve the last 5 SGPRs just in case we need to spill.
After register allocation, try to pick the next available registers
instead of the last SGPRs, and then insert copies from the inputs
to the reserved registers in the progloue.
This also only selectively enables all of the input registers
which are really required instead of always enabling them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254331
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:15:57 +0000 (21:15 +0000)]
AMDGPU: Rename enums to be consistent with HSA code object terminology
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254330
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:15:53 +0000 (21:15 +0000)]
AMDGPU: Remove SIPrepareScratchRegs
It does not work because of emergency stack slots.
This pass was supposed to eliminate dummy registers for the
spill instructions, but the register scavenger can introduce
more during PrologEpilogInserter, so some would end up
left behind if they were needed.
The potential for spilling the scratch resource descriptor
and offset register makes doing something like this
overly complicated. Reserve registers to use for the resource
descriptor and use them directly in eliminateFrameIndex.
Also removes creating another scratch resource descriptor
when directly selecting scratch MUBUF instructions.
The choice of which registers are reserved is temporary.
For now it attempts to pick the next available registers
after the user and system SGPRs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254329
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 21:15:45 +0000 (21:15 +0000)]
AMDGPU: Use assert zext for workgroup sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254328
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 30 Nov 2015 20:37:58 +0000 (20:37 +0000)]
[ARM] For old thumb ISA like v4t, we cannot use PC directly in pop.
Fix the epilogue emission to account for that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254325
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 30 Nov 2015 20:36:23 +0000 (20:36 +0000)]
Avoid writing to source directory of tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254324
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 30 Nov 2015 19:38:35 +0000 (19:38 +0000)]
[SimplifyLibCalls] Remove useless bits of this tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254318
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 30 Nov 2015 19:36:35 +0000 (19:36 +0000)]
[SimplifyLibCalls] Transform log(exp2(y)) to y*log(2) under fast-math.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254317
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 30 Nov 2015 19:04:19 +0000 (19:04 +0000)]
[X86] Add RIP to GR64_TCW64
The MachineVerifier wants to check that the register operands of an
instruction belong to the instruction's register class. RIP-relative
control flow instructions violated this by referencing RIP. While this
was fixed for SysV, it was never fixed for Win64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254315
91177308-0d34-0410-b5e6-
96231b3b80d8
Kit Barton [Mon, 30 Nov 2015 18:59:41 +0000 (18:59 +0000)]
Enable shrink wrapping for PPC64
Re-enable shrink wrapping for PPC64 Little Endian.
One minor modification to PPCFrameLowering::findScratchRegister was necessary to handle fall-thru blocks (blocks with no terminator) correctly.
Tested with all LLVM test, clang tests, and the self-hosting build, with no problems found.
PHabricator: http://reviews.llvm.org/D14778
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254314
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 30 Nov 2015 18:54:24 +0000 (18:54 +0000)]
Fix another llvm.ctors merging bug.
We were not looking past casts to see if an element should be included
or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254313
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Mon, 30 Nov 2015 18:42:08 +0000 (18:42 +0000)]
[WebAssembly] Fix a few minor compiler warnings. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254311
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 30 Nov 2015 17:52:02 +0000 (17:52 +0000)]
fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254310
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 30 Nov 2015 17:32:34 +0000 (17:32 +0000)]
[Hexagon] NFC Reordering headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254307
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 30 Nov 2015 15:46:47 +0000 (15:46 +0000)]
AMDGPU: Don't reserve SCRATCH_PTR input register
This hasn't been doing anything since using relocations was added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254304
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 30 Nov 2015 14:52:33 +0000 (14:52 +0000)]
Silencing a 32-bit to 64-bit implicit conversion warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254302
91177308-0d34-0410-b5e6-
96231b3b80d8
Hrvoje Varga [Mon, 30 Nov 2015 12:58:39 +0000 (12:58 +0000)]
[mips][microMIPS] Implement LBUX, LHX, LWX, MAQ_S[A].W.PHL, MAQ_S[A].W.PHR, MFHI, MFLO, MTHI and MTLO instructions
Differential Revision: http://reviews.llvm.org/D14436
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254297
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Mon, 30 Nov 2015 12:56:18 +0000 (12:56 +0000)]
[mips][microMIPS] Fix issue with offset operand of BALC and BC instructions
Value of offset operand for microMIPS BALC and BC instructions is currently shifted 2 bits, but it should be 1 bit.
Differential Revision: http://reviews.llvm.org/D14770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254296
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 30 Nov 2015 10:40:52 +0000 (10:40 +0000)]
AVX512: regenerate avx512bw intrincics tests results.
Differential Revision: http://reviews.llvm.org/D15069
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254295
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 30 Nov 2015 09:52:00 +0000 (09:52 +0000)]
[mips][ias] Removed MSA instructions from base architecture valid-xfail.s's.
valid-xfail.s is for instructions that should be valid in the given ISA but
incorrectly fail. MSA instructions are correct to fail since MSA is not enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254293
91177308-0d34-0410-b5e6-
96231b3b80d8
Zlatko Buljan [Mon, 30 Nov 2015 08:37:38 +0000 (08:37 +0000)]
[mips][microMIPS] Implement PRECR.QB.PH, PRECR_SRA[_R].PH.W, PRECRQ.PH.W, PRECRQ.QB.PH, PRECRQU_S.QB.PH and PRECRQ_RS.PH.W instructions
Differential Revision: http://reviews.llvm.org/D14605
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254291
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Nov 2015 02:28:19 +0000 (02:28 +0000)]
Revert r254279 "[X86] Use ArrayRef. NFC". It seems to have upset an MSVC build bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254280
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Nov 2015 02:08:05 +0000 (02:08 +0000)]
[X86] Use ArrayRef. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254279
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 30 Nov 2015 01:24:17 +0000 (01:24 +0000)]
[ADT] Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254278
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 30 Nov 2015 00:13:24 +0000 (00:13 +0000)]
[AVX512] The vpermi2 instructions require an integer vector for the index vector. This is reflected correctly in the intrinsics, but was not refelected in the isel patterns.
For the floating point types, this requires adding a bitcast to the index vector when its passed through to the output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254277
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 29 Nov 2015 23:40:57 +0000 (23:40 +0000)]
[SCEV] Use lambda instead of std::bind; NFC
The lambda is more readable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254276
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 29 Nov 2015 23:40:53 +0000 (23:40 +0000)]
[SCEV] Use range version of all_of; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254275
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 29 Nov 2015 23:18:32 +0000 (23:18 +0000)]
[X86] Remove duplicate entries from intrinsics tables and add asserts to verify there are no others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254274
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 29 Nov 2015 23:15:43 +0000 (23:15 +0000)]
Fix out of bounds access in hasStructRetAttr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254273
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Nov 2015 23:09:41 +0000 (23:09 +0000)]
[WebAssembly] Delete an obsolete TODO comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254272
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Nov 2015 22:59:19 +0000 (22:59 +0000)]
[WebAssembly] Set several MCInstrDesc flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254271
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 29 Nov 2015 22:53:22 +0000 (22:53 +0000)]
[X86] int_x86_avx2_permps and X86ISD::VPERMV should take an integer vector for its shuffle indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254269
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Nov 2015 22:48:57 +0000 (22:48 +0000)]
[WebAssembly] Delete unused functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254268
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Sun, 29 Nov 2015 22:32:02 +0000 (22:32 +0000)]
[WebAssembly] Minor clang-format and selected clang-tidy cleanups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254267
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 29 Nov 2015 22:09:34 +0000 (22:09 +0000)]
fix typos in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254266
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 29 Nov 2015 21:58:56 +0000 (21:58 +0000)]
[SimplifyLibCalls] Don't crash if the function doesn't have a name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254265
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 29 Nov 2015 21:00:43 +0000 (21:00 +0000)]
[SimplifyLibCalls] Cross out implemented transformations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254264
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 29 Nov 2015 20:58:04 +0000 (20:58 +0000)]
[SimplifyLibCalls] Tranform log(pow(x, y)) -> y*log(x).
This one is enabled only under -ffast-math. There are cases where the
difference between the value computed and the correct value is huge
even for ffast-math, e.g. as Steven pointed out:
x = -1, y = -4
log(pow(-1), 4) = 0
4*log(-1) = NaN
I checked what GCC does and apparently they do the same optimization
(which result in the dramatic difference). Future work might try to
make this (slightly) less worse.
Differential Revision: http://reviews.llvm.org/D14400
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254263
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Sun, 29 Nov 2015 18:23:26 +0000 (18:23 +0000)]
SamplePGO - Do not use std::to_string in diagnostics.
This fixes buildbots in systems that std::to_string is not present. It
also tidies the output of the diagnostic to render doubles a bit better
(thanks Ben Kramer for help with string streams and format).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254261
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 29 Nov 2015 18:05:22 +0000 (18:05 +0000)]
Use a lambda instead of std::bind and std::mem_fn I introduced in r254242. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254260
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 29 Nov 2015 16:41:04 +0000 (16:41 +0000)]
[X86][SSE] Added support for lowering to ADDSUBPS/ADDSUBPD with commuted inputs
We could already recognise shuffle(FSUB, FADD) -> ADDSUB, this allow us to recognise shuffle(FADD, FSUB) -> ADDSUB by commuting the shuffle mask prior to matching.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254259
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 29 Nov 2015 15:52:12 +0000 (15:52 +0000)]
Add a passing test.
When a comdat is discarded, any globals defined in it become undefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254258
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 29 Nov 2015 15:22:49 +0000 (15:22 +0000)]
Don't depend on the order the IR is copied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254257
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 29 Nov 2015 15:08:39 +0000 (15:08 +0000)]
Don't depend on the order the IR is copied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254256
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 29 Nov 2015 14:53:06 +0000 (14:53 +0000)]
Make this test less strict.
We just want to test what is copied, no the order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254255
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sun, 29 Nov 2015 14:33:06 +0000 (14:33 +0000)]
Simplify. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254254
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 29 Nov 2015 07:41:26 +0000 (07:41 +0000)]
AVX512:Implemented encoding for the vmovq.s instruction.
Differential Revision: http://reviews.llvm.org/D14810
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254248
91177308-0d34-0410-b5e6-
96231b3b80d8