Commit Graph

268387 Commits

Author SHA1 Message Date
Max Kazantsev 85da7543f9 [IRCE][NFC] Add assert that AddRecExpr's step is not zero
We should never return zero steps, ensure this fact by adding
a sanity check when we are analyzing the induction variable.

llvm-svn: 309661
2017-08-01 06:27:51 +00:00
Petr Hosek 35fdbd56b7 Revert "[llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy"
The change seems to be failing on bots which are using gcc and bfd.ld
as a host compiler and linker.

This reverts commit r309658.

llvm-svn: 309660
2017-08-01 05:31:50 +00:00
Daniel Jasper 43cd2ef49c Revert r309415: "[LVI] Constant-propagate a zero extension of the switch condition value through case edges"
This causes assertion failures in (a somewhat old version of) SpiderMonkey.
I have already forwarded reproduction instructions to the patch author.

llvm-svn: 309659
2017-08-01 05:30:49 +00:00
Petr Hosek 8882ac2ac9 [llvm][llvm-objcopy] Added support for outputting to binary in llvm-objcopy
This change adds the "-O binary" flag which directs llvm-objcopy to
output the object file to the same format as GNU objcopy does when given
the flag "-O binary". This was done by splitting the Object class into
two subclasses ObjectELF and ObjectBianry which each output a different
format but relay on the same code to read in the Object in Object.

Patch by Jake Ehrlich

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

llvm-svn: 309658
2017-08-01 05:18:30 +00:00
Davide Italiano 72c4285bd6 [MetaRenamer] Leave `@main` alone.
To the best of my knowledge -metarenamer is used in two cases:
1) obfuscate names, when e.g. they contain informations that
can't be shared.
2) Improve clarity of the textual IR for testcases.

One of the usecases if getting the output of `opt` and passing it
to the lli interpreter to run the test. If metarenamer renames
@main, lli can't find an entry point.

llvm-svn: 309657
2017-08-01 05:14:45 +00:00
Kostya Serebryany d6cfed6060 [sanitizer-coverage] dummy definitions for __sanitizer_cov_8bit_counters_init and __sanitizer_cov_pcs_init
llvm-svn: 309655
2017-08-01 04:24:05 +00:00
Rui Ueyama be5f98fa33 Remove a redundant temporary variable.
llvm-svn: 309654
2017-08-01 04:18:57 +00:00
Craig Topper 936395b428 [MathExtras] Remove unnecessary cast of a constant 1 in a subtract.
Pretty sure this will automatically promoted to match the type of the other operand of the subtract. There's plenty of other similar code around here without this cast.

llvm-svn: 309653
2017-08-01 04:18:34 +00:00
Rui Ueyama f974994e15 Binary search to find a relocation.
This change makes -gdb-index 40% faster. My test case is self-linking lld.

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

llvm-svn: 309652
2017-08-01 04:11:03 +00:00
Hiroshi Inoue b9417dbd48 [StackColoring] Update AliasAnalysis information in stack coloring pass
Stack coloring pass need to maintain AliasAnalysis information when merging stack slots of different types.
Actually, there is a FIXME comment in StackColoring.cpp

// FIXME: In order to enable the use of TBAA when using AA in CodeGen,
// we'll also need to update the TBAA nodes in MMOs with values
// derived from the merged allocas.

But, TBAA has been already enabled in CodeGen without fixing this pass.
The incorrect TBAA metadata results in recent failures in bootstrap test on ppc64le (PR33928) by allowing unsafe instruction scheduling.
Although we observed the problem on ppc64le, this is a platform neutral issue.

This patch makes the stack coloring pass maintains AliasAnalysis information when merging multiple stack slots.

llvm-svn: 309651
2017-08-01 03:32:15 +00:00
Erik Pilkington 906d585686 [demangler] Fix another bug found by oss-fuzz in r309340
llvm-svn: 309650
2017-08-01 02:38:41 +00:00
Erik Pilkington deec87836a [demangler] Use _LIBCPP_UNREACHABLE()
llvm-svn: 309649
2017-08-01 02:38:40 +00:00
Eugene Zemtsov 9c410c1b21 Fix incorrect use of std::unique
llvm-svn: 309648
2017-08-01 01:29:55 +00:00
Kostya Serebryany 6cdb5a61b5 [libFuzzer] implement more correct way of computing feature index for Inline8bitCounters
llvm-svn: 309647
2017-08-01 01:16:26 +00:00
Kostya Serebryany 4f2970037a [libFuzzer] enable -fsanitize-coverage=pc-table for all tests
llvm-svn: 309646
2017-08-01 00:48:44 +00:00
Alina Sbirlea 30d8a881e8 Default MemoryLocation passed to getModRefInfo should be None (D35441)
llvm-svn: 309645
2017-08-01 00:47:17 +00:00
Kostya Serebryany a1f12ba17e [sanitizer-coverage] relax an assertion
llvm-svn: 309644
2017-08-01 00:44:05 +00:00
Petr Hosek 05a04cbedd Reland "[LLVM][llvm-objcopy] Added basic plumbing to get things started"
As discussed on llvm-dev I've implemented the first basic steps towards
llvm-objcopy/llvm-objtool (name pending).

This change adds the ability to copy (without modification) 64-bit
little endian ELF executables that have SHT_PROGBITS, SHT_NOBITS,
SHT_NULL and SHT_STRTAB sections.

Patch by Jake Ehrlich

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

llvm-svn: 309643
2017-08-01 00:33:58 +00:00
Eli Friedman 37f41d1e7c [ScheduleDAG] Don't schedule node with physical register interference
https://reviews.llvm.org/D31536 didn't really solve the problem it was
trying to solve; it got rid of the assertion failure, but we were still
scheduling the DAG incorrectly (mixing together instructions from
different calls), leading to a MachineVerifier failure.

In order to schedule the DAG correctly, we have to make sure we don't
schedule a node which should be blocked by an interference. Fix
ScheduleDAGRRList::PickNodeToScheduleBottomUp so it doesn't pick a node
like that.

The added call to FindAvailableNode() is the key change here; this makes
sure we don't try to schedule a call while we're in the middle of
scheduling a different call. I'm not sure this is the right approach; in
particular, I'm not sure how to prove we don't end up with an infinite
loop of repeatedly backtracking.

This also reverts the code change from D31536. It doesn't do anything
useful: we should never schedule an ADJCALLSTACKDOWN unless we've
already scheduled the corresponding ADJCALLSTACKUP.

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

llvm-svn: 309642
2017-08-01 00:28:40 +00:00
Alina Sbirlea 967e7966fc Allow None as a MemoryLocation to getModRefInfo
Summary:
Adding part of the changes in D30369 (needed to make progress):
Current patch updates AliasAnalysis and MemoryLocation, but does _not_ clean up MemorySSA.

Original summary from D30369, by dberlin:
Currently, we have instructions which affect memory but have no memory
location. If you call, for example, MemoryLocation::get on a fence,
it asserts. This means things specifically have to avoid that. It
also means we end up with a copy of each API, one taking a memory
location, one not.

This starts to fix that.

We add MemoryLocation::getOrNone as a new call, and reimplement the
old asserting version in terms of it.

We make MemoryLocation optional in the (Instruction, MemoryLocation)
version of getModRefInfo, and kill the old one argument version in
favor of passing None (it had one caller). Now both can handle fences
because you can just use MemoryLocation::getOrNone on an instruction
and it will return a correct answer.

We use all this to clean up part of MemorySSA that had to handle this difference.

Note that literally every actual getModRefInfo interface we have could be made private and replaced with:

getModRefInfo(Instruction, Optional<MemoryLocation>)
and
getModRefInfo(Instruction, Optional<MemoryLocation>, Instruction, Optional<MemoryLocation>)

and delegating to the right ones, if we wanted to.

I have not attempted to do this yet.

Reviewers: dberlin, davide, dblaikie

Subscribers: sanjoy, hfinkel, chandlerc, llvm-commits

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

llvm-svn: 309641
2017-08-01 00:28:29 +00:00
Akira Hatanaka 011ed19c0f Use -target instead of -arch in test case.
llvm-svn: 309640
2017-07-31 23:08:52 +00:00
Evgeniy Stepanov 6ff4412375 [sancov] Fix coverage-reset test on Android/i686.
DSO coverage may be dumped in any order.

llvm-svn: 309639
2017-07-31 23:08:27 +00:00
Petr Hosek a14a2cc5ce [sanitizer] Fix the sanitizer build on Android
Android uses libgcc name even for shared library unlike other platforms
which use libgcc_s. Furthemore, Android libstdc++ has a dependency on
libdl. These need to be handled while performing CMake checks.

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

llvm-svn: 309638
2017-07-31 22:46:43 +00:00
Kostya Kortchinsky 9d52cedb24 [msan] Reverting D36093
Summary:
Reverting D36093 until I can figure out how to launch the correct tests :/
My apologies.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 309637
2017-07-31 22:46:01 +00:00
Akira Hatanaka 086597aee3 Silence warning -Wmissing-sysroot.
llvm-svn: 309636
2017-07-31 22:46:00 +00:00
Peter Collingbourne 396943a75b Re-apply r309622 with a fix for MSVC.
Patch by Vlad Tsyrklevich!

llvm-svn: 309635
2017-07-31 22:35:33 +00:00
Sterling Augustine 81fd449238 Add powerpc64 to compiler-rt build infrastructure.
Summary: Add powerpc64 to compiler-rt build infrastructure.

Reviewers: timshen

Reviewed By: timshen

Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits

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

llvm-svn: 309634
2017-07-31 22:23:17 +00:00
Akira Hatanaka 4a94d8d5f7 [Driver] Make sure the deployment target is earlier than iOS 11 when
it is inferred from -isysroot.

This fixes a change that was inadvertently introduced in r309607.

rdar://problem/32230613

llvm-svn: 309633
2017-07-31 22:19:34 +00:00
Craig Topper 410d252f5b [AVX-512] Add unmasked subvector inserts and extract to the execution domain tables.
llvm-svn: 309632
2017-07-31 22:07:29 +00:00
Sean Callanan 558e52c108 [build-script] Bring in modernizations from downstream:
- Don't do any checks of the current SCM repository if the
  llvm repositories are already there.  Useful for bots.
- When symlinking, remove old symlinks.
- Support loading build-script as a library, not necessarily
  under Xcode.
- Stringify args before passing them to subprocess.

llvm-svn: 309631
2017-07-31 21:50:00 +00:00
David Blaikie 038e28a5a7 DebugInfo: Put range base specifier entry functionality behind a flag
Chromium's gold build seems to have trouble with this (gold produces
errors) - not sure if it's gold that's not coping with the valid
representation, or a bug in the implementation in LLVM, etc.

llvm-svn: 309630
2017-07-31 21:48:42 +00:00
Craig Topper 7dd26785e7 [AVX512] Add a common prefix to avx512-insert-extract.ll so we can reduce the number of check lines on some test cases.
This was pointed out during the review for D313804.

llvm-svn: 309629
2017-07-31 21:20:06 +00:00
Reid Kleckner 2de471dca9 [codeview] Ignore DBG_VALUEs when choosing a BB start source loc
When the first instruction of a basic block has no location (consider a
LEA materializing the address of an alloca for a call), we want to start
the line table for the block with the first valid source location in the
block.  We need to ignore DBG_VALUE instructions during this scan to get
decent line tables.

llvm-svn: 309628
2017-07-31 21:03:08 +00:00
Sanjay Patel dac0ab272c [InstCombine] allow mask hoisting transform for vector types
llvm-svn: 309627
2017-07-31 21:01:53 +00:00
Walter Lee 973131071a Move RTEMS to OSTargets.h
Differential Revision: https://reviews.llvm.org/D36106

llvm-svn: 309626
2017-07-31 21:00:16 +00:00
Craig Topper 043c44efff [AVX-512] Use AVX512 as test check prefix instead of AVX3. NFC
llvm-svn: 309625
2017-07-31 20:58:06 +00:00
Peter Collingbourne ab65b0dba1 Revert r309622, "Fix logic for generating llvm.type.test()s"
Caused a bot test failure:
http://bb.pgr.jp/builders/test-clang-msc-x64-on-i686-linux-RA/builds/5325

llvm-svn: 309624
2017-07-31 20:53:16 +00:00
Adrian Prantl 56619fa7e9 Debug Info: Also check the DWARF output in assembler-only test cases
This will prevent me from introducing a regression in my next commit.

llvm-svn: 309623
2017-07-31 20:48:52 +00:00
Peter Collingbourne 8867b216dc Fix logic for generating llvm.type.test()s
CodeGenFunction::EmitTypeMetadataCodeForVCall() could output an
llvm.assume(llvm.type.test())when CFI was enabled, optimizing out the
vcall check. This case was only reached when: 1) CFI-vcall was enabled,
2) -fwhole-program-tables was specified, and 3)
-fno-sanitize-trap=cfi-vcall was specified.

Patch by Vlad Tsyrklevich!

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

llvm-svn: 309622
2017-07-31 20:45:14 +00:00
Peter Collingbourne bcd204b478 Update phi nodes in LowerTypeTests control flow simplification
D33925 added a control flow simplification for -O2 --lto-O0 builds that
manually splits blocks and reassigns conditional branches but does not
correctly update phi nodes. If the else case being branched to had
incoming phi nodes the control-flow simplification would leave phi nodes
in that BB with an unhandled predecessor.

Patch by Vlad Tsyrklevich!

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

llvm-svn: 309621
2017-07-31 20:43:07 +00:00
Martin Storsjo f3ed393d69 [Attr] Make TargetWindows and TargetMicrosoftCXXABI match on aarch64 as well
Differential Revision: https://reviews.llvm.org/D36100

llvm-svn: 309620
2017-07-31 20:40:59 +00:00
Martin Storsjo 588a3e5e6c [AArch64] Don't define __LP64__ when targeting Windows
Windows/ARM64 is a LLP64 environment, so don't set this default
define.

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

llvm-svn: 309619
2017-07-31 20:40:53 +00:00
Martin Storsjo 42927caae1 [test] Fix mistagged CHECK-NOT-lines for AARCH64-DARWIN in Preprocessor/init.c
Differential Revision: https://reviews.llvm.org/D36099

llvm-svn: 309618
2017-07-31 20:40:48 +00:00
Peter Collingbourne 36df72b50a Remove STL/microsoft-specific CFI blacklist entries
Patch by Vlad Tsyrklevich!

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

llvm-svn: 309617
2017-07-31 20:39:32 +00:00
Craig Topper 228b622b38 [X86] Remove -O3 from tbm-builtins.c test file.
A change to InstCombine broke this test, but we generally frown on running optimizations clang tests anyway. So I've updated the checks to not depend on optimizations anymore.

llvm-svn: 309616
2017-07-31 20:21:53 +00:00
Kostya Serebryany b2a1eba2f5 [libFuzzer] implement __sanitizer_cov_pcs_init and add pc-table to build flags for one test (for now)
llvm-svn: 309615
2017-07-31 20:20:59 +00:00
Konstantin Belochapka b77d0a5cf1 [X86][MMX] Added custom lowering action for MMX SELECT (PR30418)
Fix for pr30418 - error in backend: Cannot select: t17: x86mmx = select_cc t2, Constant:i64<0>, t7, t8, seteq:ch
Differential Revision: https://reviews.llvm.org/D34661

llvm-svn: 309614
2017-07-31 20:11:49 +00:00
Sanjay Patel 904801597e [InstCombine] add tests for mask hoisting; NFC
The scalar transforms exist with no test coverage. The vector equivalents are missing.

llvm-svn: 309612
2017-07-31 20:02:04 +00:00
Kostya Serebryany bfc83fa8d7 [sanitizer-coverage] don't instrument available_externally functions
llvm-svn: 309611
2017-07-31 20:00:22 +00:00
Kostya Serebryany bb6f079a45 [sanitizer-coverage] ensure minimal alignment for coverage counters and guards
llvm-svn: 309610
2017-07-31 19:49:45 +00:00