platform/upstream/llvm.git
9 years agoRevert "X86: Reject register operands with obvious type mismatches."
Matthias Braun [Fri, 26 Jun 2015 00:26:49 +0000 (00:26 +0000)]
Revert "X86: Reject register operands with obvious type mismatches."

Revert until http://llvm.org/PR23955 is investigated.

This reverts commit r239309.

llvm-svn: 240746

9 years agoFix mismatched architectures in test
Matthias Braun [Fri, 26 Jun 2015 00:26:46 +0000 (00:26 +0000)]
Fix mismatched architectures in test

llvm-svn: 240745

9 years agoaad/fix labels in test/CodeGen/X86/StackColoring.ll
Matthias Braun [Fri, 26 Jun 2015 00:26:44 +0000 (00:26 +0000)]
aad/fix labels in test/CodeGen/X86/StackColoring.ll

llvm-svn: 240744

9 years agoAdd new file from r240741 to CMakeLists.txt.
Nico Weber [Fri, 26 Jun 2015 00:19:32 +0000 (00:19 +0000)]
Add new file from r240741 to CMakeLists.txt.

llvm-svn: 240743

9 years ago[Sema] Commit a better fix for r240242
Davide Italiano [Fri, 26 Jun 2015 00:18:35 +0000 (00:18 +0000)]
[Sema] Commit a better fix for r240242

Skip calls to HasTrivialDestructorBody() in the case where the
destructor is never invoked. Alternatively, Richard proposed to change
Sema to declare a trivial destructor for anonymous union member, which
seems too wasteful.

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

llvm-svn: 240742

9 years agoAdd an inttypes.h wrapper that fixes up some macros in Microsoft mode.
Nico Weber [Fri, 26 Jun 2015 00:13:18 +0000 (00:13 +0000)]
Add an inttypes.h wrapper that fixes up some macros in Microsoft mode.

Before MSVS2015, MSVS's headers disagree about int32_t and PRIx32 and so on.
Provide a wrapper header to fix this, so that -Wformat can still be used.
Fixes PR23412.

llvm-svn: 240741

9 years ago[Sema] Maintain ellipsis location when transforming lambda captures
Meador Inge [Fri, 26 Jun 2015 00:09:55 +0000 (00:09 +0000)]
[Sema] Maintain ellipsis location when transforming lambda captures

This patch fixes a crash caused by the following case:

  template<typename T>
  auto f(T x) {
    auto g = [](auto ... args) {
      auto h = [args...]() -> int {
        return 0;
      };
      return h;
    };
    return g;
  }

  auto x = f(0)();

When the templated function 'f' is instantiated and the inner-most
lambda is transformed the ellipsis location on the captured variable
is lost.  Then the lambda returned by 'f' is instantiated and the
tree transformer chokes on the invalid ellipsis location.  The
problem is fixed by making a minor change to properly track the
ellipsis location.

This fixes PR23716.

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

llvm-svn: 240740

9 years agoUse the right ifdef macro, reviewed by Jason
Han Ming Ong [Fri, 26 Jun 2015 00:04:51 +0000 (00:04 +0000)]
Use the right ifdef macro, reviewed by Jason

llvm-svn: 240739

9 years ago[ASan] Use llvm::getDISubprogram() to get function entry debug location.
Alexey Samsonov [Fri, 26 Jun 2015 00:00:47 +0000 (00:00 +0000)]
[ASan] Use llvm::getDISubprogram() to get function entry debug location.

It can be more robust than copying debug info from first non-alloca
instruction in the entry basic block. We use the same strategy in
coverage instrumentation.

llvm-svn: 240738

9 years agoRe-enable 'process save-core' for arm64 targets.
Jason Molenda [Thu, 25 Jun 2015 23:58:25 +0000 (23:58 +0000)]
Re-enable 'process save-core' for arm64 targets.
Whatever problem I saw that caused me to disable this
initially is not a problem today.
<rdar://problem/21173317>
<rdar://problem/20266253>

llvm-svn: 240737

9 years agoAsmPrinter: Use an intrusively linked list for DIE::Children
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 23:52:10 +0000 (23:52 +0000)]
AsmPrinter: Use an intrusively linked list for DIE::Children

Replace the `std::vector<>` for `DIE::Children` with an intrusively
linked list.  This is a strict memory improvement: it requires no
auxiliary storage, and reduces `sizeof(DIE)` by one pointer.  It also
factors out the DIE-related malloc traffic.

This drops llc memory usage from 735 MB down to 718 MB, or ~2.3%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 240736

9 years ago[CodeGen] Restrict isTriviallyRecursive to predefined lib functions forwarding to...
David Majnemer [Thu, 25 Jun 2015 23:50:40 +0000 (23:50 +0000)]
[CodeGen] Restrict isTriviallyRecursive to predefined lib functions forwarding to lib functions

isTriviallyRecursive is only supposed to guard functions part of the
implementation.

This fixes PR23953.

llvm-svn: 240735

9 years agoFix a typo correction crash when resolving ambiguous corrections.
Kaelyn Takata [Thu, 25 Jun 2015 23:47:39 +0000 (23:47 +0000)]
Fix a typo correction crash when resolving ambiguous corrections.

In certain cases, the tree transform would introduce new TypoExprs while
trying one of the corrections, invalidating the unique_ptr in the state
reference, and also causing a TypoExpr to exist that will never be
corrected since it doesn't exist in the final corrected expression. The
simple solution to both problems is to temporarily disable typo
correction while handling potentially ambiguous typo corrections.

llvm-svn: 240734

9 years agoAsmPrinter: Convert DIE::Values to a linked list
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 23:46:41 +0000 (23:46 +0000)]
AsmPrinter: Convert DIE::Values to a linked list

Change `DIE::Values` to a singly linked list, where each node is
allocated on a `BumpPtrAllocator`.  In order to support `push_back()`,
the list is circular, and points at the tail element instead of the
head.  I abstracted the core list logic out to `IntrusiveBackList` so
that it can be reused for `DIE::Children`, which also cares about
`push_back()`.

This drops llc memory usage from 799 MB down to 735 MB, about 8%.

(I'm looking at `llc` memory usage on `verify-uselistorder.lto.opt.bc`;
see r236629 for details.)

llvm-svn: 240733

9 years agollvm api change.
Michael J. Spencer [Thu, 25 Jun 2015 23:41:55 +0000 (23:41 +0000)]
llvm api change.

llvm-svn: 240732

9 years ago[ELF] Move ELF{32,64}{L,B}E typedefs to llvm.
Michael J. Spencer [Thu, 25 Jun 2015 23:41:23 +0000 (23:41 +0000)]
[ELF] Move ELF{32,64}{L,B}E typedefs to llvm.

llvm-svn: 240731

9 years ago[ELF] Add some accessors for lld.
Michael J. Spencer [Thu, 25 Jun 2015 23:40:41 +0000 (23:40 +0000)]
[ELF] Add some accessors for lld.

llvm-svn: 240730

9 years agoMake llvm-dwarfdump exit with non-zero exit code if error was occured.
Alexey Samsonov [Thu, 25 Jun 2015 23:40:15 +0000 (23:40 +0000)]
Make llvm-dwarfdump exit with non-zero exit code if error was occured.

llvm-svn: 240729

9 years agordar://problem/21469556
Han Ming Ong [Thu, 25 Jun 2015 23:39:56 +0000 (23:39 +0000)]
rdar://problem/21469556
Make sure that the memory report is correct for 64-bit devices.

llvm-svn: 240728

9 years agoPPCISelLowering.cpp: Appease PR23956. [-Wdocumentation]
NAKAMURA Takumi [Thu, 25 Jun 2015 23:38:44 +0000 (23:38 +0000)]
PPCISelLowering.cpp: Appease PR23956. [-Wdocumentation]

llvm-svn: 240727

9 years agoSplit test up into two target-spcific directories.
Adrian Prantl [Thu, 25 Jun 2015 23:38:22 +0000 (23:38 +0000)]
Split test up into two target-spcific directories.

llvm-svn: 240726

9 years ago[docs] Several updates to the Address Sanitizer webpage.
Anna Zaks [Thu, 25 Jun 2015 23:36:44 +0000 (23:36 +0000)]
[docs] Several updates to the Address Sanitizer webpage.

 - Added the description of the interceptor suppression.
 - Re-organized a bit: grouped a few things under the Issue Suppression
   section, grouped IOC and leaks under a section, placed symbolication
   info into Symbolizing the Reports section..
 - In supported platforms: "MacOS" -> "OS X"; added "iOS Simulator"
 - Added a paragraph to the Usage section describing when DYLD_INSERT_LIBRARIES
   might need to be used.
 - "attribute((no_sanitize_address))" -> "__attribute__((no_sanitize("address")))"
 - Updated Leak Sanitizer page with most up to date info.
....

http://reviews.llvm.org/D10559

llvm-svn: 240725

9 years ago[asan] Do not unset DYLD_ROOT_PATH before calling atos on Darwin
Anna Zaks [Thu, 25 Jun 2015 23:36:21 +0000 (23:36 +0000)]
[asan] Do not unset DYLD_ROOT_PATH before calling atos on Darwin

We were unsetting DYLD_ROOT_PATH before calling atos on Darwin in order to
address it not working for symbolicating 32 bit binaries. (atos essentiall
tries to respawn as a 32 bit binary and it's disallowed to respawn if
DYLD_ROOT_PATH is set ... ) However, processes rely on having DYLD_ROOT_PATH
set under certain conditions, so this is not the right fix. In particular, this
always crashes when running ASanified process under the debugger in Xcode with
iOS simulator, which is a very important workflow for us to support.

This patch reverts the unsetting of the DYLD_ROOT_PATH. The correct fix to the
misbehavior on 32-bit binaries should happen inside atos.

http://reviews.llvm.org/D10722

llvm-svn: 240724

9 years ago[asan] Do not instrument special purpose LLVM sections.
Anna Zaks [Thu, 25 Jun 2015 23:35:48 +0000 (23:35 +0000)]
[asan] Do not instrument special purpose LLVM sections.

Do not instrument globals that are placed in sections containing "__llvm"
in their name.

This fixes a bug in ASan / PGO interoperability. ASan interferes with LLVM's
PGO, which places its globals into a special section, which is memcpy-ed by
the linker as a whole. When those goals are instrumented, ASan's memcpy wrapper
reports an issue.

http://reviews.llvm.org/D10541

llvm-svn: 240723

9 years ago[asan] Don't run stack malloc on functions containing inline assembly.
Anna Zaks [Thu, 25 Jun 2015 23:35:45 +0000 (23:35 +0000)]
[asan] Don't run stack malloc on functions containing inline assembly.

It makes LLVM run out of registers even on 64-bit platforms. For example, the
following test case fails on darwin.

clang -cc1 -O0 -triple x86_64-apple-macosx10.10.0 -emit-obj -fsanitize=address -mstackrealign -o ~/tmp/ex.o -x c ex.c
error: inline assembly requires more registers than available

void TestInlineAssembly(const unsigned char *S, unsigned int pS, unsigned char *D, unsigned int pD, unsigned int h) {

unsigned int sr = 4, pDiffD = pD - 5;
unsigned int pDiffS = (pS << 1) - 5;
char flagSA = ((pS & 15) == 0),
flagDA = ((pD & 15) == 0);
asm volatile (
  "mov %0,  %%"PTR_REG("si")"\n"
  "mov %2,  %%"PTR_REG("cx")"\n"
  "mov %1,  %%"PTR_REG("di")"\n"
  "mov %8,  %%"PTR_REG("ax")"\n"
  :
  : "m" (S), "m" (D), "m" (pS), "m" (pDiffS), "m" (pDiffD), "m" (sr), "m" (flagSA), "m" (flagDA), "m" (h)
  : "%"PTR_REG("si"), "%"PTR_REG("di"), "%"PTR_REG("ax"), "%"PTR_REG("cx"), "%"PTR_REG("dx"), "memory"
);
}

http://reviews.llvm.org/D10719

llvm-svn: 240722

9 years agoCOFF: Rename /opt:icf -> /opt:lldicf.
Rui Ueyama [Thu, 25 Jun 2015 23:26:58 +0000 (23:26 +0000)]
COFF: Rename /opt:icf -> /opt:lldicf.

ICF implemented in LLD is so experimental that we don't want to
enable that even if /opt:icf option is passed. I'll rename it back
once the feature is complete.

llvm-svn: 240721

9 years agoRemove `requires` for x86 CPU features.
Sean Silva [Thu, 25 Jun 2015 23:22:11 +0000 (23:22 +0000)]
Remove `requires` for x86 CPU features.

Ever since the target attributes change, we don't need to guard these
headers with `requires`. Actually it's a bit worse, because if we do
then they are included textually under the covers, causing declarations
to appear in submodules they aren't supposed to be in.

llvm-svn: 240720

9 years agoCOFF: Better error message for duplicate symbols.
Rui Ueyama [Thu, 25 Jun 2015 23:22:00 +0000 (23:22 +0000)]
COFF: Better error message for duplicate symbols.

Now the symbol table prints out not only symbol names but
also file names for duplicate symbols.

llvm-svn: 240719

9 years agoFix the test added in r240710.
Jonathan Roelofs [Thu, 25 Jun 2015 23:21:11 +0000 (23:21 +0000)]
Fix the test added in r240710.

llvm-svn: 240718

9 years agoDebug Info: Add basic test coverage for the DWARF encoding of bitfields.
Adrian Prantl [Thu, 25 Jun 2015 23:19:19 +0000 (23:19 +0000)]
Debug Info: Add basic test coverage for the DWARF encoding of bitfields.

While looking at a couple of bugs in the debug info output for bitfields
I noticed that there wasn't a single regression test to test my changes
against, so here's a start.

llvm-svn: 240717

9 years ago[CFI] Diagnose when we CFI in diagnostic mode is unavailable on a toolchain.
Alexey Samsonov [Thu, 25 Jun 2015 23:14:32 +0000 (23:14 +0000)]
[CFI] Diagnose when we CFI in diagnostic mode is unavailable on a toolchain.

Summary:
Namely, we must have proper C++ABI support in UBSan runtime. We don't
have a good way to check for that, so just assume that C++ABI support is
there whenever -fsanitize=vptr is supported (i.e. only on handful of
platforms).

Exact diagnostic is also tricky. It's not "cfi" that is unsupported,
just the diagnostic mode. So, I suggest to report that
"-fno-sanitize-trap=cfi-foobar" is incompatible with a given target
toolchain.

Test Plan: regression test suite

Reviewers: pcc

Subscribers: cfe-commits

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

llvm-svn: 240716

9 years agoDisplay profile file name when emitting a file not found diagnostic.
Diego Novillo [Thu, 25 Jun 2015 22:56:00 +0000 (22:56 +0000)]
Display profile file name when emitting a file not found diagnostic.

When a profile file cannot be opened, we used to display just the error
message but not the name of the profile the compiler was trying to open.
This will become useful in the next set of patches that introduce
GCC-compatible flags to specify profiles.

llvm-svn: 240715

9 years agoXcode project cleanups.
Greg Clayton [Thu, 25 Jun 2015 22:47:02 +0000 (22:47 +0000)]
Xcode project cleanups.

- Don't have any header files claim to be part of the lldb-core target. If they are part of the lldb-core target then any file can just #include the header file name without the prefix (#include "Foo.h") when the cmake/make/other builds would require a full path (#include "lldb/Core/Foo.h"). This will help make sure the builds succeed on all platforms when changes are made on MacOSX.
- Add the Hexagon dynamic loader to the DynamicLoader plug-in folder so it gets compiled in MacOSX. There was a recent build bot failure that wasn't caught due to this code not being compile in the MacOSX build

llvm-svn: 240714

9 years agoMark armv7em and armv7m as compatible architectures.
Jason Molenda [Thu, 25 Jun 2015 22:37:57 +0000 (22:37 +0000)]
Mark armv7em and armv7m as compatible architectures.
<rdar://problem/21244671>

llvm-svn: 240713

9 years agoCommit file that was missing 240466.
Greg Clayton [Thu, 25 Jun 2015 22:34:08 +0000 (22:34 +0000)]
Commit file that was missing 240466.

<rdar://problem/21494354>

llvm-svn: 240712

9 years agoUnbreak the build.
Greg Clayton [Thu, 25 Jun 2015 22:20:02 +0000 (22:20 +0000)]
Unbreak the build.

llvm-svn: 240711

9 years agoThis should actually fix the broken bots.
Chris Bieneman [Thu, 25 Jun 2015 22:15:39 +0000 (22:15 +0000)]
This should actually fix the broken bots.

llvm-svn: 240710

9 years agoDAGCombiner: Use pop_back_val()
Matt Arsenault [Thu, 25 Jun 2015 22:15:05 +0000 (22:15 +0000)]
DAGCombiner: Use pop_back_val()

llvm-svn: 240709

9 years agoAdd an ELFSymbolRef type.
Rafael Espindola [Thu, 25 Jun 2015 22:10:04 +0000 (22:10 +0000)]
Add an ELFSymbolRef type.

This allows user code to say Sym.getSize() instead of having to manually fetch
the object.

llvm-svn: 240708

9 years ago[Parse] Allow 'constexpr' in condition declarations
Meador Inge [Thu, 25 Jun 2015 22:06:40 +0000 (22:06 +0000)]
[Parse] Allow 'constexpr' in condition declarations

This patch implements the functionality specified by DR948.
The changes are two fold.  First, the parser was modified
to allow 'constexpr's to appear in condition declarations
(which was a hard error before).  Second, Sema was modified
to cleanup maybe odr-used declarations by way of a call to
'ActOnFinishFullExpr'.  As 'constexpr's were not allowed in
condition declarations before the cleanup wasn't necessary
(such declarations were always odr-used).

This fixes PR22491.

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

llvm-svn: 240707

9 years agoCOFF: Merge DefinedRegular and DefinedCOMDAT.
Rui Ueyama [Thu, 25 Jun 2015 22:00:42 +0000 (22:00 +0000)]
COFF: Merge DefinedRegular and DefinedCOMDAT.

I split them in r240319 because I thought they are different enough
that we should treat them as different types. It turned out that
that was not a good idea. They are so similar that we ended up having
many duplicate code.

llvm-svn: 240706

9 years agoIAS: Use the root macro instanciation for location
Frederic Riss [Thu, 25 Jun 2015 21:57:33 +0000 (21:57 +0000)]
IAS: Use the root macro instanciation for location

r224810 fixed the handling of macro debug locations in AsmParser. This patch
fixes the logic to actually do what was intended: it uses the first macro of
the macro stack instead of the last one. The updated testcase shows that the
current scheme doesn't work when macro instanciations are nested and multiple
files are used.

Reviewers: compnerd

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

llvm-svn: 240705

9 years ago[Object][ELF] Add support for dumping dynamic relocations when sections are stripped.
Michael J. Spencer [Thu, 25 Jun 2015 21:47:32 +0000 (21:47 +0000)]
[Object][ELF] Add support for dumping dynamic relocations when sections are stripped.

llvm-svn: 240703

9 years agoResubmitting 240466 after fixing the linux test suite failures.
Greg Clayton [Thu, 25 Jun 2015 21:46:34 +0000 (21:46 +0000)]
Resubmitting 240466 after fixing the linux test suite failures.

A few extras were fixed

- Symbol::GetAddress() now returns an Address object, not a reference. There were places where people were accessing the address of a symbol when the symbol's value wasn't an address symbol. On MacOSX, undefined symbols have a value zero and some places where using the symbol's address and getting an absolute address of zero (since an Address object with no section and an m_offset whose value isn't LLDB_INVALID_ADDRESS is considered an absolute address). So fixing this required some changes to make sure people were getting what they expected.
- Since some places want to access the address as a reference, I added a few new functions to symbol:
    Address &Symbol::GetAddressRef();
    const Address &Symbol::GetAddressRef() const;

Linux test suite passes just fine now.

<rdar://problem/21494354>

llvm-svn: 240702

9 years agodsymutil: Split out patchStmtList(), NFC
Duncan P. N. Exon Smith [Thu, 25 Jun 2015 21:42:46 +0000 (21:42 +0000)]
dsymutil: Split out patchStmtList(), NFC

Split out code to patch up the `DW_AT_stmt_list` for the cloned DIE, and
reorganize it so that it doesn't depend on `DIE::values_begin()` and
`DIE::values_end()` (which I'm trying to kill off).

David Blaikie and I talked about adding a range-algorithm version of
`std::find_if()`, but the assertion *still* required getting at the end
iterator.  IMO, a separate helper function with an early return is
easier to reason about here.

A follow-up commit that removes `DIE::setValue()` and mutates the
`DIEValue` directly is coming shortly.

llvm-svn: 240701

9 years ago[modules] Properly merge visibility of class definitions that got merged while
Richard Smith [Thu, 25 Jun 2015 21:42:33 +0000 (21:42 +0000)]
[modules] Properly merge visibility of class definitions that got merged while
parsing then merged again when the module was loaded.

llvm-svn: 240700

9 years agofix typos; NFC
Sanjay Patel [Thu, 25 Jun 2015 21:11:08 +0000 (21:11 +0000)]
fix typos; NFC

llvm-svn: 240699

9 years ago[LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.
Siva Chandra [Thu, 25 Jun 2015 21:08:30 +0000 (21:08 +0000)]
[LLDBSwigPythonCallTypeScript] Remove redundant call to type summary func.

Reviewers: clayborg, granata.enrico

Reviewed By: clayborg, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 240698

9 years agoCOFF: Fix lexer for the module-definition file.
Rui Ueyama [Thu, 25 Jun 2015 21:06:00 +0000 (21:06 +0000)]
COFF: Fix lexer for the module-definition file.

Previously it would hang if there's a stray punctuation (e.g. ?).

llvm-svn: 240697

9 years agodocs: Fix bad link in SafeStack.rst.
Peter Collingbourne [Thu, 25 Jun 2015 21:02:17 +0000 (21:02 +0000)]
docs: Fix bad link in SafeStack.rst.

llvm-svn: 240696

9 years agollvm-nm: Don't print mapping symbols.
Rafael Espindola [Thu, 25 Jun 2015 21:00:51 +0000 (21:00 +0000)]
llvm-nm: Don't print mapping symbols.

This matches the behavior of gnu nm. Fixes pr23930.

llvm-svn: 240695

9 years agoUse foreach loop over constant operands. NFC.
Pete Cooper [Thu, 25 Jun 2015 20:51:38 +0000 (20:51 +0000)]
Use foreach loop over constant operands.  NFC.

A number of places had explicit loops over Constant::operands().
Just use foreach loops where possible.

llvm-svn: 240694

9 years agoSpeculative fix for the broken bots.
Chris Bieneman [Thu, 25 Jun 2015 20:50:46 +0000 (20:50 +0000)]
Speculative fix for the broken bots.

llvm-svn: 240693

9 years ago[msan] Teach sanitizers about the PPC64 ptrace syscall
Jay Foad [Thu, 25 Jun 2015 20:50:18 +0000 (20:50 +0000)]
[msan] Teach sanitizers about the PPC64 ptrace syscall

Summary:
This fixes test/msan/Linux/syscalls.cc, and should also fix the ppc64
sanitizer buildbots which are currently failing in
"make check-sanitizer".

Reviewers: samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240692

9 years ago[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.
Richard Smith [Thu, 25 Jun 2015 20:48:44 +0000 (20:48 +0000)]
[modules] Fix findDirectiveAtLoc to not call a member function on a null pointer.

This is exercised by existing tests, and fixes a failure with -fsanitize=null.
No observable change otherwise; the code happened to do the right thing in
practice under recent versions of Clang and GCC because
MacroDirective::getDefinition happens to check whether this == null.

llvm-svn: 240691

9 years ago[msan] Fix SetShadow for mappings at the end of the application address space
Jay Foad [Thu, 25 Jun 2015 20:47:59 +0000 (20:47 +0000)]
[msan] Fix SetShadow for mappings at the end of the application address space

Summary:
On PPC64 if you disable ASLR (or run under gdb) you're likely to see
mmap returning a mapping right at the end of the application address
space region. This caused SetShadow to call MEM_TO_SHADOW() on the
last+1 address in the region, which seems wrong to me; how can
MEM_TO_SHADOW() distinguish this from the first address in the following
region?

Fixed by only calling MEM_TO_SHADOW() once, on the start address.

Reviewers: samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240690

9 years agoEnable ISL's small integer optimization
Michael Kruse [Thu, 25 Jun 2015 20:47:35 +0000 (20:47 +0000)]
Enable ISL's small integer optimization

Summary:
With small integer optimization (short: sio) enabled, ISL uses 32 bit
integers for its arithmetic and only falls back to a big integer library
(in the case of Polly: IMath) if an operation's result is too large.
This gives a massive performance boost for most application using ISL.
For instance, experiments with ppcg (polyhedral source-to-source
compiler) show speed-ups of 5.8 (compared to plain IMath), respectively
2.7 (compared to GMP).

In Polly, a smaller fraction of the total compile time is taken by ISL,
but the speed-ups are still very significant. The buildbots measure
compilation speed-up up to 1.8 (oourafft, floyd-warshall, symm). All
Polybench benchmarks compile in at least 9% less time, and about 20%
less on average.

Detailed Polybench compile time results (median of 10):
correlation     -25.51%
covariance      -24.82%
2mm             -26.64%
3mm             -28.69%
atax            -13.70%
bicg            -10.78%
cholesky        -40.67%
doitgen         -11.60%
gemm            -11.54%
gemver          -10.63%
gesummv         -11.54%
mvt              -9.43%
symm            -41.25%
syr2k           -14.71%
syrk            -14.52%
trisolv         -17.65%
trmm             -9.78%
durbin          -19.32%
dynprog          -9.09%
gramschmidt     -15.38%
lu              -21.77%
floyd-warshall  -42.71%
reg_detect      -41.17%
adi             -36.69%
fdtd-2d         -32.61%
fdtd-apml       -21.90%
jacobi-1d-imper  -9.41%
jacobi-2d-imper -27.65%
seidel-2d       -31.00%

Reviewers: grosser

Reviewed By: grosser

Subscribers: Meinersbur, llvm-commits, pollydev

Projects: #polly

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

llvm-svn: 240689

9 years ago[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified...
Alexey Samsonov [Thu, 25 Jun 2015 20:43:35 +0000 (20:43 +0000)]
[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified explicitly.

-fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X
versions, and we don't want to penalize users that use modern OS with
default configuration. Those who want to target older OS versions, can
specify that versions explicitly.

llvm-svn: 240688

9 years agotsan: fix handling of dup2
Dmitry Vyukov [Thu, 25 Jun 2015 20:32:04 +0000 (20:32 +0000)]
tsan: fix handling of dup2

Previously tsan modelled dup2(oldfd, newfd) as write on newfd.
We hit several cases where the write lead to false positives:
1. Some software dups a closed pipe in place of a socket before closing
   the socket (to prevent races actually).
2. Some daemons dup /dev/null in place of stdin/stdout.
On the other hand we have not seen cases when write here catches real bugs.
So model dup2 as read on newfd instead.

llvm-svn: 240687

9 years agoAdd -miphonesimulator-version-min as alias to -ios-simulator-version-min.
Chris Bieneman [Thu, 25 Jun 2015 20:25:43 +0000 (20:25 +0000)]
Add -miphonesimulator-version-min as alias to -ios-simulator-version-min.

Summary:
For better or worse the OS X command line tools refer to the iOS simulator as iphonesimucator. We should provide an alias flag -miphonesimulator-version-min that matches a consistent pattern with the other tools.

This is in the interest of making it easier for people to write platform-agnostic darwin build scripts.

Reviewers: bob.wilson, bogner

Subscribers: cfe-commits

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

llvm-svn: 240686

9 years ago[clang-fuzzer] Update clang-fuzzer to API change in r240225.
Alexey Samsonov [Thu, 25 Jun 2015 20:21:59 +0000 (20:21 +0000)]
[clang-fuzzer] Update clang-fuzzer to API change in r240225.

llvm-svn: 240685

9 years agoWe don't need the targets to read objects.
Rafael Espindola [Thu, 25 Jun 2015 20:20:19 +0000 (20:20 +0000)]
We don't need the targets to read objects.

llvm-svn: 240684

9 years ago[InstCombine] call SimplifyICmpInst with correct context
Jingyue Wu [Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)]
[InstCombine] call SimplifyICmpInst with correct context

Summary:
Fixes PR23809. Without passing the context to SimplifyICmpInst, we would
use the assume to prove that the condition feeding the assume is
trivially true (see isValidAssumeForContext in ValueTracking.cpp),
causing the removal of the assume which may be useful for later
optimizations.

Test Plan: pr23800.ll

Reviewers: hfinkel, majnemer

Reviewed By: hfinkel

Subscribers: henryhu, llvm-commits, wengxt, broune, meheff, eliben

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

llvm-svn: 240683

9 years agoCOFF: Remove dead code.
Rui Ueyama [Thu, 25 Jun 2015 20:12:15 +0000 (20:12 +0000)]
COFF: Remove dead code.

llvm-svn: 240682

9 years agoDiagnose undefined temporary symbols.
Rafael Espindola [Thu, 25 Jun 2015 20:10:45 +0000 (20:10 +0000)]
Diagnose undefined temporary symbols.

We already disallowed

.global .Lfoo

so this is reasonable.

This is a small cherry pick from r240130.

llvm-svn: 240681

9 years agoRename local variable CCCPrintActions -> CCCPrintPhases.
Douglas Katzman [Thu, 25 Jun 2015 19:37:41 +0000 (19:37 +0000)]
Rename local variable CCCPrintActions -> CCCPrintPhases.

To match the '-ccc-print-phases' command-line flag.
Also make two more 'for' loops range-based. NFC

llvm-svn: 240680

9 years agoMake this test verify .debug_pubnames is actually missing.
Paul Robinson [Thu, 25 Jun 2015 19:37:13 +0000 (19:37 +0000)]
Make this test verify .debug_pubnames is actually missing.
It was matching at EOF regardless of whether the section was present.

llvm-svn: 240679

9 years agoRangify for loop in Inliner.cpp. NFC.
Yaron Keren [Thu, 25 Jun 2015 19:28:24 +0000 (19:28 +0000)]
Rangify for loop in Inliner.cpp. NFC.

llvm-svn: 240678

9 years agoFix a bug where we were trying to reconstruct ivars of ObjC types from the runtime...
Enrico Granata [Thu, 25 Jun 2015 19:17:04 +0000 (19:17 +0000)]
Fix a bug where we were trying to reconstruct ivars of ObjC types from the runtime in "expression parser mode"

The expression parser mode allows UnknownAnyTy to make it all the way through, but that is bad for ivars because it means type layout fails horribly (as in, clang crashes)

This patch fixes the issue by using the "variables view mode", which masks UnknownAnyTy as empty-type, and pointer-to UnknownAnyTy as void*

This, in turn, allows LLDB to properly reconstruct ivars of IMP type in ObjC type - as per accompanying test case

Fixes rdar://21471326

llvm-svn: 240677

9 years agoAdd const qualifier to Mangled::GuessLanguage
Dawn Perchik [Thu, 25 Jun 2015 19:14:34 +0000 (19:14 +0000)]
Add const qualifier to Mangled::GuessLanguage

llvm-svn: 240676

9 years agoCOFF: Devirtualize mark(), markLive() and isCOMDAT().
Rui Ueyama [Thu, 25 Jun 2015 19:10:58 +0000 (19:10 +0000)]
COFF: Devirtualize mark(), markLive() and isCOMDAT().

Only SectionChunk can be dead-stripped. Previously,
all types of chunks implemented these functions,
but their functions were blank.

Likewise, only DefinedRegular and DefinedCOMDAT symbols
can be dead-stripped. markLive() function was implemented
for other symbol types, but they were blank.

I started thinking that the change I made in r240319 was
a mistake. I separated DefinedCOMDAT from DefinedRegular
because I thought that would make the code cleaner, but now
we want to handle them as the same type here. Maybe we
should roll it back.

This change should improve readability a bit as this removes
some dubious uses of reinterpret_cast. Previously, we
assumed that all COMDAT chunks are actually SectionChunks,
which was not very obvious.

llvm-svn: 240675

9 years agoUse more range-based for loops
Douglas Katzman [Thu, 25 Jun 2015 18:51:37 +0000 (18:51 +0000)]
Use more range-based for loops

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

llvm-svn: 240674

9 years agoAdd Arg::getValues method with const 'this' and const result
Douglas Katzman [Thu, 25 Jun 2015 18:48:26 +0000 (18:48 +0000)]
Add Arg::getValues method with const 'this' and const result

llvm-svn: 240673

9 years agoDAGCombiner: Remove redundant check
Matt Arsenault [Thu, 25 Jun 2015 18:47:02 +0000 (18:47 +0000)]
DAGCombiner: Remove redundant check

MemIntrinsicSDNode is already a subclass of MemSDNode,
so the MemSDNode check is sufficient.

llvm-svn: 240672

9 years ago[CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan are available.
Alexey Samsonov [Thu, 25 Jun 2015 18:45:30 +0000 (18:45 +0000)]
[CFI] Run tests that use cfi diagnostic mode only if cxxabi parts of UBSan are available.

llvm-svn: 240671

9 years agoGVN: If a branch has two identical successors, we cannot declare either dead.
Peter Collingbourne [Thu, 25 Jun 2015 18:32:02 +0000 (18:32 +0000)]
GVN: If a branch has two identical successors, we cannot declare either dead.

This previously caused miscompilations as a result of phi nodes receiving
undef incoming values from blocks dominated by such successors.

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

llvm-svn: 240670

9 years ago[CUDA] Implemented __nvvm_atom_*_gen_* builtins.
Artem Belevich [Thu, 25 Jun 2015 18:29:42 +0000 (18:29 +0000)]
[CUDA] Implemented __nvvm_atom_*_gen_* builtins.

Integer variants are implemented as atomicrmw or cmpxchg instructions.
Atomic add for floating point (__nvvm_atom_add_gen_f()) is implemented
as a call to an overloaded @llvm.nvvm.atomic.load.add.f32.* LVVM
intrinsic.

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

llvm-svn: 240669

9 years ago[sanitizer] Disable signal_segv_handler test.
Evgeniy Stepanov [Thu, 25 Jun 2015 18:23:58 +0000 (18:23 +0000)]
[sanitizer] Disable signal_segv_handler test.

Random failures on the bots.

llvm-svn: 240668

9 years agoCOFF: Simplify. NFC.
Rui Ueyama [Thu, 25 Jun 2015 17:56:36 +0000 (17:56 +0000)]
COFF: Simplify. NFC.

llvm-svn: 240666

9 years agoCOFF: Use std::equal to compare two lists of relocations.
Rui Ueyama [Thu, 25 Jun 2015 17:51:07 +0000 (17:51 +0000)]
COFF: Use std::equal to compare two lists of relocations.

llvm-svn: 240665

9 years agoOmit 'nodebug' methods from the class description.
Paul Robinson [Thu, 25 Jun 2015 17:50:43 +0000 (17:50 +0000)]
Omit 'nodebug' methods from the class description.

llvm-svn: 240664

9 years agoSubmitting patch from Abhishek for:
Greg Clayton [Thu, 25 Jun 2015 17:50:15 +0000 (17:50 +0000)]
Submitting patch from Abhishek for:

http://reviews.llvm.org/D10309

llvm-svn: 240663

9 years agoRename Mangled::GetLanguage to Mangled::GuessLanguage
Dawn Perchik [Thu, 25 Jun 2015 17:45:53 +0000 (17:45 +0000)]
Rename Mangled::GetLanguage to Mangled::GuessLanguage

The language can not be definitively determined from the mangling, so
this new name helps clarify that fact.  This addresses the concerns raised
in http://reviews.llvm.org/rL226962.
Reviewed by: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D10723

llvm-svn: 240662

9 years agoCOFF: Don't use COFFHeader->NumberOfRelocations.
Rui Ueyama [Thu, 25 Jun 2015 17:43:37 +0000 (17:43 +0000)]
COFF: Don't use COFFHeader->NumberOfRelocations.

The size of the field is 16 bit, so it's inaccurate if the
number of relocations in a section is more than 65535.

llvm-svn: 240661

9 years agoAdd const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.
Oleksiy Vyalov [Thu, 25 Jun 2015 17:41:41 +0000 (17:41 +0000)]
Add const versions of SBFrame::GetFunctionName and SBFrame::IsInlined.

http://reviews.llvm.org/D10711

llvm-svn: 240660

9 years ago[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.
Artem Belevich [Thu, 25 Jun 2015 17:34:23 +0000 (17:34 +0000)]
[NVPTX] Fixed a typo in __nvvm_atom_min_gen_l() type string.

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

llvm-svn: 240659

9 years agoUpdate for llvm change.
Rafael Espindola [Thu, 25 Jun 2015 17:04:12 +0000 (17:04 +0000)]
Update for llvm change.

llvm-svn: 240658

9 years agoFix autotools build
Michael Kruse [Thu, 25 Jun 2015 16:50:13 +0000 (16:50 +0000)]
Fix autotools build

There were two issues:
* ISL's configure generates include/isl/stdint.h, not isl/stdint.h as
  assumed. This is also changed in the CMake build.

* Need to pass --with-int=imath to ISL's configure; the default is gmp.

Polly's configure has been regenerated due to changing configure.ac

llvm-svn: 240657

9 years agoAdd a test for a recent regression.
Rafael Espindola [Thu, 25 Jun 2015 16:16:08 +0000 (16:16 +0000)]
Add a test for a recent regression.

llvm-svn: 240656

9 years agollvm-nm: print 'n' instead of '?'
Rafael Espindola [Thu, 25 Jun 2015 16:01:53 +0000 (16:01 +0000)]
llvm-nm: print 'n' instead of '?'

This matches gnu nm and has the advantage that there is a upper case N.

llvm-svn: 240655

9 years agoFix #pragma redefine_extname when there is a local variable of the same name. The...
Aaron Ballman [Thu, 25 Jun 2015 15:37:16 +0000 (15:37 +0000)]
Fix #pragma redefine_extname when there is a local variable of the same name. The local should not be renamed, only the externally-available declaration should be.

Patch by Andrey Bokhanko!

llvm-svn: 240653

9 years agoUpdate TestPrintStackTraces XFAIL once more
Pavel Labath [Thu, 25 Jun 2015 15:25:30 +0000 (15:25 +0000)]
Update TestPrintStackTraces XFAIL once more

it seems the failure happens also with clang. The main thing which triggers the failure is
architecture.

llvm-svn: 240652

9 years agoFix TestThreadAPI on Linux
Tamas Berghammer [Thu, 25 Jun 2015 15:19:22 +0000 (15:19 +0000)]
Fix TestThreadAPI on Linux

On Linux malloc calls itself in some case. Change the test case to
handle this scenario.

llvm-svn: 240651

9 years ago[PPC] Implement vmrgew and vmrgow instructions
Kit Barton [Thu, 25 Jun 2015 15:17:40 +0000 (15:17 +0000)]
[PPC] Implement vmrgew and vmrgow instructions

This patch adds support for the vector merge even word and vector merge odd word
instructions introduced in POWER8.

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

llvm-svn: 240650

9 years ago[AsmPrinter] Fix crash in handleIndirectSymViaGOTPCRel
Bruno Cardoso Lopes [Thu, 25 Jun 2015 15:17:23 +0000 (15:17 +0000)]
[AsmPrinter] Fix crash in handleIndirectSymViaGOTPCRel

Check for symbols in MCValue before using them. Bail out early in case
they are null. This fixes PR23779.

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

rdar://problem/21532830

llvm-svn: 240649

9 years agoFix unw_getcontext() return value on AArch64.
Logan Chien [Thu, 25 Jun 2015 15:12:46 +0000 (15:12 +0000)]
Fix unw_getcontext() return value on AArch64.

unw_getcontext() should return UNW_ESUCCESS on success.  Therefore, the
assembly for AArch64 is incorrect because "ldr x0, #0" is a PC-relative
load instead of an immediate value load.

llvm-svn: 240648

9 years agoDoxygen-ify a few comments. NFC
Jonathan Roelofs [Thu, 25 Jun 2015 15:06:47 +0000 (15:06 +0000)]
Doxygen-ify a few comments. NFC

llvm-svn: 240647

9 years agoUse computeSymbolSizes in llvm-symbolize.
Rafael Espindola [Thu, 25 Jun 2015 15:06:38 +0000 (15:06 +0000)]
Use computeSymbolSizes in llvm-symbolize.

llvm-svn: 240646

9 years agoUse range loop. NFC.
Rafael Espindola [Thu, 25 Jun 2015 15:00:38 +0000 (15:00 +0000)]
Use range loop. NFC.

llvm-svn: 240645

9 years agoModernize getELFDynamicSymbolIterators.
Rafael Espindola [Thu, 25 Jun 2015 14:39:35 +0000 (14:39 +0000)]
Modernize getELFDynamicSymbolIterators.

* Have it return a iterator_range.
* Remove the global function.
* Rename to getDynamicSymbolIterators.

llvm-svn: 240644