Commit Graph

138720 Commits

Author SHA1 Message Date
Tim Northover
c297159d2f GlobalISel: produce correct code for signext/zeroext ABI flags.
We still don't really have an equivalent of "AssertXExt" in DAG, so we don't
exploit the guarantees on the receiving side yet, but this should produce
conservatively correct code on iOS ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 12:57:45 +00:00
Tim Northover
d79f714b0b GlobalISel: pass Function to lowerFormalArguments directly (NFC).
The only implementation that exists immediately looks it up anyway, and the
information is needed to handle various parameter attributes (stored on the
function itself).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 12:57:35 +00:00
Sam Kolton
d5fca758fa [AMDGPU] Assembler: remove unused AMDGPUMCObjectWriter.
Summary: It is replaced by AMDGPUELFObjectWriter

Reviewers: tstellarAMD, vpykhtin, artem.tamazov

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 10:33:32 +00:00
Simon Dardis
abc7f410e9 [mips] LLVM PR/30197 - Tail call incorrectly clobbers arguments for mips
The postRA scheduler performs alias analysis to determine if stores and loads
can moved past each other. When a function has more arguments than argument
registers for the calling convention used, excess arguments are spilled onto the
stack. LLVM by default assumes that argument slots are immutable, unless the
function contains a tail call. Without the knowledge of that a function contains
a tail call site, stores and loads to fixed stack slots may be re-ordered
causing the out-going arguments to clobber the incoming arguments before the
incoming arguments are supposed to be dead.

Reviewers: vkalintiris

Differential Review: https://reviews.llvm.org/D24077



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 09:43:40 +00:00
Diana Picus
2c37c7740e Revert "AArch64: Set shift bit of TLSLE HI12 add instruction"
This reverts commit r282057 because it broke the buildbots - see e.g.
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/12063

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 08:24:41 +00:00
Lei Liu
437db4fe24 AArch64: Set shift bit of TLSLE HI12 add instruction
Summary: AArch64 LLVM assembler emits add instruction without shift bit to calculate the higher 12-bit address of TLS variables in local exec model.  This generates wrong code sequence to access TLS variables with thread offset larger than 0x1000.

Reviewers: t.p.northover, peter.smith, rovka

Subscribers: salim.nasser, aemerson, llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 07:41:41 +00:00
Craig Topper
8bb1682aae [AVX-512] Split the 3 different usages of the X86ISD::FSETCC opcode into 3 different opcodes.
It turns out isel is really not robust against having different type profiles for the same opcode. It turns out that if you put an illegal rounding mode(i.e. not CUR_DIRECTION or NO_EXC) on a comiss intrinsic we would generate the FSETCC form with the rounding mode added, but then pattern match to an instruction with ROUND_CUR_DIRECTION.

We can probably get away with just one FSETCCM opcode that always contains the rounding mode and explicitly put ROUND_CUR_DIRECTION in the pattern, but I'll leave that for future work.

With this change the clang tests for the comiss intrinsics that used an incorrect rounding mode of 3 properly fail isel instead of silently doing the wrong thing. Those clang tests will be fixed in a follow up commit and I also plan to add rounding mode checking to clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 06:37:54 +00:00
NAKAMURA Takumi
bba417d327 llvm/test/CodeGen/NVPTX/zero-cs.ll: Relax an expression to match in -Asserts.
LLVM ERROR: Cannot select: 0x3607bf0: i32 = ExternalSymbol'__powidf2'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 04:43:11 +00:00
Craig Topper
4ba7f94cd7 [AVX-512] Don't add an additional rounding mode operand to the avx512 vcvtps2ph intrinsic lowering.
There was no way to control its value so it was always FROUND_CURRENT making it unnecessary. The true rounding mode is encoded in the immediate operand of the instruction.

This also removes the pattern from the rb form of the instructions since there is no way to specify the FROUND_NO_EXC rounding mode it required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 03:58:44 +00:00
Craig Topper
3170da55b8 [AVX-512] Simplify handling of INTR_TYPE_1OP_MASK_RM to remove support for the second opcode since its never used. This makes it consistent with INTR_TYPE_2OP_MASK_RM and INTR_TYPE_3OP_MASK_RM.
And even if it was used we were passing the same operands to both so it wouldn't make sense to have two opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 03:58:41 +00:00
Kostya Serebryany
da9d4eb529 [libFuzzer] fix libc++ build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 03:50:37 +00:00
Adam Nemet
860a9f5ba8 [LV] When reporting about a specific instruction without debug location use loop's
This can occur for example if some optimization drops the debug location.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 03:14:20 +00:00
Kostya Serebryany
77ab75a9d6 [libFuzzer] more refactoring; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 02:05:39 +00:00
Craig Topper
dae780fb4b [AVX-512] Don't lower avx512 vcvtps2ph/vcvtph2ps nodes to ISD::FP16_TO_FP/ISD::FP_TO_FP16 with an extra x86 specific rounding mode operand. We should use a target specific ISD opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 02:05:22 +00:00
Jacques Pienaar
1d75557110 [NVPTX] Check if callsite is defined when computing argument allignment
Summary: In getArgumentAlignment check if the ImmutableCallSite pointer CS is non-null before dereferencing. If CS is 0x0 fall back to the ABI type alignment else compute the alignment as before.

Reviewers: eliben, jpienaar

Subscribers: jlebar, vchuravy, cfe-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 01:57:57 +00:00
Kostya Serebryany
2a546868cb [libFuzzer] refactoring: split the large header into many; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 01:50:50 +00:00
Kostya Serebryany
60dd435850 [libFuzzer] refactoring: move the Corpus into a separate class; delete two unused experimental features
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 01:04:43 +00:00
Justin Bogner
40e5ccb260 Revert "TableGen: Switch from a std::map to a DenseMap in CodeGenSubRegIndex. NFC"
It turns out we iterate over this map a fair amount and the order
matters for clang to be deterministic. See:

  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160919/391315.html

This reverts r279875.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21 00:25:45 +00:00
Michael Kuperstein
86978b73fc [InferAttributes] Don't access parameters that don't exist.
Check for the correct number of parameters before querying their type.
This fixes PR30455.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 23:10:31 +00:00
Teresa Johnson
7e15c9e40f [ThinLTO] Always emit a summary when compiling in ThinLTO mode
Summary:
Emit an empty summary section, instead of no summary section, when
there are no global variables in the index. This ensures that LTO
will treat these files as ThinLTO inputs, instead of as regular
LTO inputs.

In addition to not being what the user likely intended when
compiling with -flto=thin, the current behavior is problematic for
distributed build systems that expect to get ThinLTO index and imports
files back for each input compiled with -flto=thin. Combining into
a single regular LTO module also reduces the backend parallelism.
And in the case where the index was suppressed due to uses in
inline assembly, combining into a single LTO module could provoke
renaming of duplicates that we were trying to prevent by suppressing
the index.

This change required a couple of fixes to handle the empty summary
section.

Reviewers: mehdi_amini

Subscribers: mehdi_amini, llvm-commits, pcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 23:07:17 +00:00
Xinliang David Li
7732977995 code cleanup -- commoning IR travsersals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 22:39:47 +00:00
Eric Christopher
810e009188 Remove the default subtarget from the x86 port as it isn't necessary (or
correct) anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 22:19:33 +00:00
Eric Christopher
768be7b1ba Revert "Remove extra argument used once on
TargetMachine::getNameWithPrefix and inline the result into the singular
caller." and "Remove more guts of TargetMachine::getNameWithPrefix and
migrate one check to the TLOF mach-o version." temporarily until I can
get the whole call migrated out of the TargetMachine as we could hit
places where TLOF isn't valid.

This reverts commits r281981 and r281983.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 22:03:28 +00:00
Anna Thomas
61540ac18b [RS4GC] Refactor code for Rematerializing in presence of phi. NFC
Summary:
This is an NFC refactoring change as a precursor to the actual fix for rematerializing in
presence of phi.
https://reviews.llvm.org/D24399

Pasted from review:
findRematerializableChainToBasePointer changed to return the root of the
chain. instead of true or false.
move the PHI matching logic into the caller by inspecting the root return value.
This includes an assertion that the alternate root is in the liveset for the
call.

Tested with current RS4GC tests.

Reviewers: reames, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:36:02 +00:00
George Burgess IV
452ae8c3eb [CodeGen] stop short-circuiting the SSP code for sspstrong.
This check caused us to skip adding layout information for calls to
alloca in sspreq/sspstrong mode. We check properly for sspstrong later
on (and add the correct layout info when doing so), so removing this
shouldn't hurt.

No test is included, since testing this using lit seems to require
checking for exact offsets in asm, which is something that the lit tests
for this avoid. If someone cares deeply, I'm happy to write a unittest
or something to cover this, but that feels like overkill.

Patch by Daniel Micay.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:30:01 +00:00
Vedant Kumar
139080743f [llvm-cov] Demangle names for hidden instantiation views
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:27:48 +00:00
Xinliang David Li
163ac62cd3 [Profile] dump ic value profile value/site-count histogram
Differential Revision: http://reviews.google.com/D24783




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 21:04:22 +00:00
Petr Hosek
38ea316607 Mark ELF sections whose name start with .note as note
Previously, such section would be marked as SHT_PROGBITS which
makes it impossible to use an initialized C variable declaration
to emit an (allocated) ELF note. The new behavior is also consistent
with ELF assembly parser.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282010 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 20:21:13 +00:00
Xinliang David Li
f5969f7e9c [Profile] Do not annotate select insts not covered in profile.
Fixed PR/30466




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 20:20:01 +00:00
Kevin Enderby
7bcdeca5fc Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dylib_command type for the load commands that are
currently used in the MachOObjectFile constructor.

This contains the missing checks for LC_ID_DYLIB, LC_ID_DYLIB, etc.
load commands and the fields for the Mach::dylib_command type.

Also checks that only an MH_DYLIB or MH_STUB_DYLIB has an
LC_ID_DYLIB load command (and others filetype don’t) and there
is not more than one of these load commands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 20:14:14 +00:00
Sanjay Patel
ba03c81918 [x86] split up tests, regenerate checks
Note that we fail to eliminate 'or' with 0!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 19:31:30 +00:00
Xinliang David Li
19dfeb09a7 [Profile] code refactoring: make getStep a method in base class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 19:07:22 +00:00
Evandro Menezes
121f676c40 Revert part of "AArch64: Do not test for CPUs, use SubtargetFeatures"
This reverts part of commit 119e358d9635c8d1f3e7aee67e3ea3b8a62f8db6 by
removing FeatureUseRSqrt et al per request by Eric Christopher
<echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282001 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 19:02:09 +00:00
Evandro Menezes
1bacc96e0e Revert "[AArch64] Use the reciprocal estimation machinery"
This reverts commit b7d42b0048f65346e9fa37fb65defeea7ce8c337 per request by
Eric Christopher <echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 19:02:06 +00:00
Evandro Menezes
ba27f9fd81 Revert "[AArch64] Properly validate the reciprocal estimation."
This reverts commit ad8ca1528242e2a4cb363e3779309e70eb7a430e per request by
Eric Christopher <echristo@gmail.com> (v. http://bit.ly/2cmz6kW).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281999 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 19:02:02 +00:00
Adrian Prantl
3051c6d512 ASAN: Don't drop debug info attachements for global variables.
This is a follow-up to r281284. Global Variables now can have
!dbg attachements, so ASAN should clone these when generating a
sanitized copy of a global variable.

<rdar://problem/24899262>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 18:28:42 +00:00
Adrian McCarthy
864e0ffb0e Fix syntactical nit from r281990.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281991 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 17:42:13 +00:00
Adrian McCarthy
f5f252d099 Emit S_COMPILE3 CodeView record
CodeView has an S_COMPILE3 record to identify the compiler and source language of the compiland.  This record comes first in the debug$S section for the compiland. The debuggers rely on this record to know the source language of the code.

There was a little test fallout from introducing a new record into the symbols subsection.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 17:20:51 +00:00
Saleem Abdulrasool
6530b2f3a0 X86: loosen an overly aggressive MachO assertion
We would assert that the FP setup CFI used esp/rsp always.  This held up in
practice when the code was generated from IR.  However, with the integrated
assembler, it is possible to have the input be user specified assembly.  In such
a case, we cannot assume that the function implementation has a compact unwind
representation.  Loosen the assertion into a check and bail if we cannot
represent the frame pointer in the compact unwinding.

Addresses PR30453!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281986 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 17:05:04 +00:00
Eric Christopher
663e1b0cfc Remove more guts of TargetMachine::getNameWithPrefix and migrate one check to the TLOF mach-o version.
NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281983 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 16:05:02 +00:00
Eric Christopher
57ab7e9f49 Remove a use of subtarget initialization in the X86 backend so we can get rid of the default subtarget.
NFC intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281982 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 16:04:59 +00:00
Eric Christopher
a61998926f Remove extra argument used once on TargetMachine::getNameWithPrefix and inline the result into the singular caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281981 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 16:04:50 +00:00
Keith Walker
4e09440dd5 Improve the -debug output for Debug Range Extension (NFC)
Include header messages and remove unnecessary blank lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 16:04:31 +00:00
Tim Northover
a93f61a2c3 GlobalISel: split aggregates for PCS lowering
This should match the existing behaviour for passing complicated struct and
array types, in particular HFAs come through like that from Clang.

For C & C++ we still need to somehow support all the weird ABI flags, or at
least those that are present in the IR (signext, byval, ...), and stack-based
parameter passing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 15:20:36 +00:00
Simon Pilgrim
e4f1232c49 [X86][SSE] Regenerate multiple combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 14:42:45 +00:00
Sanjay Patel
c091990663 move variables closer to their uses; add FIXMEs; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281972 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 14:36:14 +00:00
Artem Tamazov
412e71bfd8 [AMDGPU][mc] Add regression tests for Bug 28168
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 11:58:40 +00:00
Elena Demikhovsky
8e5c84a8d4 AVX-512: Fixed a bug in lowering saturated operations on KNL.
The generated code is still not optimal.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281966 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 11:02:26 +00:00
Valery Pykhtin
91016854e7 [AMDGPU] Refactor VOP3 instruction TD definitions
Differential revision: https://reviews.llvm.org/D24664

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281965 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 10:41:16 +00:00
Keith Walker
4aaf90e08e Make llvm::ConvertDebugDeclareToDebugValue() be a void function (NFC)
The routines llvm::ConvertDebugDeclareToDebugValue() always returned
a true value which was never checked at the call site; change the
function return type to void.

This NFC cleanup was approved in the review https://reviews.llvm.org/D23715


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281964 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-20 10:36:17 +00:00