Commit Graph

123080 Commits

Author SHA1 Message Date
Artyom Skrobov
3685b697a2 [ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251125 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:19:19 +00:00
Oleg Ranevskyy
f1c16763a7 [ARM CodeGen] @llvm.debugtrap call may be removed when restoring callee saved registers
Summary:
When ARMFrameLowering::emitPopInst generates a "pop" instruction to restore the callee saved registers, it checks if the LR register is among them. If so, the function may decide to remove the basic block's terminator and replace it with a "pop" to the PC register instead of LR.

This leads to a problem when the block's terminator is preceded by a "llvm.debugtrap" call. The MI iterator points to the trap in such a case, which is also a terminator. If the function decides to restore LR to PC, it erroneously removes the trap.

Reviewers: asl, rengolin

Subscribers: aemerson, jfb, rengolin, dschuff, llvm-commits

Differential Revision: http://reviews.llvm.org/D13672

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251123 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:17:59 +00:00
Oleg Ranevskyy
cd69ab5ddf Test commit: fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:10:44 +00:00
Davide Italiano
9d03be0459 [llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Reported by: mikael.holmen at ericsson.com


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251117 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 16:52:22 +00:00
Joseph Tremoulet
53fbda20e9 [CodeGen] Mark setjmp/catchret MBBs address-taken
Summary:
This ensures that BranchFolding (and similar) won't remove these blocks.

Also allow AsmPrinter::EmitBasicBlockStart to process MBBs which are
address-taken but do not have BBs that are address-taken, since otherwise
its call to getAddrLabelSymbolTableToEmit would fail an assertion on such
blocks.  I audited the other callers of getAddrLabelSymbolTableToEmit
(and getAddrLabelSymbol); they all have BBs known to be address-taken
except for the call through getAddrLabelSymbol from
WinException::create32bitRef; that call is actually now unreachable, so
I've removed it and updated the signature of create32bitRef.

This fixes PR25168.

Reviewers: majnemer, andrew.w.kaylor, rnk

Subscribers: pgavlin, llvm-commits

Differential Revision: http://reviews.llvm.org/D13774

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251113 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 15:06:05 +00:00
James Molloy
9d4c13124a [BasicAA] Bugfix for r251016
If the loaded type sizes don't match the element type of the sequential type, all bets are off and the addresses may, indeed, overlap.

Surprisingly, this just got caught in one test, on one builder, out of the 30+ builders testing this change. Congratulations go to http://lab.llvm.org:8011/builders/clang-aarch64-lnt/builds/5205.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 14:17:03 +00:00
James Molloy
61f012782b Revert "[AArch64]Merge halfword loads into a 32-bit load"
This reverts commit r250719. This introduced a codegen fault in SPEC2000.gcc, when compiled for Cortex-A53.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251108 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 10:41:38 +00:00
Sanjoy Das
ebf9b86297 [SCEV] Get rid of an unnecessary lambda; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251099 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 06:57:21 +00:00
Zlatko Buljan
cc40d6fad3 [mips][microMIPS] Implement SHLL.PH, SHLL_S.PH, SHLL.QB, SHLLV.PH, SHLLV_S.PH, SHLLV.QB, SHLLV_S.W, SHLL_S.W, SHRA.QB and SHRA_R.QB instructions
Differential Revision: http://reviews.llvm.org/D13929


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251098 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 06:39:29 +00:00
Sanjoy Das
cc71fa3794 [SCEV] Fix a latent bug in getPreStartForExtend
I could not come up a way to test this -- I think this bug is latent
today, and will not actually result in a miscompile.

In `getPreStartForExtend`, SCEV constructs `PreStart` as a sum of all of
`SA`'s operands except `Op`.  It also uses `SA`'s no-wrap flags, and
this is problematic because removing an element from an add expression
can make it signed-wrap.  E.g. if `SA` was `(127 + 1 + -1)`, then it
could safely be `<nsw>` (since `sext(127) + sext(1) + sext(-1)` ==
`sext(127 + 1 + -1)`), but `(127 + 1)` (== `PreStart` if `Op` is `-1`)
is not `<nsw>`.

Transferring `<nuw>` from `SA` to `PreStart` is safe, as far as I can
tell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251097 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 06:33:47 +00:00
Dylan McKay
bd1e97920a [AVR] Add ELF constants to headers
Also adds a 'trivial' ELF file. This was generated by assembling
and linking a file with the symbol main which contains a single
return instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251096 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 06:05:55 +00:00
Saleem Abdulrasool
2589d46879 Support, IR: silence -Wunused-parameter
If this is used outside of LLVM with -Werror, this would cause a failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 05:26:03 +00:00
Xinliang David Li
d00139475c Add more intrumentation/runtime helper interfaces (NFC)
This patch converts the remaining references to literal
strings for names of profile runtime entites (such as
profile runtime hook, runtime hook use function, profile
init method, register function etc).

Also added documentation for all the new interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 04:22:58 +00:00
Sanjoy Das
61da47f19b [LangRef] Fix the doc for operand bundles
I accidentally messed this up after a merge conflict in a previous
commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251089 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 01:28:05 +00:00
Mehdi Amini
1ac8af11c6 SLPVectorizer: AllSameOpcode* starts "true" only for instructions
r251085 wasn't as NFC as intended...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251087 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 01:04:45 +00:00
Mehdi Amini
ddf3065b5f SLPVectorizer: refactor reorderInputsAccordingToOpcode (NFC)
This is intended to simplify the changes needed to solve PR25247.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251085 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 00:46:17 +00:00
Davide Italiano
8a61a92f84 [CodeGen] Remove usage of NDEBUG in header.
Moreover, this seems unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 00:17:40 +00:00
Kostya Serebryany
7bcc4cdbdd [libFuzzer] use the indirect caller-callee counter as an independent search heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251078 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 23:55:39 +00:00
Kostya Serebryany
41180c6eba [libFuzzer] more refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:56:45 +00:00
Kostya Serebryany
1969ec112d [libFuzzer] refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251074 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 22:50:47 +00:00
Xinliang David Li
a6d5e5a12b Minor bug fix in Profile Name Prefix interface
Exposed in uses by clang FE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251070 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:51:09 +00:00
Kostya Serebryany
a3619c6b43 [libFuzzer] remove the deprecated 'tokens' feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251069 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:48:09 +00:00
Justin Bogner
0df7830790 LoopPass: Remove redoLoop, it isn't used. NFC
In r251064 I removed a logically unreachable call to `redoLoop`, and
now there aren't any callers of this API at all. Remove the needless
complexity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:31:34 +00:00
Justin Bogner
ca9d3aa064 LoopPass: Simplify the API for adding a new loop. NFC
The insertLoop() API is only used to add new loops, and has confusing
ownership semantics. Simplify it by replacing it with addLoop().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251064 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 21:21:32 +00:00
Chen Li
f4a0ff09a8 [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
Summary: Currently SimplifyResume can convert an invoke instruction to a call instruction if its landing pad is trivial. In practice we could have several invoke instructions with trivial landing pads and share a common rethrow block, and in the common rethrow block, all the landing pads join to a phi node. The patch extends SimplifyResume to check the phi of landing pad and their incoming blocks. If any of them is trivial, remove it from the phi node and convert the invoke instruction to a call instruction.  

Reviewers: hfinkel, reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13718

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 20:48:38 +00:00
Xinliang David Li
c417afc098 Add helper functions and remove hard coded references to instProf related name/name-prefixes
This is a clean up patch that defines instr prof section and variable 
name prefixes in a common header with access helper functions. 
clang FE change will be done as a follow up once this patch is in.

Differential Revision: http://reviews.llvm.org/D13919


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251058 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 20:32:12 +00:00
David Majnemer
e6a5192692 [Sink] Don't check BB.empty()
As an invariant, BasicBlocks cannot be empty when passed to a transform.
This is not the case for MachineBasicBlocks and the Sink pass was ported
from the MachineSink pass which would explain the check's existence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251057 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 20:29:08 +00:00
Alexey Samsonov
2afd3e1209 [ASan] Enable instrumentation of dynamic allocas by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 20:07:28 +00:00
Sanjoy Das
221255160a [SCEV] Remove a test case added in r249168
The test case wasn't testing what it was commented to be testing; and
when I tried to fix the test I noticed that SCEV does not support the
simplification that the test was supposed to test.

This change removes the test case to avoid confusion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251053 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:41 +00:00
Sanjoy Das
63c52aea76 [SCEV] Commute zero extends through <nuw> additions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251052 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:38 +00:00
Sanjoy Das
b9d057df5c [SCEV] Opportunistically interpret unsigned constraints as signed
Summary:
An unsigned comparision is equivalent to is corresponding signed version
if both the operands being compared are positive.  Teach SCEV to use
this fact when profitable.

Reviewers: atrick, hfinkel, reames, nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13687

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251051 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:34 +00:00
Sanjoy Das
47b5845e3b [SCEV] Teach SCEV some axioms about non-wrapping arithmetic
Summary:
 - A s<  (A + C)<nsw> if C >  0
 - A s<= (A + C)<nsw> if C >= 0
 - (A + C)<nsw> s<  A if C <  0
 - (A + C)<nsw> s<= A if C <= 0

Right now `C` needs to be a constant, but we can later generalize it to
be a non-constant if needed.

Reviewers: atrick, hfinkel, reames, nlewycky

Subscribers: sanjoy, llvm-commits

Differential Revision: http://reviews.llvm.org/D13686

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251050 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:29 +00:00
Sanjoy Das
f606b2f403 [SCEV] Commute sign extends through nsw additions
Summary: Depends on D13613.

Reviewers: atrick, hfinkel, reames, nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13685

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251049 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:25 +00:00
Sanjoy Das
c05a5c2c86 [SCEV] Mark AddExprs as nsw or nuw if legal
Summary:
This uses `ScalarEvolution::getRange` and not potentially control
dependent `nsw` and `nuw` bits on the arithmetic instruction.

Reviewers: atrick, hfinkel, nlewycky

Subscribers: llvm-commits, sanjoy

Differential Revision: http://reviews.llvm.org/D13613

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251048 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:57:19 +00:00
Alexey Samsonov
bf8252829f [ASan] Minor fixes to dynamic allocas handling:
* Don't instrument promotable dynamic allocas:
  We already have a test that checks that promotable dynamic allocas are
  ignored, as well as static promotable allocas. Make sure this test will
  still pass if/when we enable dynamic alloca instrumentation by default.

* Handle lifetime intrinsics before handling dynamic allocas:
  lifetime intrinsics may refer to dynamic allocas, so we need to emit
  instrumentation before these dynamic allocas would be replaced.

Differential Revision: http://reviews.llvm.org/D12704

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251045 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 19:51:59 +00:00
Davide Italiano
ffd4b26c0e [ExecutionEngine] Garbage collect some dead (and unsafe) code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251042 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:46:27 +00:00
Igor Laevsky
a4e4343a26 [IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table
There is no need to generate separate table for intrinsics mod ref behaviour.
It can now be determined purely from function attributes.

Differential Revision: http://reviews.llvm.org/D13917



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251040 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:35:34 +00:00
Rafael Espindola
d43c001a74 Avoid storing a second copy of each string in StringTableBuilder.
This was only use in the extremely uncommon case of @@@ symbols on ELF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251039 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:32:06 +00:00
Matthias Braun
08abda6dfa AArch64: Disable the latency heuristic
It turned out not to improve any of our benchmarks but occasionally led
to increased register pressure and spilling.

Only enabling for the Cyclone CPU as the results on the cortex CPUs
give mixed results.

Differential Revision: http://reviews.llvm.org/D13708

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251038 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:07:38 +00:00
Matthias Braun
bff324d539 MachineScheduler: Add a way to disable the 'ReduceLatency' heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251037 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 18:07:31 +00:00
Eric Christopher
8df359534b Remove the last traces of X86CompilationCallback as it is completely
unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251035 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 17:55:35 +00:00
Tim Northover
73ec7359f7 CodeGen: increase bits allocated for LegalizeActions
The array handling CondCodes only allocated 2 bits to describe the
desired action for each type. The new addition of a "LibCall" option
overflowed this and caused corruption for Custom actions.

No in-tree targets have a Custom CondCodeAction, so unfortunately it
can't be tested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251033 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 17:20:48 +00:00
Craig Topper
ed05a5b554 Change makeLibCall to take an ArrayRef<SDValue> instead of pointer and size. This removes the need to pass a hardcoded size in many places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251032 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 17:05:00 +00:00
Zachary Turner
30385e0454 Fix broken build under MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 16:42:31 +00:00
Craig Topper
0c065cf3ea Use ArrayRef instead of pointer and size. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251029 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 16:35:56 +00:00
Zia Ansari
02da4e7721 [X86] - Catch extra combine opportunities for redundant imuls.
When we fold "mul ((add x, c1), c1)" -> "add ((mul x, c2), c1*c2)", we bail if (add x, c1) has multiple
users which would result in an extra add instruction.
In such cases, this patch adds a check to see if we can eliminate a multiply instruction in exchange for the extra add.

I also added the capability of doing the existing optimization with non-splatted vectors (splatted also works).

Differential Revision: http://reviews.llvm.org/D13740



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251028 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 16:14:45 +00:00
Bill Schmidt
e2e776f769 [PPC] Fix PR24686 by failing assembly for an invalid relocation
PR24686 identifies a problem where a relocation expression is invalid
when not all of the symbols in the expression can be locally
resolved.  This causes the compiler to request a PC-relative half16ds
relocation, which is nonsensical for PowerPC.  This patch recognizes
this situation and ensures we fail the assembly cleanly.

Test case provided by Anton Blanchard.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 15:53:44 +00:00
Rafael Espindola
1183c6f920 Avoid hash lookups when finalizing StringTableBuilder. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251024 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 15:26:35 +00:00
Rafael Espindola
603127adcc Use array_pod_sort. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251023 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 15:15:44 +00:00
Pirama Arumuga Nainar
bf967a2851 Fix incorrect target triple in fp16-promote.ll
Summary:
Hyphens were missing from the triple, causing it to be parsed
incorrectly.  This patch updates the triple and makes necessary
changes to the expected output.

Patch is from Vinicius Tinti.

Reviewers: ab, tinti

Subscribers: srhines, llvm-commits

Differential Revision: http://reviews.llvm.org/D13792

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-22 14:15:00 +00:00