Commit Graph

123108 Commits

Author SHA1 Message Date
Hans Wennborg
76da85d572 X86ISelLowering: Support tail calls to/from callee pop functions
This enables tail calls with thiscall, stdcall, vectorcall and
fastcall functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 16:47:10 +00:00
Simon Pilgrim
3f3f65ad5f Fix unused variable warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 13:41:45 +00:00
Simon Pilgrim
d0ca754540 [X86][XOP] Add support for lowering vector rotations
This patch adds support for lowering to the XOP VPROT / VPROTI vector bit rotation instructions.

This has required changes to the DAGCombiner rotation pattern matching to support vector types - so far I've only changed it to support splat vectors, but generalising this further is feasible in the future.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 13:17:26 +00:00
Benjamin Kramer
109f9e6f71 [TblGen] ArrayRefize CodeGenSchedule. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 12:46:49 +00:00
Benjamin Kramer
55cb91eee9 [TblGen] ArrayRefize TGParser. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 12:46:45 +00:00
Benjamin Kramer
d2c7e761d2 [BasicAliasAnalysis] Simplify expression, no functional change.
(-1) - x + 1 is the same as -x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 11:38:01 +00:00
NAKAMURA Takumi
a6f34a57ce ScalarReplAggregates.cpp: Try to appease clash of anonymous::SROA in modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 06:42:42 +00:00
Sanjoy Das
5dacfa466d Extract out getConstantRangeFromMetadata; NFC
The loop idiom creating a ConstantRange is repeated twice in the
codebase, time to give it a name and a home.

The loop is also repeated in `rangeMetadataExcludesValue`, but using
`getConstantRangeFromMetadata` there would not be an NFC -- the range
returned by `getConstantRangeFromMetadata` may contain a value that none
of the subranges did.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 05:37:35 +00:00
Sanjoy Das
b4c96f7993 Fix whitespace issues in two places; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251179 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 05:37:28 +00:00
NAKAMURA Takumi
614bd35c79 llvm/Transforms/Utils/LoopVersioning.h requires llvm/Analysis/LoopAccessAnalysis.h for RuntimePointerChecking::PointerCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251178 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 05:26:02 +00:00
Kostya Serebryany
242325ad98 [libFuzzer] add -merge flag to merge corpora
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 01:16:40 +00:00
NAKAMURA Takumi
4a000fe340 Fix ADT/UniqueVector.h to resolve implicit dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 00:27:22 +00:00
NAKAMURA Takumi
4a811ae55d llvm/module.modulemap: AVR.def should be textual header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 00:25:18 +00:00
Matt Arsenault
1d04de1b64 AMDGPU: Print modifiers when dumping AMDGPUOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-24 00:12:56 +00:00
Igor Laevsky
bff0d3a008 [RS4GC] Rename stripDereferenceabilityInfo into stripNonValidAttributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251157 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 22:42:44 +00:00
Rafael Espindola
715bccae4a Add a RAW mode to StringTableBuilder.
In this mode it just tries to tail merge the strings without imposing any other
format constrains. It will not, for example, add a null byte between them.

Also add support for keeping a tentative size and offset if we decide to
not optimize after all.

This will be used shortly in lld for merging SHF_STRINGS sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251153 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 21:48:05 +00:00
Chen Li
15eca1fa30 Revert rL251061 [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251149 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 21:13:01 +00:00
Hal Finkel
71ccd4f786 Handle non-constant shifts in computeKnownBits, and use computeKnownBits for constant folding in InstCombine/Simplify
First, the motivation: LLVM currently does not realize that:

  ((2072 >> (L == 0)) >> 7) & 1 == 0

where L is some arbitrary value. Whether you right-shift 2072 by 7 or by 8, the
lowest-order bit is always zero. There are obviously several ways to go about
fixing this, but the generic solution pursued in this patch is to teach
computeKnownBits something about shifts by a non-constant amount. Previously,
we would give up completely on these. Instead, in cases where we know something
about the low-order bits of the shift-amount operand, we can combine (and
together) the associated restrictions for all shift amounts consistent with
that knowledge. As a further generalization, I refactored all of the logic for
all three kinds of shifts to have this capability. This works well in the above
case, for example, because the dynamic shift amount can only be 0 or 1, and
thus we can say a lot about the known bits of the result.

This brings us to the second part of this change: Even when we know all of the
bits of a value via computeKnownBits, nothing used to constant-fold the result.
This introduces the necessary code into InstCombine and InstSimplify. I've
added it into both because:

  1. InstCombine won't automatically pick up the associated logic in
     InstSimplify (InstCombine uses InstSimplify, but not via the API that
     passes in the original instruction).

  2. Putting the logic in InstCombine allows the resulting simplifications to become
     part of the iterative worklist

  3. Putting the logic in InstSimplify allows the resulting simplifications to be
     used by everywhere else that calls SimplifyInstruction (inlining, unrolling,
     and many others).

And this requires a small change to our definition of an ephemeral value so
that we don't break the rest case from r246696 (where the icmp feeding the
@llvm.assume, is also feeding a br). Under the old definition, the icmp would
not be considered ephemeral (because it is used by the br), but this causes the
assume to remove itself (in addition to simplifying the branch structure), and
it seems more-useful to prevent that from happening.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 20:37:08 +00:00
Tim Northover
bd7189d76c GVN: don't try to replace instruction with itself.
After some look-ahead PRE was added for GEPs, an instruction could end
up in the table of candidates before it was actually inspected. When
this happened the pass might decide it was the best candidate to
replace itself. This didn't go well.

Should fix PR25291

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 20:30:02 +00:00
Rafael Espindola
89cb1b78f9 Fix the variable names to match the LLVM style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251143 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 20:15:35 +00:00
Sanjoy Das
cf0160bc3b [SCEV] Fix stylistic issue in MatchBinaryAddToConst; NFCI
Instead of checking `(FlagsPresent & ExpectedFlags) != 0`, check
`(FlagsPresent & ExpectedFlags) == ExpectedFlags`.  Right now they're
equivalent since `ExpectedFlags` can only be either `FlagNUW` or
`FlagNSW`, but if we ever pass in `ExpectedFlags` as `FlagNUW | FlagNSW`
then checking `(FlagsPresent & ExpectedFlags) != 0` would be wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 20:09:57 +00:00
Sanjoy Das
4935ac6889 [Inliner] Don't inline through callsites with operand bundles
Summary:
This change teaches the LLVM inliner to not inline through callsites
with unknown operand bundles.  Currently all operand bundles are
"unknown" operand bundles but in the near future we will add support for
inlining through some select kinds of operand bundles.

Reviewers: reames, chandlerc, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251141 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 20:09:55 +00:00
Chris Bieneman
d334a86a9f [CMake] Fixing dependency issue with parallel make when building with LLVM_OPTIMIZED_TABLEGEN.
Patch by Alex Wang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251138 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 19:48:17 +00:00
Reid Kleckner
34f572a0d2 [X86] Clean up the tail call eligibility logic
Summary:
The logic here isn't straightforward because our support for
TargetOptions::GuaranteedTailCallOpt.

Also fix a bug where we were allowing tail calls to cdecl functions from
fastcall and vectorcall functions. We were special casing thiscall and
stdcall callers rather than checking for any convention that requires
clearing stack arguments before returning.

Reviewers: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251137 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 19:35:38 +00:00
Lang Hames
2f7d3cda4a [RuntimeDyld][COFF] Fix a think-o in the handling of the IMAGE_REL_AMD64_ADDR64
relocation that was introduced in r250733.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251135 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 18:46:43 +00:00
Kostya Serebryany
b33343ddb1 [libFuzzer] remove some old code; also make __sanitizer_get_total_unique_caller_callee_pairs weak so that newer libFuzzer works with older asan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251133 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 18:37:58 +00:00
Matt Arsenault
481eaf3a10 AMDGPU: Fix parsing of 32-bit literals with sign bit set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251132 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 18:07:58 +00:00
Jonathan Roelofs
3bf3c784c8 Fix another reference to in-source builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251127 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:42:51 +00:00
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