Commit Graph

198959 Commits

Author SHA1 Message Date
Jozef Kolek c22555d977 [mips][microMIPSr6] Implement initial subtarget support
Differential Revision: http://reviews.llvm.org/D8386

llvm-svn: 235296
2015-04-20 12:23:06 +00:00
Andrea Di Biagio 98c367093d [X86][FastIsel] Fix assertion failure when selecting int-to-double conversion (PR23273).
This fixes a regression introduced at revision 231243.
The target-independent selection algorithm in FastISel knows how to select
a SINT_TO_FP if the target is SSE but not AVX. That is because on X86, the
tablegen'd 'fastEmit' functions know how to select CVTSI2SSrr and CVTSI2SDrr.

Method X86FastISel::X86SelectSIToFP was therefore working under the
wrong assumption that the target was AVX. That assumption was incorrect since
we can have a target that is neither AVX nor SSE.

So, rather than asserting for the presence of AVX, we should have had an
early exit from 'X86SelectSIToFP' if the target was not AVX.
This patch fixes the issue replacing the invalid assertion with an early exit.

Thanks to Dimitry Andric for reporting this problem and for providing a small
reproducible testcase. Added test pr23273.ll.

llvm-svn: 235295
2015-04-20 11:56:59 +00:00
Dmitry Vyukov 3ff1c381e0 tsan: deflake a test
llvm-svn: 235294
2015-04-20 10:35:21 +00:00
Dmitry Vyukov 8586e2352b tsan: fix handling of pthread_detach
Fixes https://llvm.org/bugs/show_bug.cgi?id=23235

If pthread_create is followed by pthread_detach,
the new thread may not acquire synchronize with
the parent thread.

llvm-svn: 235293
2015-04-20 10:35:10 +00:00
Tamas Berghammer c4ddfd865d Auto advance pc for signle stepping on arm when emulation failes
The arm instruction emulation handles only some of the opcode (including
all of them modifying the PC). For the rest of the instructions we can
advance the PC by the size of the instruction as they don't modify the
PC on any other way.

Differential revision: http://reviews.llvm.org/D9076

llvm-svn: 235292
2015-04-20 10:31:22 +00:00
Tamas Berghammer 35856696b8 Stop read thread of Communication on EOF
Previously the read thread was only stopped if CloseOnEOF was set on the
communication channel. It caused it to spin in case of an EOF because
::select() always reported that we can read from the file descriptor.
This CL change this behavior with stopping the read thread on EOF but do
a disconnect only if CloseOnEOF is enabled.

Differential revision: http://reviews.llvm.org/D9077

llvm-svn: 235291
2015-04-20 09:52:47 +00:00
Simon Atanasyan 84adf3ff15 [Mips] Write DT_MIPS_OPTIONS tag to .dynamic section
If .MIPS.options section exists the DT_MIPS_OPTIONS tag should hold
an address of this section.

llvm-svn: 235290
2015-04-20 07:36:27 +00:00
Simon Atanasyan 8119228977 [Mips] Support R_MICROMIPS_PC18_S3/PC19_S2/PC21_S2/PC26_S2 relocations handling
llvm-svn: 235289
2015-04-20 07:34:52 +00:00
Simon Atanasyan 41ce98cc6f [Mips] Support R_MICROMIPS_GOT_DISP / PAGE / OFST relocations handling
llvm-svn: 235288
2015-04-20 07:33:02 +00:00
Karthik Bhat 78df5fc80e Fix buildbot failure on darwin from r235284.
llvm-svn: 235287
2015-04-20 07:07:10 +00:00
Manuel Klimek b1223b1de5 Fix bug in Replacement's toString on Windows (missing flush).
Adapt function to LLVM coding style.

llvm-svn: 235286
2015-04-20 06:58:56 +00:00
Simon Atanasyan 2da3eb1404 [Mips] Support DT_MIPS_OPTIONS dynamic section tag in the llvm-readobj
llvm-svn: 235285
2015-04-20 05:34:48 +00:00
Karthik Bhat 76aa662cf0 [NFC] Refactor identification of reductions as common utility function.
This patch refactors reduction identification code out of LoopVectorizer and
exposes them as common utilities.
No functional change.
Review: http://reviews.llvm.org/D9046

llvm-svn: 235284
2015-04-20 04:38:33 +00:00
Hal Finkel 1e5733bbed [InlineAsm] Remove EarlyClobber on registers that are also inputs
When an inline asm call has an output register marked as early-clobber, but
that same register is also an input operand, what should we do? GCC accepts
this, and is documented to accept this for read/write operands saying,
"Furthermore, if the earlyclobber operand is also a read/write operand, then
that operand is written only after it's used." For write-only operands, the
situation seems less clear, but I have at least one existing codebase that
assumes this will work, in part because it has syscall macros like this:

({                                                                         \
  register uint64_t r0 __asm__ ("r0") = (__NR_ ## name);                   \
  register uint64_t r3 __asm__ ("r3") = ((uint64_t) (arg0));               \
  register uint64_t r4 __asm__ ("r4") = ((uint64_t) (arg1));               \
  register uint64_t r5 __asm__ ("r5") = ((uint64_t) (arg2));               \
  __asm__ __volatile__                                                     \
  ("sc"                                                                    \
   : "=&r"(r0),"=&r"(r3),"=&r"(r4),"=&r"(r5)                               \
   :   "0"(r0),  "1"(r3),  "2"(r4),  "3"(r5)                               \
   : "r6","r7","r8","r9","r10","r11","r12","cr0","memory");                \
  r3;                                                                      \
})

Furthermore, with register aliases and subregister relationships that only the
backend knows about, rejecting this in the frontend seems like a difficult
proposition (if we wanted to do so). However, keeping the early-clobber flag on
the INLINEASM MI does not work for us, because it will cause the register's
live interval to end to soon (so it will not appear defined to be used as an
input).

Fortunately, fixing this does not seem hard: When forming the INLINEASM MI,
check to see if any of the early-clobber outputs are also inputs, and if so,
remove the early-clobber flag.

llvm-svn: 235283
2015-04-20 00:01:30 +00:00
Davide Italiano 3d9e582a46 Accept --dynamic-linker <file>.
Before we only accepted --dynamic-linker=<file> and -dynamic-linker <file>
but older versions of GNU ld (e.g. 2.17.50) accept this other form, so
try to be compatible.

PR:		23233
llvm-svn: 235282
2015-04-19 23:45:41 +00:00
Simon Pilgrim 749953eebb [X86][SSE] Fix for getScalarValueForVectorElement to detect scalar sources requiring truncation.
The fix ensures that scalar sources inserted into a vector are the correct bit size.

Integer scalar sources from BUILD_VECTOR and SCALAR_TO_VECTOR nodes may require truncation that this function doesn't currently support.

llvm-svn: 235281
2015-04-19 22:16:49 +00:00
Omair Javaid 652e384a7a Fix LLDB ARM GCC4.7 broken build
llvm-svn: 235280
2015-04-19 21:36:06 +00:00
Simon Pilgrim 4c107b5258 [X86][SSE] Extended copysign tests to include llvm intrinsic implementation and constant folding.
llvm-svn: 235279
2015-04-19 21:34:57 +00:00
Simon Atanasyan 247fc2d90e [mips] Update MIPS relocations list
No functional changes.

llvm-svn: 235278
2015-04-19 20:51:55 +00:00
Hal Finkel 0423483bab Make ubsan respect log_path
As with the other sanitizers, it is desirable to allow ubsan's output to be
redirected to somewhere other than stderr (and into per-process log files).

llvm-svn: 235277
2015-04-19 20:16:13 +00:00
Argyrios Kyrtzidis 4ecdd2cff3 [Sema] Check availability of ObjC super class and protocols of a container
in the context of the container itself.

Otherwise we will emit 'unavailable' errors when referencing an unavailable super class
even though the subclass is also marked 'unavailable'.

rdar://20598702

llvm-svn: 235276
2015-04-19 20:15:55 +00:00
Ed Maste 8902e530bc Correct machine type for 32-bit arm
Reported by Andrew Turner.

llvm-svn: 235275
2015-04-19 18:27:00 +00:00
Eric Fiselier 445d718807 Remove constexpr support for std::apply because it introduces regressions.
llvm-svn: 235274
2015-04-19 15:32:52 +00:00
Tobias Grosser 553af2a34c Update isl to a6523fb42c35
A minor update mostly documenting the isl coding style as well as adding
functions to inspect isl_schedule_constraints objects.

llvm-svn: 235273
2015-04-19 09:06:02 +00:00
David Majnemer 936b411bc8 [MS ABI] Correctly associate align attrs before the class-key
__declspec(align(...)) is unlike all other attributes in that it is not
applied to a variable if it appears before the class-key.  If the
tag in question isn't part of a variable declaration, it is not ignored.

Instead, the alignment attribute is applied to the tag.

This fixes PR18024.

llvm-svn: 235272
2015-04-19 07:53:29 +00:00
Tobias Grosser 6f8fd8e98f Dependences: Allow to disable dependences computeout
llvm-svn: 235271
2015-04-19 07:07:26 +00:00
Bob Wilson a2f65bd047 Include __mulodi4 in the 32-bit ARM versions of libclang_rt.cc_kext.a.
This is needed when building the Darwin kernel with
-fsanitize=undefined-trap. rdar://problem/12783702

llvm-svn: 235270
2015-04-19 04:09:44 +00:00
Eric Christopher f2ff50f249 Remove the FCFI option from TargetOptions as it is currently unused.
llvm-svn: 235269
2015-04-19 03:21:08 +00:00
Eric Christopher d2e3ddad14 Remove CFIFuncName from TargetOptions as it is currently unused.
llvm-svn: 235268
2015-04-19 03:21:04 +00:00
Eric Christopher 78804ab2df Remove the CFIEnforcing flag from TargetOptions as it is unused.
llvm-svn: 235267
2015-04-19 03:20:59 +00:00
Eric Christopher cc36f41258 Remove the CFIType TargetOption as it is unused.
llvm-svn: 235266
2015-04-19 03:20:55 +00:00
Eric Christopher 29c47347d8 Remove the JITEmitDebugInfo TargetOptions as they're only set and
not used anywhere in llvm.

llvm-svn: 235265
2015-04-19 03:20:51 +00:00
Richard Smith 9eb309371b Try to work around failure to convert this lambda to a function pointer in some versions of GCC.
llvm-svn: 235264
2015-04-19 01:47:53 +00:00
Richard Smith cf97cf6693 [modules] Refactor macro emission. No functionality change.
llvm-svn: 235263
2015-04-19 01:34:23 +00:00
Craig Topper 43d413b698 Remove unnecessary include and probably a layering violation.
llvm-svn: 235262
2015-04-19 00:57:33 +00:00
Ahmed Bougacha 05b72c1fd8 [MemCpyOpt] Don't force i64 when promoting memset/memcpy sizes.
Harden r235258 to support any integer bitwidth.  The quick glance at
the reference made me think only i32 and i64 were valid types, but
they're not special, so any overload is legal.

Thanks to David Majnemer for noticing!

llvm-svn: 235261
2015-04-18 23:06:04 +00:00
Simon Pilgrim 6292d50eda [X86][AVX2] Force execution domain on broadcast folding tests.
llvm-svn: 235260
2015-04-18 21:24:16 +00:00
Simon Pilgrim e68c8606ed [X86][SSE] Force execution domain on float/double unpack shuffle tests.
llvm-svn: 235259
2015-04-18 18:50:55 +00:00
Ahmed Bougacha 7216ccc3f3 [MemCpyOpt] Promote both memset/memcpy sizes if differently typed.
Followup to r235232, which caused PR23278.

We can't assume the memset and memcpy sizes have the same type, as
nothing in the language reference prevents that.
Instead, zext both to i64 if they disagree.

While there, robustify tests by using i8 %c rather than i8 0 for the
memset character.

llvm-svn: 235258
2015-04-18 17:57:41 +00:00
Benjamin Kramer 2a7404a907 [InstCombine] Create zero constants on demand.
No functional change intended.

llvm-svn: 235257
2015-04-18 16:52:08 +00:00
Tobias Grosser 5a475e7936 Drop unused extern declaration
llvm-svn: 235256
2015-04-18 15:57:56 +00:00
Oleksiy Vyalov 985c9f0ccc Remove usages of host architecture within ELF object file for unknown parts of ArchSpec.
http://reviews.llvm.org/D9078

llvm-svn: 235255
2015-04-18 14:08:16 +00:00
Tobias Grosser 4b6aa6eb8e Clear InsnToMemAcc map in ScopDetection after each runOnFunction
Otherwise, instructions in different functions that share the same pointer (due
to earlier modifications), might get assigned incorrect memory access
information (belonging to instructions in previous functions), which can result
in arbitrary memory corruption and assertion failures.

This fixes llvm.org/PR23160 and possibly also llvm.org/PR23167.

Note: InsnToMemAcc is a global variable that should never have existed in the
first place. We will clean this up in a subsequent patch.

Reported-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Debugged-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
llvm-svn: 235254
2015-04-18 11:01:25 +00:00
Benjamin Kramer 5df7c1a4eb Make helper function static. NFC.
llvm-svn: 235253
2015-04-18 10:00:10 +00:00
Tobias Grosser adfd1b730c Fix typo
llvm-svn: 235252
2015-04-18 09:40:01 +00:00
David Majnemer bc4cc14cd7 [Sema] Don't crash if array bound calculation overflowed constexpr array
We didn't correctly expect a QualifiedTypeLoc when faced with fixing a
variable array type into a constant array type.

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

llvm-svn: 235251
2015-04-18 04:55:51 +00:00
David Majnemer 45951a6626 [InstCombine] (mul nsw 1, INT_MIN) != (shl nsw 1, 31)
Multiplying INT_MIN by 1 doesn't trigger nsw.  However, shifting 1 into
the sign bit *does* trigger nsw.

llvm-svn: 235250
2015-04-18 04:41:30 +00:00
Ahmed Bougacha 279e3ee954 [GlobalMerge] Look at uses to create smaller global sets.
Instead of merging everything together, look at the users of
GlobalVariables, and try to group them by function, to create
sets of globals used "together".

Using that information, a less-aggressive alternative is to keep merging
everything together *except* globals that are only ever used alone, that
is, those for which it's clearly non-profitable to merge with others.

In my testing, grouping by Function is too aggressive, but grouping by
BasicBlock is too conservative.  Anything in-between isn't trivially
available, so stick with Function grouping for now.

cl::opts are added for testing; both enabled by default.

A few of the testcases aren't testing the merging proper, but just
various edge cases when merging does occur.  Update them to use the
previous grouping behavior. Also, one of the tests is unrelated to
GlobalMerge; change it accordingly.
While there, switch to r234666' flags rather than the brutal -O3.

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

llvm-svn: 235249
2015-04-18 01:21:58 +00:00
Duncan P. N. Exon Smith 7c60f20e49 DebugInfo: Delete DIDescriptor (but not its subclasses)
Delete `DIDescriptor` and update the remaining users.  I'll follow-up by
deleting subclasses in manageable groups (top-down).

llvm-svn: 235248
2015-04-18 00:35:36 +00:00
Davide Italiano 9a5b990f27 [GNU/ELF] Add support for -x/--discard-all.
PR:		23232
llvm-svn: 235247
2015-04-18 00:32:38 +00:00