Commit Graph

95448 Commits

Author SHA1 Message Date
Rafael Espindola 128c5ea902 Revert "Add r159136 back now that pr13124 has been fixed."
This reverts commit r189886.

I found a corner case where this optimization is not valid:

Say we have a "linkonce_odr unnamed_addr" in two translation units:
* In TU 1 this optimization kicks in and makes it hidden.
* In TU 2 it gets const merged with a constant that is *not* unnamed_addr,
  resulting in a non unnamed_addr constant with default visibility.
* The static linker rules for combining visibility them produce a hidden
  symbol, which is incorrect from the point of view of the non unnamed_addr
  constant.

The one place we can do this is when we know that the symbol is not used from
another TU in the same shared object, i.e., during LTO. I will move it there.

llvm-svn: 189954
2013-09-04 16:09:01 +00:00
Alexander Kornienko 9aa60fd6f8 Move generic isPrint and columnWidth implementations to a separate header/source to allow using both generic and system-dependent versions on win32.
Summary:
This is needed so we can use generic columnWidthUTF8 in clang-format on
win32 simultaneously with a separate system-dependent implementations of
isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode
characters using narrow-character interfaces (which is not supported on Windows,
and we'll have to figure out how to handle this).

Reviewers: jordan_rose

Reviewed By: jordan_rose

CC: llvm-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D1559

llvm-svn: 189952
2013-09-04 16:00:12 +00:00
Rafael Espindola fac3a018d1 Error on linking appending globals with different unnamed_addr.
llvm-svn: 189950
2013-09-04 15:33:34 +00:00
Venkatraman Govindaraju b803cec00e [Sparc] Fix an assertion failure while lowering fcmp on long double.
This assertion is triggered because an integer constant is created with wrong
  type.

llvm-svn: 189948
2013-09-04 15:15:20 +00:00
Rafael Espindola fd9a9415f5 Fix linking of unnamed_addr in functions.
llvm-svn: 189945
2013-09-04 14:59:03 +00:00
Rafael Espindola df814e976d Rename in preparation for adding tests for function linking.
llvm-svn: 189944
2013-09-04 14:40:49 +00:00
Rafael Espindola 3a3563d4be Use CHECK-DAG instead of sort.
llvm-svn: 189942
2013-09-04 14:35:48 +00:00
NAKAMURA Takumi 7a0423468e Support/Process: Add comments about PageSize and AllocationGranularity on Cygwin and Win32.
llvm-svn: 189940
2013-09-04 14:12:26 +00:00
NAKAMURA Takumi 65fc51bbe2 MemoryBuffer.cpp: Don't peek the next page if file is multiple of *physical* pagesize(4k) but is not multiple of AllocationGranularity(64k), when a null terminator is required, on cygwin and win32.
For example, r189780's SparcISelLowering.cpp has the size 98304. It crashed clang to touch a null terminator on cygwin.

FIXME: It's not good to hardcode 4096 here. dwPageSize shows 4096.
llvm-svn: 189939
2013-09-04 14:12:19 +00:00
NAKAMURA Takumi 9542678508 Whitespace.
llvm-svn: 189938
2013-09-04 14:12:12 +00:00
Rafael Espindola d4885daefa Fix linking of unnamed_addr.
This was regression from r134829. When linking we have to be conservative. If
one of the symbols has a significant address, then the result should have it
too.

llvm-svn: 189935
2013-09-04 14:05:09 +00:00
Tim Northover dc647a2603 InstCombine: allow unmasked icmps to be combined with logical ops
"(icmp op i8 A, B)" is equivalent to "(icmp op i8 (A & 0xff), B)" as a
degenerate case. Allowing this as a "masked" comparison when analysing "(icmp)
&/| (icmp)" allows us to combine them in more cases.

rdar://problem/7625728

llvm-svn: 189931
2013-09-04 11:57:17 +00:00
Tim Northover c0756c454c InstCombine: look for masked compares with subset relation
Even in cases which aren't universally optimisable like "(A & B) != 0 && (A &
C) != 0", the masks can make one of the comparisons completely redundant. In
this case, since we've gone to the effort of spotting masked comparisons we
should combine them.

rdar://problem/7625728

llvm-svn: 189930
2013-09-04 11:57:13 +00:00
Hao Liu d4aede098f Inplement aarch64 neon instructions in AdvSIMD(shift). About 24 shift instructions:
sshr,ushr,ssra,usra,srshr,urshr,srsra,ursra,sri,shl,sli,sqshlu,sqshl,uqshl,shrn,sqrshrun,sqshrn,uqshr,sqrshrn,uqrshrn,sshll,ushll
 and 4 convert instructions:
      scvtf,ucvtf,fcvtzs,fcvtzu

llvm-svn: 189925
2013-09-04 09:28:24 +00:00
Eric Christopher 913152fc64 Use Intrinsic::ID for the pattern match templates, fixing a signed/unsigned
comparison warning.

llvm-svn: 189921
2013-09-04 05:08:32 +00:00
Michael Gottesman c89466fc22 Revert "Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level.""
This reverts commit r189913.

Talked with Eric on IRC. I am going to XFAIL the failing test since it
is using what Eric described as "the member hack" which was needed on
that old GDB.

Sorry for the noise!

llvm-svn: 189914
2013-09-04 04:39:38 +00:00
Michael Gottesman a318370b8d Revert "Remove the darwin gdb option, that version of gdb is now dead and the rest of the compatibility should be done on a dwarf-N level."
This reverts commit r189903.

This commit broke the phase 1 buildbot for a while.

http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/6684

llvm-svn: 189913
2013-09-04 04:31:56 +00:00
Michael Gottesman c9f5859f81 Add llvm namespace to llvm::next.
llvm-svn: 189912
2013-09-04 04:26:09 +00:00
Michael Gottesman 114ac1a230 Use llvm::next() instead of incrementing begin iterators of std::vector.
Iterator of std::vector may be implemented as a raw pointer. In
this case begin iterators are rvalues and cannot be incremented.
For example, this is the case with STDCXX implementation of vector.

Patch by Konstantin Tokarev <annulen@yandex.ru>.

llvm-svn: 189911
2013-09-04 04:19:01 +00:00
NAKAMURA Takumi 8270dcac33 MCDwarf.h: Prune a few stray \param(s). [-Wdocumentation]
\param should be used to describe individual parameters. Use a command like \a or \c for visual enhancements.

llvm-svn: 189905
2013-09-04 02:10:32 +00:00
Eric Christopher 614dc83603 Remove the darwin gdb option, that version of gdb is now dead and
the rest of the compatibility should be done on a dwarf-N level.

llvm-svn: 189903
2013-09-04 02:02:10 +00:00
Eric Christopher 38f1c64098 Make the default dwarf version 3 for darwin when we can't find one
in the module. Add a FIXME with a comment about darwin's ld.

llvm-svn: 189902
2013-09-04 01:38:30 +00:00
Eric Christopher a923e7b78d It's a very large constant. Say so.
llvm-svn: 189899
2013-09-04 00:58:10 +00:00
Rafael Espindola 5eb7df68bf Add r159136 back now that pr13124 has been fixed.
Original message:
If a constant or a function has linkonce_odr linkage and unnamed_addr, mark
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

llvm-svn: 189886
2013-09-03 23:34:36 +00:00
Daniel Dunbar dac381a323 [lit] Allow config files to pass arbitrary values to child configs.
- This aligns with how existing test suites end up wanting to use the local
   config files, conceptually it makes sense to consider them to be inherited.

llvm-svn: 189885
2013-09-03 23:32:55 +00:00
Jim Grosbach 6c6b425b30 X86: Mark non-crashing report_fatal_errors() as such.
Previously, the clang crash handling code would kick in and give a crash
report for these, even though they're not that sort of error.

rdar://14882264

llvm-svn: 189878
2013-09-03 23:02:00 +00:00
Michael Gottesman 469a80cb30 [objc-arc] Remove dead code from previous commit.
llvm-svn: 189870
2013-09-03 22:40:56 +00:00
Michael Gottesman e29b1c1825 [objc-arc] Turn off the objc_retainBlock -> objc_retain optimization.
The reason that I am turning off this optimization is that there is an
additional case where a block can escape that has come up. Specifically, this
occurs when a block is used in a scope outside of its current scope.

This can cause a captured retainable object pointer whose life is preserved by
the objc_retainBlock to be deallocated before the block is invoked.

An example of the code needed to trigger the bug is:

----
\#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
  void (^somethingToDoLater)();

  {
    NSObject *obj = [NSObject new];

    somethingToDoLater = ^{
      [obj self]; // Crashes here
    };
  }

  NSLog(@"test.");

  somethingToDoLater();
  return 0;
}
----

In the next commit, I remove all the dead code that results from this.

Once I put in the fixing commit I will bring back the tests that I deleted in
this commit.

rdar://14802782.
rdar://14868830.

llvm-svn: 189869
2013-09-03 22:40:54 +00:00
Michael Gottesman 9506431fac [objc-arc] Move some block tests from basic.ll -> retain-block.ll and add some missing CHECK-LABELS.
llvm-svn: 189868
2013-09-03 22:40:50 +00:00
Bill Wendling c12fcaed9a Add comments to the CFI instructions and reformat with clang-format. No functionality change.
llvm-svn: 189864
2013-09-03 22:16:52 +00:00
Eric Christopher 3e6c93189b Fix copy and pasto with CMake files for unittest.
llvm-svn: 189863
2013-09-03 22:08:28 +00:00
Eric Christopher 25b7adc8ce Add a hashing routine that handles hashing types. Add a test for
hashing the contents of DW_FORM_data1 on top of a type with attributes.

llvm-svn: 189862
2013-09-03 21:57:57 +00:00
Eric Christopher b86e2ad819 Sentences end with periods.
llvm-svn: 189861
2013-09-03 21:57:50 +00:00
Nadav Rotem 5d78dba6d9 Enable late-vectorization by default.
This patch changes the default setting for the LateVectorization flag that controls where the loop-vectorizer is ran.

Perf gains:
SingleSource/Benchmarks/Shootout/matrix -37.33%
MultiSource/Benchmarks/PAQ8p/paq8p  -22.83%
SingleSource/Benchmarks/Linpack/linpack-pc  -16.22%
SingleSource/Benchmarks/Shootout-C++/ary3 -15.16%
MultiSource/Benchmarks/TSVC/NodeSplitting-flt/NodeSplitting-flt -10.34%
MultiSource/Benchmarks/TSVC/NodeSplitting-dbl/NodeSplitting-dbl -7.12%

Regressions:
SingleSource/Benchmarks/Misc/lowercase  15.10%
MultiSource/Benchmarks/TSVC/Equivalencing-flt/Equivalencing-flt 13.18%
SingleSource/Benchmarks/Shootout-C++/matrix 8.27%
SingleSource/Benchmarks/CoyoteBench/lpbench 7.30%

llvm-svn: 189858
2013-09-03 21:33:17 +00:00
Matt Arsenault ad3029a8de Fix grammar
llvm-svn: 189855
2013-09-03 21:05:51 +00:00
Matt Arsenault 3dfe54e954 Teach InstCombineLoadCast about address spaces.
This is another one that doesn't matter much,
but uses the right GEP index types in the first
place.

llvm-svn: 189854
2013-09-03 21:05:48 +00:00
Matt Arsenault e38e4cdc46 Use type form of getIntPtrType in alloca visitor.
This doesn't actually matter, since alloca is always
0 address space, but this is more consistent.

llvm-svn: 189853
2013-09-03 21:05:15 +00:00
Bill Wendling c656b8e402 WIP: Refactor some code so that it can be called by more than just one method. No functionality change.
llvm-svn: 189849
2013-09-03 20:59:07 +00:00
Eric Christopher c2fa3a4e24 Alphabetize.
llvm-svn: 189848
2013-09-03 20:51:14 +00:00
Joerg Sonnenberger 6c4dc2b218 Add a Python-like join function to merge a list of strings with a
separator between each two elements.

llvm-svn: 189846
2013-09-03 20:43:54 +00:00
Jim Grosbach 20c925dbf2 Revert "Revert "ARM: Improve pattern for isel mul of vector by scalar.""
This reverts commit r189648.

Fixes for the previously failing clang-side arm_neon_intrinsics test
cases will be checked in separately.

llvm-svn: 189841
2013-09-03 20:08:17 +00:00
Eric Christopher e020fa7c9c Add the rest of the stock attributes to the attribute table.
This won't affect the kinds of hashes we test for as we actually
do hashing based on form and attribute. Change the fission-hash
testcase one last time to handle DW_AT_comp_dir.

llvm-svn: 189840
2013-09-03 20:00:20 +00:00
Vincent Lejeune 7deccf0f06 TableGen: Enumerate Schedule Model too.
llvm-svn: 189839
2013-09-03 19:43:28 +00:00
Yi Jiang aeb5b46a85 In this patch we are trying to do two things:
1) If the width of vectorization list candidate is bigger than vector reg width, we will break it down to fit the vector reg.
2) We do not vectorize the width which is not power of two.

The performance result shows it will help some spec benchmarks. mesa improved 6.97% and ammp improved 1.54%. 

llvm-svn: 189830
2013-09-03 17:26:04 +00:00
Joerg Sonnenberger ce91d01a1b Print string value for DT_RPATH and DT_RUNPATH.
llvm-svn: 189829
2013-09-03 17:13:53 +00:00
Joey Gouly f9b6023328 [MC] Revert part of my previous change, I was a bit overzealous.
A change to test the previous commit will be coming soon.

llvm-svn: 189825
2013-09-03 16:18:19 +00:00
Eric Christopher 94de518e51 Migrate the DWARF_VERSION constant to 4. It largely needs to go away.
llvm-svn: 189824
2013-09-03 16:11:13 +00:00
Richard Sandiford 113c870397 [SystemZ] Add support for TMHH, TMHL, TMLH and TMLL
For now this just handles simple comparisons of an ANDed value with zero.
The CC value provides enough information to do any comparison for a
2-bit mask, and some nonzero comparisons with more populated masks,
but that's all future work.

llvm-svn: 189819
2013-09-03 15:38:35 +00:00
Joey Gouly 2993506fa4 [MC] AvailableFeatures needs to be a uint64_t to match FeatureBits in MCSubtargetInfo.
llvm-svn: 189815
2013-09-03 15:03:36 +00:00
Evgeniy Stepanov e95d37c81d [msan] Fix handling of select with struct arguments.
llvm-svn: 189796
2013-09-03 13:05:29 +00:00