platform/upstream/llvm.git
9 years ago[mips] [IAS] Add test for SW with relative label operands. NFC.
Toma Tabacu [Wed, 17 Jun 2015 11:46:37 +0000 (11:46 +0000)]
[mips] [IAS] Add test for SW with relative label operands. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 239899

9 years agoRemove empty directories left after r239657
Alexander Kornienko [Wed, 17 Jun 2015 11:31:18 +0000 (11:31 +0000)]
Remove empty directories left after r239657

llvm-svn: 239898

9 years ago[mips] [IAS] Fix LW with relative label operands.
Toma Tabacu [Wed, 17 Jun 2015 10:43:45 +0000 (10:43 +0000)]
[mips] [IAS] Fix LW with relative label operands.

Summary:
Previously, MCSymbolRefExpr::create() was called with a StringRef of the symbol
name, which it would then search for in the Symbols StringMap (from MCContext).

However, relative labels (which are temporary symbols) are apparently not stored
in the Symbols StringMap, so we end up creating a new {$,.L}tmp symbol
({$,.L}tmp00, {$,.L}tmp10 etc.) each time we create an MCSymbolRefExpr by
passing in the symbol name as a StringRef.

Fortunately, there is a version of MCSymbolRefExpr::create() which takes an
MCSymbol* and we already have an MCSymbol* at that point, so we can just pass
that in instead of the StringRef.

I also removed the local StringRef calls to MCSymbolRefExpr::create() from
expandMemInst(), as those cases can be handled by evaluateRelocExpr() anyway.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 239897

9 years agoFix clang/test/Headers/x86intrin-2.c. _readfsbase_u32() is provided in not i686 but...
NAKAMURA Takumi [Wed, 17 Jun 2015 10:40:51 +0000 (10:40 +0000)]
Fix clang/test/Headers/x86intrin-2.c. _readfsbase_u32() is provided in not i686 but x86-64.

llvm-svn: 239896

9 years ago[OPENMP] Fixed failed test for reduction clause in simd constructs.
Alexey Bataev [Wed, 17 Jun 2015 09:51:18 +0000 (09:51 +0000)]
[OPENMP] Fixed failed test for reduction clause in simd constructs.

llvm-svn: 239895

9 years agoclang-format: [JS] Don't put top-level typescript enums on a single line.
Daniel Jasper [Wed, 17 Jun 2015 09:44:07 +0000 (09:44 +0000)]
clang-format: [JS] Don't put top-level typescript enums on a single line.

This makes this consistent with non-typescript enums.

Also shuffle the language-dependent stuff in mustBreakBefore to a
single location.

Patch initiated by Martin Probst.

llvm-svn: 239894

9 years agoclang-format: [JS] Fix typescript enum formatting.
Daniel Jasper [Wed, 17 Jun 2015 09:44:02 +0000 (09:44 +0000)]
clang-format: [JS] Fix typescript enum formatting.

Patch by Martin Probst.

Before:
  enum {
    A,
    B
  } var x = 1;

After:
  enum {
    A,
    B
  }
  var x = 1;

llvm-svn: 239893

9 years agoclang-format: NFC. Add a function to test whether an annotated line
Daniel Jasper [Wed, 17 Jun 2015 09:43:56 +0000 (09:43 +0000)]
clang-format: NFC. Add a function to test whether an annotated line
starts with a given sequence of tokens. Only the one-token version is
used yet, but other usages are coming up momentarily.

llvm-svn: 239892

9 years ago[PM/AA] Update Polly for r239886 which removed UnknownSize from
Chandler Carruth [Wed, 17 Jun 2015 08:29:32 +0000 (08:29 +0000)]
[PM/AA] Update Polly for r239886 which removed UnknownSize from
AliasAnalysis by getting it from its newly canonical home of
MemoryLocation::UnknownSize.

llvm-svn: 239890

9 years ago[OPENMP] Code reformatting for omp simd codegen, NFC.
Alexey Bataev [Wed, 17 Jun 2015 07:45:51 +0000 (07:45 +0000)]
[OPENMP] Code reformatting for omp simd codegen, NFC.

llvm-svn: 239889

9 years agoAVX-512: cvtusi2ss/d intrinsics.
Igor Breger [Wed, 17 Jun 2015 07:23:57 +0000 (07:23 +0000)]
AVX-512: cvtusi2ss/d intrinsics.
Change builtin function name and signature ( add third parameter - rounding mode ).
Added tests for intrinsics.

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

llvm-svn: 239888

9 years ago[PM/AA] Suffix lots of member variables that directly use enumeration
Chandler Carruth [Wed, 17 Jun 2015 07:21:41 +0000 (07:21 +0000)]
[PM/AA] Suffix lots of member variables that directly use enumeration
names for counts with the word 'Count' to make them less ambiguous.

This will be an actual error if we use unscoped enums for any of these,
and generally this seems much clearer to read.

Also, use clang-format to normalize the formatting of this code which
seems to have been needlessly odd.

No functionality changed here.

llvm-svn: 239887

9 years ago[PM/AA] Remove the UnknownSize static member from AliasAnalysis.
Chandler Carruth [Wed, 17 Jun 2015 07:21:38 +0000 (07:21 +0000)]
[PM/AA] Remove the UnknownSize static member from AliasAnalysis.

This is now living in MemoryLocation, which is what it pertains to. It
is also an enum there rather than a static data member which is left
never defined.

llvm-svn: 239886

9 years ago[PM/AA] Remove the Location typedef from the AliasAnalysis class now
Chandler Carruth [Wed, 17 Jun 2015 07:18:54 +0000 (07:18 +0000)]
[PM/AA] Remove the Location typedef from the AliasAnalysis class now
that it is its own entity in the form of MemoryLocation, and update all
the callers.

This is an entirely mechanical change. References to "Location" within
AA subclases become "MemoryLocation", and elsewhere
"AliasAnalysis::Location" becomes "MemoryLocation". Hope that helps
out-of-tree folks update.

llvm-svn: 239885

9 years ago[PM/AA] Split the location computation out of getArgLocation so the
Chandler Carruth [Wed, 17 Jun 2015 07:12:40 +0000 (07:12 +0000)]
[PM/AA] Split the location computation out of getArgLocation so the
virtual interface on AliasAnalysis only deals with ModRef information.

This interface was both computing memory locations by using TLI and
other tricks to estimate the size of memory referenced by an operand,
and computing ModRef information through similar investigations. This
change narrows the scope of the virtual interface on AliasAnalysis
slightly.

Note that all of this code could live in BasicAA, and be done with
a single investigation of the argument, if it weren't for the fact that
the generic code in AliasAnalysis::getModRefBehavior for a callsite
calls into the virtual aspect of (now) getArgModRefInfo. But this
patch's arrangement seems a not terrible way to go for now.

The other interesting wrinkle is how we could reasonably extend LLVM
with support for custom memory location sizes and mod/ref behavior for
library routines. After discussions with Hal on the review, the
conclusion is that this would be best done by fleshing out the much
desired support for extensions to TLI, and support these types of
queries in that interface where we would likely be doing other library
API recognition and analysis.

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

llvm-svn: 239884

9 years agoUpdate the intel intrinsic headers to use the target attribute support.
Eric Christopher [Wed, 17 Jun 2015 07:09:32 +0000 (07:09 +0000)]
Update the intel intrinsic headers to use the target attribute support.

This involved removing the conditional inclusion and replacing them
with target attributes matching the original conditional inclusion
and checks. The testcase update removes the macro checks for each
file and replaces them with usage of the __target__ attribute, e.g.:

int __attribute__((__target__(("sse3")))) foo(int a) {
  _mm_mwait(0, 0);
  return 4;
}

This usage does require the enclosing function have the requisite
__target__ attribute for inlining and code generation - also for
any macro intrinsic uses in the enclosing function. There's no change
for existing uses of the intrinsic headers.

llvm-svn: 239883

9 years agoUse a define for per-file function attributes for the Intel intrinsic headers.
Eric Christopher [Wed, 17 Jun 2015 07:09:20 +0000 (07:09 +0000)]
Use a define for per-file function attributes for the Intel intrinsic headers.

This is a precursor to changing them to use the new target attribute
code.

llvm-svn: 239882

9 years ago[OPENMP] Supported reduction clause in omp simd construct.
Alexey Bataev [Wed, 17 Jun 2015 06:21:39 +0000 (06:21 +0000)]
[OPENMP] Supported reduction clause in omp simd construct.

The following code is generated for reduction clause within 'omp simd' loop construct:
#pragma omp simd reduction(op:var)
for (...)
  <body>

alloca priv_var
priv_var = <initial reduction value>;
<loop_start>:
<body> // references to original 'var' are replaced by 'priv_var'
<loop_end>:
var op= priv_var;

llvm-svn: 239881

9 years agoRevert "AArch64: Use CMP;CCMP sequences for and/or/setcc trees."
Matthias Braun [Wed, 17 Jun 2015 04:02:32 +0000 (04:02 +0000)]
Revert "AArch64: Use CMP;CCMP sequences for and/or/setcc trees."

The patch triggers a miscompile on SPEC 2006 403.gcc with the (ref)
200.i and scilab.i inputs. I opened PR23866 to track analysis of this.

This reverts commit r238793.

llvm-svn: 239880

9 years agoparser: wordsmith diagnostic message
Saleem Abdulrasool [Wed, 17 Jun 2015 03:54:21 +0000 (03:54 +0000)]
parser: wordsmith diagnostic message

Address post-commit commit about the wording of the warning.

llvm-svn: 239879

9 years agoBasic: tweak whitespace in Attr.td
Saleem Abdulrasool [Wed, 17 Jun 2015 03:54:19 +0000 (03:54 +0000)]
Basic: tweak whitespace in Attr.td

Separate two class definitions that had been merged into a single line.  NFC.

llvm-svn: 239878

9 years agoTry to fix the MSVC build.
Rafael Espindola [Wed, 17 Jun 2015 03:13:26 +0000 (03:13 +0000)]
Try to fix the MSVC build.

llvm-svn: 239877

9 years ago[Hexagon] Adding MC ELF streamer and updating addend relocation test which shows...
Colin LeMahieu [Wed, 17 Jun 2015 03:06:16 +0000 (03:06 +0000)]
[Hexagon] Adding MC ELF streamer and updating addend relocation test which shows correct ELF symbol.

llvm-svn: 239876

9 years ago[.gitignore] ignore vim swap files harder
Sean Silva [Wed, 17 Jun 2015 02:21:35 +0000 (02:21 +0000)]
[.gitignore] ignore vim swap files harder

This matches the patterns for vim swap files in llvm/.gitignore

llvm-svn: 239875

9 years agoRevert r239873 - I actually want to think some more about this
Enrico Granata [Wed, 17 Jun 2015 02:11:48 +0000 (02:11 +0000)]
Revert r239873 - I actually want to think some more about this

llvm-svn: 239874

9 years agoFix an issue where the oneliner printing of variables would ignore custom formatting
Enrico Granata [Wed, 17 Jun 2015 02:06:24 +0000 (02:06 +0000)]
Fix an issue where the oneliner printing of variables would ignore custom formatting

Because vector types use their formats in special ways (i.e. children get generated based on them), this change by itself would cause a regression in printing vector types with some custom formats
Work around that issue by special casing vector types out of this format-passdown mode. I believe there is a more general feature to be designed in this space, but until I see more cases of interest, I am going to leave this as a special case

Fixes rdar://20810062

llvm-svn: 239873

9 years agoFix alignment issues in LLVM.
James Y Knight [Wed, 17 Jun 2015 01:21:20 +0000 (01:21 +0000)]
Fix alignment issues in LLVM.

Adds static_asserts to ensure alignment of concatenated objects is
correct, and fixes them where they are not.

Also changes the definition of AlignOf to use constexpr, except on
MSVC, to avoid enum comparison warnings from GCC.

(There's not too much of this in llvm itself, most of the fun is in
clang).

This seems to make LLVM actually work without Bus Error on 32bit
sparc.

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

llvm-svn: 239872

9 years agoHandle forward referenced function when streaming bitcode.
Rafael Espindola [Wed, 17 Jun 2015 01:15:47 +0000 (01:15 +0000)]
Handle forward referenced function when streaming bitcode.

Without this the included unit test would assert in

  assert(BasicBlockFwdRefs.empty() && "Unresolved blockaddress fwd references");

llvm-svn: 239871

9 years agoHandle MaterializeAll in getLazyBitcodeModuleImpl. NFC.
Rafael Espindola [Wed, 17 Jun 2015 00:40:56 +0000 (00:40 +0000)]
Handle MaterializeAll in getLazyBitcodeModuleImpl. NFC.

This just handles both cases in the same place.

Extracted from a patch by Karl Schimpf.

llvm-svn: 239870

9 years agoCOFF: Support creating DLLs.
Rui Ueyama [Wed, 17 Jun 2015 00:16:33 +0000 (00:16 +0000)]
COFF: Support creating DLLs.

DLL files are in the same format as executables but they have export tables.
The format of the export table is described in PE/COFF spec section 5.3.

A new class, EdataContents, takes care of creating chunks for export tables.
What we need to do is to parse command line flags for dllexports, and then
instantiate the class to create chunks. For the writer, export table chunks
are opaque data -- it just add chunks to .edata section.

llvm-svn: 239869

9 years agoCOFF: Fix tests.
Rui Ueyama [Tue, 16 Jun 2015 23:51:58 +0000 (23:51 +0000)]
COFF: Fix tests.

I was accidentally testing not -flavor link2 but -flavor link.

llvm-svn: 239868

9 years agoUse std::unique_ptr to manage the DataStreamer in bitcode parsing.
Rafael Espindola [Tue, 16 Jun 2015 23:29:49 +0000 (23:29 +0000)]
Use std::unique_ptr to manage the DataStreamer in bitcode parsing.

We were already deleting it, this just makes it explicit.

llvm-svn: 239867

9 years agoRename and improve emitSectionOffset.
Rafael Espindola [Tue, 16 Jun 2015 23:22:02 +0000 (23:22 +0000)]
Rename and improve emitSectionOffset.

Different object formats represent references from dwarf in different ways.

ELF uses a relocation to the referenced point (except for .dwo) and
COFF/MachO use the offset of the referenced point inside its section.

This patch renames emitSectionOffset because

* It doesn't produce an offset on ELF.
* It changes behavior depending on how DWARF is represented, so adding
dwarf to its name is probably a good thing.

The patch also adds an option to force the use of offsets.That avoids
funny looking code like

  if (!UseOffsets)
    Asm->emitSectionOffset....

It was correct, but read as if the ! was inverted.

llvm-svn: 239866

9 years agoAdd a ThreadSafe adapter over llvm::DenseSet
Enrico Granata [Tue, 16 Jun 2015 23:20:12 +0000 (23:20 +0000)]
Add a ThreadSafe adapter over llvm::DenseSet

llvm-svn: 239865

9 years agoCOFF: Add miscellaneous boolean flags.
Rui Ueyama [Tue, 16 Jun 2015 23:13:00 +0000 (23:13 +0000)]
COFF: Add miscellaneous boolean flags.

llvm-svn: 239864

9 years agoClear the "thread-format" setting after mucking with it.
Greg Clayton [Tue, 16 Jun 2015 23:09:37 +0000 (23:09 +0000)]
Clear the "thread-format" setting after mucking with it.

llvm-svn: 239863

9 years agoRefactor RecurrenceInstDesc
Tyler Nowicki [Tue, 16 Jun 2015 22:59:45 +0000 (22:59 +0000)]
Refactor RecurrenceInstDesc

Moved RecurrenceInstDesc into RecurrenceDescriptor to simplify the namespaces.

llvm-svn: 239862

9 years agoFix comments (MI).
Dawn Perchik [Tue, 16 Jun 2015 22:53:27 +0000 (22:53 +0000)]
Fix comments (MI).

llvm-svn: 239861

9 years agoAdd some tests based on PR21711
Sanjay Patel [Tue, 16 Jun 2015 22:37:50 +0000 (22:37 +0000)]
Add some tests based on PR21711

These were originally added in r227242,
but that patch was reverted because it
caused a failure on AArch64.

llvm-svn: 239860

9 years agoUpdate for llvm api change.
Rafael Espindola [Tue, 16 Jun 2015 22:32:44 +0000 (22:32 +0000)]
Update for llvm api change.

llvm-svn: 239859

9 years agoReturn a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC.
Rafael Espindola [Tue, 16 Jun 2015 22:27:55 +0000 (22:27 +0000)]
Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC.

llvm-svn: 239858

9 years ago[modules] Fix merging of default template arguments onto friend templates.
Richard Smith [Tue, 16 Jun 2015 21:57:05 +0000 (21:57 +0000)]
[modules] Fix merging of default template arguments onto friend templates.

Previously we'd complain about redefinition of default arguments when we
instantiated a class with a friend template that inherits its default argument,
because we propagate the default template arguemnt onto the friend when we
reload the AST.

llvm-svn: 239857

9 years ago[llvm-readobj] Print MIPS .reginfo section content
Simon Atanasyan [Tue, 16 Jun 2015 21:47:43 +0000 (21:47 +0000)]
[llvm-readobj] Print MIPS .reginfo section content

llvm-svn: 239856

9 years ago[X86][SSE] Vectorize v2i32 to v2f64 conversions
Simon Pilgrim [Tue, 16 Jun 2015 21:40:28 +0000 (21:40 +0000)]
[X86][SSE] Vectorize v2i32 to v2f64 conversions

This patch enables support for the conversion of v2i32 to v2f64 to use the CVTDQ2PD xmm instruction and stay on the SSE unit instead of scalarizing, sign extending to i64 and using CVTSI2SDQ scalar conversions.

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

llvm-svn: 239855

9 years agoFix a typo in the help.
Jim Ingham [Tue, 16 Jun 2015 21:39:56 +0000 (21:39 +0000)]
Fix a typo in the help.

llvm-svn: 239854

9 years agoAdd a .parent property to SBFrame's Python interface which allows easy access to...
Enrico Granata [Tue, 16 Jun 2015 21:07:52 +0000 (21:07 +0000)]
Add a .parent property to SBFrame's Python interface which allows easy access to the caller frame of the current frame

llvm-svn: 239853

9 years agoHonor the objc_runtime_name attribute when encoding class/protocol names.
Douglas Gregor [Tue, 16 Jun 2015 21:04:55 +0000 (21:04 +0000)]
Honor the objc_runtime_name attribute when encoding class/protocol names.

While the rest of the Objective-C metadata seems to honor
objc_runtime_name, the encoding strings produced by, e.g., @encode and
property meta, were not. Fixes rdar://problem/21408305.

llvm-svn: 239852

9 years agoFixing a potential issue where the NSIndexPath formatter could try to access stale...
Enrico Granata [Tue, 16 Jun 2015 20:48:49 +0000 (20:48 +0000)]
Fixing a potential issue where the NSIndexPath formatter could try to access stale data

No test because I did not see this happen - it has been found by code inspection as a response to seeing crash logs about this

llvm-svn: 239851

9 years agorename variables; NFC
Sanjay Patel [Tue, 16 Jun 2015 20:47:19 +0000 (20:47 +0000)]
rename variables; NFC

...because I see 'StoreBW' and read it as 'store bandwidth'

llvm-svn: 239850

9 years agoReapply 239795 - [InstCombine] Propagate non-null facts to call parameters
Philip Reames [Tue, 16 Jun 2015 20:24:25 +0000 (20:24 +0000)]
Reapply 239795 - [InstCombine] Propagate non-null facts to call parameters

The original change broke clang side tests.  I will be submitting those momentarily.  This change includes post commit feedback on the original change from from Pete Cooper.

Original Submission comments:
If a parameter to a function is known non-null, use the existing parameter attributes to record that fact at the call site. This has no optimization benefit by itself - that I know of - but is an enabling change for http://reviews.llvm.org/D9129.

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

llvm-svn: 239849

9 years agoAdjust clang side tests effected by 239795 before reapplying said change
Philip Reames [Tue, 16 Jun 2015 20:24:06 +0000 (20:24 +0000)]
Adjust clang side tests effected by 239795 before reapplying said change

llvm-svn: 239848

9 years agoextract some code into a helper function for MergeConsecutiveStores(); NFCI
Sanjay Patel [Tue, 16 Jun 2015 20:05:00 +0000 (20:05 +0000)]
extract some code into a helper function for MergeConsecutiveStores(); NFCI

llvm-svn: 239847

9 years agoparser: diagnose empty attribute blocks
Saleem Abdulrasool [Tue, 16 Jun 2015 20:03:47 +0000 (20:03 +0000)]
parser: diagnose empty attribute blocks

MS attributes do not permit empty attribute blocks.  Correctly diagnose those.
We continue to parse to ensure that we recover correctly.  Because the block is
empty, we do not need to skip any tokens.

Bonus: tweak the comment that I updated but forgot to remove the function name
in a previous commit.

llvm-svn: 239846

9 years agoImprove handling of end of file in the bitcode reader.
Rafael Espindola [Tue, 16 Jun 2015 20:03:39 +0000 (20:03 +0000)]
Improve handling of end of file in the bitcode reader.

Before this patch the bitcode reader would read a module from a file
that contained in order:

* Any number of non MODULE_BLOCK sub blocks.
* One MODULE_BLOCK
* Any number of non MODULE_BLOCK sub blocks.
* 4 '\n' characters to handle OS X's ranlib.

Since we support lazy reading of modules, any information that is relevant
for the module has to be in the MODULE_BLOCK or before it. We don't gain
anything from checking what is after.

This patch then changes the reader to stop once the MODULE_BLOCK has been
successfully parsed.

This avoids the ugly special case for .bc files in an archive and makes it
easier to embed bitcode files.

llvm-svn: 239845

9 years agoRemove duplicated alteration to getProgramPaths().
Douglas Katzman [Tue, 16 Jun 2015 19:34:52 +0000 (19:34 +0000)]
Remove duplicated alteration to getProgramPaths().

This appears to have been accidental.

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

llvm-svn: 239844

9 years agoFix PR 23525 - Separate header mass propagation in irregular loops.
Diego Novillo [Tue, 16 Jun 2015 19:10:58 +0000 (19:10 +0000)]
Fix PR 23525 - Separate header mass propagation in irregular loops.

Summary:
When propagating mass through irregular loops, the mass flowing through
each loop header may not be equal. This was causing wrong frequencies
to be computed for irregular loop headers.

Fixed by keeping track of masses flowing through each of the headers in
an irregular loop. To do this, we now keep track of per-header backedge
weights. After the loop mass is distributed through the loop, the
backedge weights are used to re-distribute the loop mass to the loop
headers.

Since each backedge will have a mass proportional to the different
branch weights, the loop headers will end up with a more approximate
weight distribution (as opposed to the current distribution that assumes
that every loop header is the same).

Reviewers: dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 239843

9 years ago[Statepoints] Test only change. Check that statepoint lowering didn't generate more...
Igor Laevsky [Tue, 16 Jun 2015 19:07:05 +0000 (19:07 +0000)]
[Statepoints] Test only change. Check that statepoint lowering didn't generate more than expected amount of spills.
See http://reviews.llvm.org/D10402 for related discussion.

llvm-svn: 239842

9 years agoSafeStack: XFAIL the pthread.c test on Darwin.
Peter Collingbourne [Tue, 16 Jun 2015 18:52:31 +0000 (18:52 +0000)]
SafeStack: XFAIL the pthread.c test on Darwin.

llvm-svn: 239841

9 years agoSafeStack: Adjust condition for COMPILER_RT_HAS_SAFESTACK to fix sanitizer builds.
Peter Collingbourne [Tue, 16 Jun 2015 18:52:28 +0000 (18:52 +0000)]
SafeStack: Adjust condition for COMPILER_RT_HAS_SAFESTACK to fix sanitizer builds.

llvm-svn: 239840

9 years agoEnable 'command script import' to accept multiple modules to import in one invocation
Enrico Granata [Tue, 16 Jun 2015 18:31:04 +0000 (18:31 +0000)]
Enable 'command script import' to accept multiple modules to import in one invocation

Fixes rdar://21388472

llvm-svn: 239839

9 years agoVirtRegMap: Add undef flag when reading undefined subregisters.
Matthias Braun [Tue, 16 Jun 2015 18:22:28 +0000 (18:22 +0000)]
VirtRegMap: Add undef flag when reading undefined subregisters.

While completely undefined registers are easy to catch and get their
<undef> flag early in ProcessImplicitDefs/RegisterCoalescer reading from
a partially defined register where just the subreg happens to be
undefined is harder to catch so we only add the undef flag in the
virtual register rewriting step.

No testcase as I cannot reproduce the problem on any of the in-tree targets at
the moment.

This fixes rdar://21387089

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

llvm-svn: 239838

9 years agoTargetRegisterInfo: Make the concept of imprecise lane masks explicit
Matthias Braun [Tue, 16 Jun 2015 18:22:26 +0000 (18:22 +0000)]
TargetRegisterInfo: Make the concept of imprecise lane masks explicit

LaneMasks as given by getSubRegIndexLaneMask() have a limited number of
of bits, so for targets with more than 31 disjunct subregister there may
be cases where:

   getSubReg(Reg,A) does not overlap getSubReg(Reg,B)

but we still have

   (getSubRegIndexLaneMask(A) & getSubRegIndexLaneMask(B)) != 0.

I had hoped to keep this an implementation detail of the tablegen but as
my next commit shows we can avoid unnecessary imp-defs operands if we
know that the lane masks in use are precise.

This is in preparation to http://reviews.llvm.org/D10470.

llvm-svn: 239837

9 years ago[X86] Rename some frame lowering variables
Reid Kleckner [Tue, 16 Jun 2015 18:08:57 +0000 (18:08 +0000)]
[X86] Rename some frame lowering variables

Old names, new names, and what they really mean:

- IsWin64 -> IsWin64CC: This is true on non-Windows x86_64 platforms
  when the ms_abi calling convention is used.
- IsWinEH -> IsWin64Prologue: True when the target is Win64, regardless
  of calling convention. Changes the prologue to obey the constraints of
  the Win64 unwinder.
- NeedsWinEH -> NeedsWinCFI: We're using the win64 prologue *and* the we
  want .xdata unwind tables. Analogous to NeedsDwarfCFI.

NFC

llvm-svn: 239836

9 years agoRename Reduction variables/structures to Recurrence.
Tyler Nowicki [Tue, 16 Jun 2015 18:07:34 +0000 (18:07 +0000)]
Rename Reduction variables/structures to Recurrence.

A reduction is a special kind of recurrence. In the loop vectorizer we currently
identify basic reductions. Future patches will extend this to identifying basic
recurrences.

llvm-svn: 239835

9 years agoIf/else looks nicer when both branches have (or don't have) braces. NFC
Douglas Katzman [Tue, 16 Jun 2015 18:01:24 +0000 (18:01 +0000)]
If/else looks nicer when both branches have (or don't have) braces. NFC

llvm-svn: 239834

9 years agoHave MachOObjectFile::isValidArch() accept armv7
Frederic Riss [Tue, 16 Jun 2015 17:37:03 +0000 (17:37 +0000)]
Have MachOObjectFile::isValidArch() accept armv7

llvm-svn: 239833

9 years ago[Hexagon] unused-local-typedef warning test is passing.
Colin LeMahieu [Tue, 16 Jun 2015 17:32:45 +0000 (17:32 +0000)]
[Hexagon] unused-local-typedef warning test is passing.

llvm-svn: 239832

9 years agoMIR Parser: Report an error when a machine function doesn't have a corresponding...
Alex Lorenz [Tue, 16 Jun 2015 17:06:29 +0000 (17:06 +0000)]
MIR Parser: Report an error when a machine function doesn't have a corresponding function.

This commit reports an error when a machine function from a MIR file that contains
LLVM IR can't find a function with the same name in the loaded LLVM IR module.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 239831

9 years agoFix compile error in TestCxxWCharT on Linux
Tamas Berghammer [Tue, 16 Jun 2015 16:58:34 +0000 (16:58 +0000)]
Fix compile error in TestCxxWCharT on Linux

llvm-svn: 239830

9 years agoAdd a test for padded bitcode files.
Rafael Espindola [Tue, 16 Jun 2015 16:36:15 +0000 (16:36 +0000)]
Add a test for padded bitcode files.

llvm-svn: 239829

9 years agopropagate IR-level fast-math-flags to DAG nodes, disabled by default
Sanjay Patel [Tue, 16 Jun 2015 16:25:43 +0000 (16:25 +0000)]
propagate IR-level fast-math-flags to DAG nodes, disabled by default

This is an updated version of the patch that was checked in at:
http://reviews.llvm.org/rL237046

but subsequently reverted because it exposed a bug in the DAG Combiner:
http://reviews.llvm.org/D9893

This time, there's an enablement flag ("EnableFMFInDAG") around the code in
SelectionDAGBuilder where we copy the set of FP optimization flags from IR
instructions to DAG nodes. So, in theory, there should be no functional change
from this patch as-is, but it will allow testing with the added functionality
to proceed via "-enable-fmf-dag" passed to llc.

This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997

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

llvm-svn: 239828

9 years agoProperly handle the mftb instruction.
Kit Barton [Tue, 16 Jun 2015 16:01:15 +0000 (16:01 +0000)]
Properly handle the mftb instruction.

The mftb instruction was incorrectly marked as deprecated in the PPC
Backend. Instead, it should not be treated as deprecated, but rather be
implemented using the mfspr instruction. A similar patch was put into GCC last
year. Details can be found at:

https://sourceware.org/ml/binutils/2014-11/msg00383.html.
This change will replace instances of the mftb instruction with the mfspr
instruction for all CPUs except 601 and pwr3. This will also be the default
behaviour.

Additional details can be found in:

https://llvm.org/bugs/show_bug.cgi?id=23680

Phabricator review: http://reviews.llvm.org/D10419

llvm-svn: 239827

9 years ago[Hexagon] Alphabetical ordering of functions, NFC.
Colin LeMahieu [Tue, 16 Jun 2015 15:59:53 +0000 (15:59 +0000)]
[Hexagon] Alphabetical ordering of functions, NFC.

llvm-svn: 239826

9 years agoRevert "Revert "Fix merges of non-zero vector stores""
Matt Arsenault [Tue, 16 Jun 2015 15:51:48 +0000 (15:51 +0000)]
Revert "Revert "Fix merges of non-zero vector stores""

Reapply r239539. Don't assume the collected number of
stores is the same vector size. Just take the first N
stores to fill the vector.

llvm-svn: 239825

9 years agoAdd Read Thread to GDBRemoteCommunication
Ewan Crawford [Tue, 16 Jun 2015 15:50:18 +0000 (15:50 +0000)]
Add Read Thread to GDBRemoteCommunication

In order to support asynchronous notifications for non-stop mode this patch adds a packet read thread. This is done by implementing AppendBytesToCache() from the communications class, which continually reads packets into a packet queue. To initialize this thread StartReadThread() must be called by the client, so since llgs and platform tools use the GBDRemoteCommunicatos code they must also call this function as well as ProcessGDBRemote.

When the read thread detects an async notify packet it broadcasts this event, where the matching listener will be added in the next non-stop patch.

Packets are now accessed by calling ReadPacket() which pops a packet from the queue, instead of using WaitForPacketWithTimeoutMicroSecondsNoLock()

Reviewers: vharron, clayborg

Subscribers: lldb-commits, labath, ted, domipheus, deepak2427

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

llvm-svn: 239824

9 years agoClean up redundant copies of Triple objects. NFC
Daniel Sanders [Tue, 16 Jun 2015 15:44:21 +0000 (15:44 +0000)]
Clean up redundant copies of Triple objects. NFC

Summary:

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin, jholewinski

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

llvm-svn: 239823

9 years ago[SystemZ] Mangle long double as __float128
Ulrich Weigand [Tue, 16 Jun 2015 15:21:47 +0000 (15:21 +0000)]
[SystemZ] Mangle long double as __float128

In r239421, the mangling of long double on PowerPC Linux targets
was changed to use "g" instead of "e".  This same change also needs
to be done for SystemZ (all targets, since we support only Linux
on SystemZ anyway).

This is because an old ABI variant set "long double" to a 64-bit
type equivalent to "double", and the "e" mangling code is still
used to refer to that old ABI for compatibility reasons.

llvm-svn: 239822

9 years ago[InstSimplify] Allow folding of fdiv X, X with just NaNs ignored
Benjamin Kramer [Tue, 16 Jun 2015 14:57:29 +0000 (14:57 +0000)]
[InstSimplify] Allow folding of fdiv X, X with just NaNs ignored

Any combination of +-inf/+-inf is NaN so it's already ignored with
nnan and we can skip checking for ninf. Also rephrase logic in comments
a bit.

llvm-svn: 239821

9 years agoclang-tidy: Add checker that warns about missing parentheses in macros
Daniel Marjamaki [Tue, 16 Jun 2015 14:27:31 +0000 (14:27 +0000)]
clang-tidy: Add checker that warns about missing parentheses in macros

* calculations in the replacement list should be inside parentheses
* macro arguments should be inside parentheses

llvm-svn: 239820

9 years agoRepair cmake libatomic check.
James Y Knight [Tue, 16 Jun 2015 14:00:01 +0000 (14:00 +0000)]
Repair cmake libatomic check.

The cmake check for whether libatomic could be used had been
unconditionally setting the result to false. Which was somewhat
fortunate, because the prerequisite check for whether it was *needed*
was always claiming it was, even if it was not.

However, this made platforms where libatomic is actually necessary
fail to link.

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

llvm-svn: 239819

9 years ago[mips] Don't propagate -mfpxx by default if soft/single float were also set.
Toma Tabacu [Tue, 16 Jun 2015 13:54:13 +0000 (13:54 +0000)]
[mips] Don't propagate -mfpxx by default if soft/single float were also set.

Summary:
If the driver is only given -msoft-float/-mfloat-abi=soft or -msingle-float,
we should refrain from propagating -mfpxx, unless it was explicitly given on the
command line.

Reviewers: atanasyan, dsanders

Reviewed By: atanasyan, dsanders

Subscribers: cfe-commits, mpf

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

llvm-svn: 239818

9 years ago[mips][ias] Expand on r238751 to cover as many relocs as possible.
Daniel Sanders [Tue, 16 Jun 2015 13:46:26 +0000 (13:46 +0000)]
[mips][ias] Expand on r238751 to cover as many relocs as possible.

Summary:
Relocs that can be converted from absolute to PC-relative now do so if IsPCRel
is true. Relocs that require PC-relative now call llvm_unreachable() if IsPCRel
is false and similarly those that require absolute assert that IsPCRel is false.

Note that while it looks like some relocs (e.g. R_MIPS_26) can be converted into
the MIPS32r6/MIPS64r6 relocs (R_MIPS_PC*_S2), it isn't actually valid to do so.

Placeholders have been left in the testcase for unsupported relocs and relocs
that cannot be generated at the moment.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits, rafael

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

llvm-svn: 239817

9 years agoAvoid using set::emplace as it is apparently not supported by gcc 4.7.
Daniel Jasper [Tue, 16 Jun 2015 13:15:54 +0000 (13:15 +0000)]
Avoid using set::emplace as it is apparently not supported by gcc 4.7.

llvm-svn: 239816

9 years agoReplace string GNU Triples with llvm::Triple in TargetMachine::getTargetTriple()...
Daniel Sanders [Tue, 16 Jun 2015 13:15:50 +0000 (13:15 +0000)]
Replace string GNU Triples with llvm::Triple in TargetMachine::getTargetTriple(). NFC.

Summary:
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

llvm-svn: 239815

9 years agoSilence an MSVC warning about not all control paths returning a value; NFC.
Aaron Ballman [Tue, 16 Jun 2015 13:14:59 +0000 (13:14 +0000)]
Silence an MSVC warning about not all control paths returning a value; NFC.

llvm-svn: 239814

9 years ago[OPENMP] Support lastprivate clause in omp simd directive.
Alexey Bataev [Tue, 16 Jun 2015 13:14:42 +0000 (13:14 +0000)]
[OPENMP] Support lastprivate clause in omp simd directive.

Added codegen for lastprivate clauses within simd loop-based directives.

llvm-svn: 239813

9 years agoRecommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInf...
Daniel Sanders [Tue, 16 Jun 2015 12:18:07 +0000 (12:18 +0000)]
Recommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.

Summary:
This affects other tools so the previous C++ API has been retained as a
deprecated function for the moment. Clang has been updated with a trivial
patch (not covered by the pre-commit review) to avoid breaking -Werror builds.
Other in-tree tools will be fixed with similar patches.

This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.

The first time this was committed it accidentally fixed an inconsistency in
triples in llvm-mc and this caused a failure. This inconsistency was fixed in
r239808.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin

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

llvm-svn: 239812

9 years ago[mips] [IAS] Refactor symbol-address loading code into a helper function. NFC.
Toma Tabacu [Tue, 16 Jun 2015 12:16:24 +0000 (12:16 +0000)]
[mips] [IAS] Refactor symbol-address loading code into a helper function. NFC.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 239811

9 years ago[OPENMP] Remove last iteration separation for loop-based constructs.
Alexey Bataev [Tue, 16 Jun 2015 11:59:36 +0000 (11:59 +0000)]
[OPENMP] Remove last iteration separation for loop-based constructs.

Previously the last iteration for simd loop-based OpenMP constructs were generated as a separate code. This feature is not required and codegen is simplified.

llvm-svn: 239810

9 years agoTooling: When applying a set of replacements, do deletions before
Daniel Jasper [Tue, 16 Jun 2015 10:22:10 +0000 (10:22 +0000)]
Tooling: When applying a set of replacements, do deletions before
insertions. It is unlikely to be the intention to delete parts of newly
inserted code. To do so, changed sorting Replacements at the same offset
to have decreasing length.

llvm-svn: 239809

9 years ago[llvm-mc] The object form of the GNU triple should be the same as the string form.
Daniel Sanders [Tue, 16 Jun 2015 09:57:38 +0000 (09:57 +0000)]
[llvm-mc] The object form of the GNU triple should be the same as the string form.

Summary:
GetTarget() may modify TripleName without also updating TheTriple.
This can lead to situations where the MCObjectStreamer has a different triple
to the rest of LLVM.

This inconsistency caused sparc-little-endian.s to pass on Windows because most
of LLVM had sparcel-pc-win32 while MCObjectStreamer had "". I believe the same
kind of thing was also true of Darwin.

Reviewers: rengolin

Reviewed By: rengolin

Subscribers: llvm-commits, rengolin, rafael

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

llvm-svn: 239808

9 years ago[MachineSink] Address post-commit review comments
Arnaud A. de Grandmaison [Tue, 16 Jun 2015 08:57:21 +0000 (08:57 +0000)]
[MachineSink] Address post-commit review comments

The successors cache is now a local variable, making it more visible that it
is only valid for the MBB being processed.

llvm-svn: 239807

9 years ago[AVX512] add integer min/max intrinsics support.
Asaf Badouh [Tue, 16 Jun 2015 08:39:27 +0000 (08:39 +0000)]
[AVX512] add integer min/max intrinsics support.

review:
http://reviews.llvm.org/D10439

llvm-svn: 239806

9 years agoDisable llvm/test/CodeGen/MIR/machine-function.mir on x86 msc18 for now. Investigating.
NAKAMURA Takumi [Tue, 16 Jun 2015 06:57:35 +0000 (06:57 +0000)]
Disable llvm/test/CodeGen/MIR/machine-function.mir on x86 msc18 for now. Investigating.

The emission was as below;

  ---
  name:            foo
  alignment:       31428584
  exposesReturnsTwice: true
  hasInlineAsm:    false
  ...
  ---
  name:            bar
  alignment:       1701667182
  exposesReturnsTwice: false
  hasInlineAsm:    false
  ...
  ---
  name:            func
  alignment:       8
  exposesReturnsTwice: false
  hasInlineAsm:    false
  ...
  ---
  name:            func2
  alignment:       16
  exposesReturnsTwice: true
  hasInlineAsm:    true
  ...

llvm-svn: 239805

9 years agollvm/unittests/Support/Path.cpp: Use <windows.h> instead of <Windows.h>.
NAKAMURA Takumi [Tue, 16 Jun 2015 06:46:16 +0000 (06:46 +0000)]
llvm/unittests/Support/Path.cpp: Use <windows.h> instead of <Windows.h>.

llvm-svn: 239804

9 years agoInstrProf: Fix coverage mapping when "if" is a macro
Justin Bogner [Tue, 16 Jun 2015 06:24:15 +0000 (06:24 +0000)]
InstrProf: Fix coverage mapping when "if" is a macro

We were propagating the coverage map into the body of an if statement,
but not into the condition thereafter. This is fine as long as the two
locations are in the same virtual file, but they won't be when the
"if" part of the statement is from a macro and the condition is not.

llvm-svn: 239803

9 years agoX86: optimized i64 vector multiply with constant
Elena Demikhovsky [Tue, 16 Jun 2015 06:07:24 +0000 (06:07 +0000)]
X86: optimized i64 vector multiply with constant

When we multiply two 64-bit vectors, we extract lower and upper part and use the PMULUDQ instruction.
When one of the operands is a constant, the upper part may be zero, we know this at compile time.
Example: %a = mul <4 x i64> %b, <4 x i64> < i64 5, i64 5, i64 5, i64 5>.
I'm checking the value of the upper part and prevent redundant "multiply", "shift" and "add" operations.

llvm-svn: 239802

9 years ago[TableGen] Remove unused method declaration. NFC
Craig Topper [Tue, 16 Jun 2015 05:44:06 +0000 (05:44 +0000)]
[TableGen] Remove unused method declaration. NFC

llvm-svn: 239801

9 years agoRevert 239795
Philip Reames [Tue, 16 Jun 2015 01:20:53 +0000 (01:20 +0000)]
Revert 239795

I forgot to update some clang test cases.  I'll fix and resubmit tomorrow.

llvm-svn: 239800

9 years ago[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.
Ahmed Bougacha [Tue, 16 Jun 2015 01:18:14 +0000 (01:18 +0000)]
[AArch64] Generalize extract-high DUP extension to MOVI/MVNI.

These are really immediate DUPs, and suffer from the same problem
with long instructions with a high/2 variant (e.g. smull).

By extending a MOVI (or DUP, before this patch), we can avoid an ext
on the other operand of the long instruction, e.g. turning:
    ext.16b v0, v0, v0, #8
    movi.4h v1, #0x53
    smull.4s  v0, v0, v1
into:
    movi.8h v1, #0x53
    smull2.4s  v0, v0, v1

While there, add a now-necessary combine to fold (VT NVCAST (VT x)).

llvm-svn: 239799