platform/upstream/llvm.git
6 years ago[sanitizer] Allocator local cache improvements
Kostya Kortchinsky [Mon, 5 Feb 2018 18:06:45 +0000 (18:06 +0000)]
[sanitizer] Allocator local cache improvements

Summary:
Here are a few improvements proposed for the local cache:
- `InitCache` always read from `per_class_[1]` in the fast path. This was not
  ideal as we are working with `per_class_[class_id]`. The latter offers the
  same property we are looking for (eg: `max_count != 0` means initialized),
  so we might as well use it and keep our memory accesses local to the same
  `per_class_` element. So change `InitCache` to take the current `PerClass`
  as an argument. This also makes the fast-path assembly of `Deallocate` a lot
  more compact;
- Change the 32-bit `Refill` & `Drain` functions to mimic their 64-bit
  counterparts, by passing the current `PerClass` as an argument. This saves
  some array computations;
- As far as I can tell, `InitCache` has no place in `Drain`: it's either called
  from `Deallocate` which calls `InitCache`, or from the "upper" `Drain` which
  checks for `c->count` to be greater than 0 (strictly). So remove it there.
- Move the `stats_` updates to after we are done with the `per_class_` accesses
  in an attempt to preserve locality once more;
- Change some `CHECK` to `DCHECK`: I don't think the ones changed belonged in
  the fast path and seemed to be overly cautious failsafes;
- Mark some variables as `const`.

The overall result is cleaner more compact fast path generated code, and some
performance gains with Scudo (and likely other Sanitizers).

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 324257

6 years agoAdd a comment explaining how the input for GetModuleSpecifications_EarlySectionHeader...
Pavel Labath [Mon, 5 Feb 2018 18:03:02 +0000 (18:03 +0000)]
Add a comment explaining how the input for GetModuleSpecifications_EarlySectionHeaders was generated

Davide pointed out this would be useful if the file ever needs to be
regenerated (and I certainly agree).

I also replace the test binary with a slightly smaller one -- I intended
to do this in the original commit, but I forgot to add it to the patch
as I was juggling several things at the same time.

llvm-svn: 324256

6 years ago[InstCombine] add unsigned saturation subtraction canonicalizations
Sanjay Patel [Mon, 5 Feb 2018 17:53:29 +0000 (17:53 +0000)]
[InstCombine] add unsigned saturation subtraction canonicalizations

This is the instcombine part of unsigned saturation canonicalization.
Backend patches already commited:
https://reviews.llvm.org/D37510
https://reviews.llvm.org/D37534

It converts unsigned saturated subtraction patterns to forms recognized
by the backend:
(a > b) ? a - b : 0 -> ((a > b) ? a : b) - b)
(b < a) ? a - b : 0 -> ((a > b) ? a : b) - b)
(b > a) ? 0 : a - b -> ((a > b) ? a : b) - b)
(a < b) ? 0 : a - b -> ((a > b) ? a : b) - b)
((a > b) ? b - a : 0) -> - ((a > b) ? a : b) - b)
((b < a) ? b - a : 0) -> - ((a > b) ? a : b) - b)
((b > a) ? 0 : b - a) -> - ((a > b) ? a : b) - b)
((a < b) ? 0 : b - a) -> - ((a > b) ? a : b) - b)

Patch by Yulia Koval!

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

llvm-svn: 324255

6 years agoFix parsing of object files with "early" section headers
Pavel Labath [Mon, 5 Feb 2018 17:25:40 +0000 (17:25 +0000)]
Fix parsing of object files with "early" section headers

ObjectFileELF::GetModuleSpecifications contained a lot of tip-toing code
which was trying to avoid loading the full object file into memory. It
did this by trying to load data only up to the offset if was accessing.
However, in practice this was useless, as 99% of object files we
encounter have section headers at the end, so we would load the whole
file as soon as we start parsing the section headers.

In fact, this would break as soon as we encounter a file which does
*not* have section headers at the end (yaml2obj produces these), as the
access to .strtab (which we need to get the section names) was not
guarded by this offset check.

As this strategy was completely ineffective anyway, I do not attempt to
proliferate it further by guarding the .strtab accesses. Instead I just
lead the full file as soon as we are reasonably sure that we are indeed
processing an elf file.

If we really care about the load size here, we would need to reimplement
this to just load the bits of the object file we need, instead of
loading everything from the start of the object file to the given
offset. However, given that the OS will do this for us for free when
using mmap, I think think this is really necessary.

For testing this I check a (tiny) SO file instead of yaml2obj-ing it
because the fact that they come out first is an implementation detail of
yaml2obj that can change in the future.

llvm-svn: 324254

6 years agoLTO: Include dso-local bit in ThinLTO cache key.
Peter Collingbourne [Mon, 5 Feb 2018 17:17:51 +0000 (17:17 +0000)]
LTO: Include dso-local bit in ThinLTO cache key.

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

llvm-svn: 324253

6 years ago[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user...
Sanjay Patel [Mon, 5 Feb 2018 17:16:50 +0000 (17:16 +0000)]
[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user is a binop

There was a logic hole in D42739 / rL324014 because we're not accounting for select and phi
instructions that might have repeated operands. This is likely a source of an infinite loop.
I haven't manufactured a test case to prove that, but it should be safe to speculatively limit
this transform to binops while we try to create that test.

llvm-svn: 324252

6 years agoSync PlatformNetBSD.cpp with Linux
Kamil Rytarowski [Mon, 5 Feb 2018 17:12:23 +0000 (17:12 +0000)]
Sync PlatformNetBSD.cpp with Linux

Summary:
Various changes in logging from log->Printf() to generic LLDB_LOG().

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: llvm-commits, lldb-commits

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

llvm-svn: 324251

6 years ago[Hexagon] Memoize instruction positions in BitTracker
Krzysztof Parzyszek [Mon, 5 Feb 2018 17:12:07 +0000 (17:12 +0000)]
[Hexagon] Memoize instruction positions in BitTracker

llvm-svn: 324250

6 years ago[X86] Teach X86DAGToDAGISel::shrinkAndImmediate to preserve upper 32 zeroes of a...
Craig Topper [Mon, 5 Feb 2018 16:54:07 +0000 (16:54 +0000)]
[X86] Teach X86DAGToDAGISel::shrinkAndImmediate to preserve upper 32 zeroes of a 64 bit mask.

If the upper 32 bits of a 64 bit mask are all zeros, we have special isel patterns to use a 32-bit and instead of a 64-bit and by relying on the impliciting zeroing of 32 bit ops.

This patch teachs shrinkAndImmediate not to break that optimization.

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

llvm-svn: 324249

6 years agoRevert r323472 "[Debug] Add dbg.value intrinsics for PHIs created during LCSSA."
Hans Wennborg [Mon, 5 Feb 2018 16:10:42 +0000 (16:10 +0000)]
Revert r323472 "[Debug] Add dbg.value intrinsics for PHIs created during LCSSA."

This broke the Chromium build; see PR36238.

> This patch is an enhancement to propagate dbg.value information when
> Phis are created on behalf of LCSSA.  I noticed a case where a value
> carried across a loop was reported as <optimized out>.
>
> Specifically this case:
>
>   int bar(int x, int y) {
>     return x + y;
>   }
>
>   int foo(int size) {
>     int val = 0;
>     for (int i = 0; i < size; ++i) {
>       val = bar(val, i);  // Both val and i are correct
>     }
>     return val; // <optimized out>
>   }
>
> In the above case, after all of the interesting computation completes
> our value is reported as "optimized out." This change will add a
> dbg.value to correct this.
>
> This patch also moves the dbg.value insertion routine from
> LoopRotation.cpp into Local.cpp, so that we can share it in both places
> (LoopRotation and LCSSA).
>
> Patch by Matt Davis!
>
> Differential Revision: https://reviews.llvm.org/D42551

llvm-svn: 324247

6 years ago[clang-format] Re-land: Fixup #include guard indents after parseFile()
Mark Zeren [Mon, 5 Feb 2018 15:59:00 +0000 (15:59 +0000)]
[clang-format] Re-land: Fixup #include guard indents after parseFile()

Summary:
When a preprocessor indent closes after the last line of normal code we do not
correctly fixup include guard indents. For example:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #  define A 0
  #endif
  #endif

incorrectly reformats to:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #    define A 0
  #  endif
  #endif

To resolve this issue we must fixup levels after parseFile(). Delaying
the fixup introduces a new state, so consolidate include guard search
state into an enum.

Reviewers: krasimir, klimek

Subscribers: cfe-commits

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

llvm-svn: 324246

6 years agoBitTracker.h needs a full definition of MachineInstr, so include the defining file.
Benjamin Kramer [Mon, 5 Feb 2018 15:56:24 +0000 (15:56 +0000)]
BitTracker.h needs a full definition of MachineInstr, so include the defining file.

Patch by Dean Sturtevant!

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

llvm-svn: 324245

6 years ago[Hexagon] Forgot about HexagonISD::VZERO in selecting const vectors
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:52:54 +0000 (15:52 +0000)]
[Hexagon] Forgot about HexagonISD::VZERO in selecting const vectors

llvm-svn: 324244

6 years ago[Hexagon] Don't use garbage mask in HvxSelector::shuffp2
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:46:41 +0000 (15:46 +0000)]
[Hexagon] Don't use garbage mask in HvxSelector::shuffp2

The function shuffp2 was breaking up a wide shuffle into a pair of
narrower ones, except that the narrower shuffle masks were actually
uninitialized.

llvm-svn: 324243

6 years ago[ThinLTO] Convert dead alias to declarations
Teresa Johnson [Mon, 5 Feb 2018 15:44:27 +0000 (15:44 +0000)]
[ThinLTO] Convert dead alias to declarations

Summary:
This complements the fixes in r323633 and r324075 which drop the
definitions of dead functions and variables, respectively.

Fixes PR36208.

Reviewers: grimar, rafael

Subscribers: mehdi_amini, llvm-commits, inglorion

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

llvm-svn: 324242

6 years ago[Hexagon] Use V6_vmpyih for halfword multiplication
Krzysztof Parzyszek [Mon, 5 Feb 2018 15:40:06 +0000 (15:40 +0000)]
[Hexagon] Use V6_vmpyih for halfword multiplication

Unlike V6_vmpyhv, it produces the result in the exact form that is
expected without the need for a shuffle.

llvm-svn: 324241

6 years agoHandle NetBSD symbol mangling devname -> __devname50
Kamil Rytarowski [Mon, 5 Feb 2018 14:50:01 +0000 (14:50 +0000)]
Handle NetBSD symbol mangling devname -> __devname50

llvm-svn: 324240

6 years agoRevert "[clang-format] Fixup #include guard indents after parseFile()"
Mark Zeren [Mon, 5 Feb 2018 14:47:04 +0000 (14:47 +0000)]
Revert "[clang-format] Fixup #include guard indents after parseFile()"

This reverts r324238 | mzeren-vmw | 2018-02-05 06:35:54 -0800 (Mon, 05 Feb 2018) | 35 lines

Incorrect version pushed upstream.

llvm-svn: 324239

6 years ago[clang-format] Fixup #include guard indents after parseFile()
Mark Zeren [Mon, 5 Feb 2018 14:35:54 +0000 (14:35 +0000)]
[clang-format] Fixup #include guard indents after parseFile()

Summary:
When a preprocessor indent closes after the last line of normal code we do not
correctly fixup include guard indents. For example:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #  define A 0
  #endif
  #endif

incorrectly reformats to:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #    define A 0
  #  endif
  #endif

To resolve this issue we must fixup levels after parseFile(). Delaying
the fixup introduces a new state, so consolidate include guard search
state into an enum.

Reviewers: krasimir, klimek

Reviewed By: krasimir

Subscribers: cfe-commits

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

llvm-svn: 324238

6 years ago[AMDGPU][MC] Corrected dst/data size for MIMG opcodes with d16 modifier
Dmitry Preobrazhensky [Mon, 5 Feb 2018 14:18:53 +0000 (14:18 +0000)]
[AMDGPU][MC] Corrected dst/data size for MIMG opcodes with d16 modifier

See bug 36154: https://bugs.llvm.org/show_bug.cgi?id=36154

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

Reviewers: cfang, artem.tamazov, arsenm
llvm-svn: 324237

6 years agoSkip TestTargetSymbolsSepDebugSymlink on remote targets
Pavel Labath [Mon, 5 Feb 2018 14:07:44 +0000 (14:07 +0000)]
Skip TestTargetSymbolsSepDebugSymlink on remote targets

Currently, our behavior when installing symlinks on the remote target is
broken (pr36237).

llvm-svn: 324236

6 years ago[clang-tidy] Fix incorrect code indention in the doc.
Haojian Wu [Mon, 5 Feb 2018 13:23:48 +0000 (13:23 +0000)]
[clang-tidy] Fix incorrect code indention in the doc.

llvm-svn: 324235

6 years agoFix a crash in *NetBSD::Factory::Launch
Kamil Rytarowski [Mon, 5 Feb 2018 13:16:22 +0000 (13:16 +0000)]
Fix a crash in *NetBSD::Factory::Launch

Summary:
We cannot call process_up->SetState() inside
the NativeProcessNetBSD::Factory::Launch
function because it triggers a NULL pointer
deference.

The generic code for launching a process in:
GDBRemoteCommunicationServerLLGS::LaunchProcess
sets the m_debugged_process_up pointer after
a successful call to  m_process_factory.Launch().
If we attempt to call process_up->SetState()
inside a platform specific Launch function we
end up dereferencing a NULL pointer in
NativeProcessProtocol::GetCurrentThreadID().

Use the proper call process_up->SetState(,false)
that sets notify_delegates to false.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg

Reviewed By: labath

Subscribers: lldb-commits

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

llvm-svn: 324234

6 years ago[clang-tidy] tweak "misc-definitions-in-headers" doc, NFC.
Haojian Wu [Mon, 5 Feb 2018 13:04:41 +0000 (13:04 +0000)]
[clang-tidy] tweak "misc-definitions-in-headers" doc, NFC.

llvm-svn: 324233

6 years ago[llvm-opt-fuzzer] Fix build after rL324225
Igor Laevsky [Mon, 5 Feb 2018 12:47:40 +0000 (12:47 +0000)]
[llvm-opt-fuzzer] Fix build after rL324225

llvm-svn: 324232

6 years ago[AMDGPU][MC] Added validation of d16 and r128 modifiers of MIMG opcodes
Dmitry Preobrazhensky [Mon, 5 Feb 2018 12:45:43 +0000 (12:45 +0000)]
[AMDGPU][MC] Added validation of d16 and r128 modifiers of MIMG opcodes

See bugs 36094, 36095:
  https://bugs.llvm.org/show_bug.cgi?id=36094
  https://bugs.llvm.org/show_bug.cgi?id=36095

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

Reviewers: vpykhtin, artem.tamazov, arsenm
llvm-svn: 324231

6 years agoTestLinuxCore -- add a check for thread name
Pavel Labath [Mon, 5 Feb 2018 12:34:09 +0000 (12:34 +0000)]
TestLinuxCore -- add a check for thread name

We've had a bug (fixed by https://reviews.llvm.org/D42828) where the
thread name was being read incorrectly. Add a test for this behavior.

llvm-svn: 324230

6 years ago[PowerPC] Check hot loop exit edge in PPCCTRLoops
Hiroshi Inoue [Mon, 5 Feb 2018 12:25:29 +0000 (12:25 +0000)]
[PowerPC] Check hot loop exit edge in PPCCTRLoops

PPCCTRLoops transform loops using mtctr/bdnz instructions if loop trip count is known and big enough to compensate for the cost of mtctr.
But if there is a loop exit edge which is known to be frequently taken (by builtin_expect or by PGO), we should not transform the loop to avoid the cost of mtctr instruction. Here is an example of a loop with hot exit edge:

for (unsigned i = 0; i < TripCount; i++) {
  // do something
  if (__builtin_expect(check(), 1))
    break;
  // do something
}

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

llvm-svn: 324229

6 years ago[CodeGenSchedule][NFC] Always emit ProcResourceUnits.
Clement Courbet [Mon, 5 Feb 2018 12:23:51 +0000 (12:23 +0000)]
[CodeGenSchedule][NFC] Always emit ProcResourceUnits.

Summary:
Right now only the ProcResourceUnits that are directly referenced by
instructions are emitted. This change emits all of them, so that
analysis passes can use the information.
This has no functional impact. It typically adds a few entries (e.g. 4
for X86/haswell) to the generated ProcRes table.

Reviewers: gchatelet

Subscribers: llvm-commits

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

llvm-svn: 324228

6 years ago[test] Un-XFAIL TestRaise.RaiseTestCase.test_restart_bug
Jonas Devlieghere [Mon, 5 Feb 2018 11:39:04 +0000 (11:39 +0000)]
[test] Un-XFAIL TestRaise.RaiseTestCase.test_restart_bug

This test was marked as an expected failure because of PR20231 but it
seems to consistently result in an unexpected success across the bots.
Let's try to re-enable this test again.

llvm-svn: 324227

6 years ago[dotest] make debug info variant accessible in setUp()
Pavel Labath [Mon, 5 Feb 2018 11:30:46 +0000 (11:30 +0000)]
[dotest] make debug info variant accessible in setUp()

Summary:
This changes the way we store the debug info variant to make it
available earlier in the test bringup: instead of it being set by the
test wrapper method, it is set as a *property* of the wrapper method.

This way, we can inspect it as soon as self.testMethodName is
initialized. The retrieval is implemented by a new function
TestBase.getDebugInfo(), and all that's necessary to make it work is to
change self.debug_info into self.getDebugInfo().

While searching for debug_info occurences i noticed that TestLogging is
being replicated for no good reason, so I removed the replication there.

Reviewers: aprantl, jingham

Subscribers: eraman, JDevlieghere, lldb-commits

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

llvm-svn: 324226

6 years ago[llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus
Igor Laevsky [Mon, 5 Feb 2018 11:05:47 +0000 (11:05 +0000)]
[llvm-opt-fuzzer] Avoid adding incorrect inputs to the fuzzer corpus

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

llvm-svn: 324225

6 years agoResolve binary symlinks before finding its separate .debug file
Jan Kratochvil [Mon, 5 Feb 2018 10:50:38 +0000 (10:50 +0000)]
Resolve binary symlinks before finding its separate .debug file

I have found LLDB cannot find separate debug info of Fedora /usr/bin/gdb.
It is because:

lrwxrwxrwx 1 root root       14 Jan 25 20:41 /usr/bin/gdb -> ../libexec/gdb*
-rwxr-xr-x 1 root root 10180296 Jan 25 20:41 /usr/libexec/gdb*
ls: cannot access '/usr/lib/debug/usr/bin/gdb-8.0.1-35.fc27.x86_64.debug': No such file or directory
-r--r--r-- 1 root root 29200464 Jan 25 20:41 /usr/lib/debug/usr/libexec/gdb-8.0.1-35.fc27.x86_64.debug

FYI that -8.0.1-35.fc27.x86_64.debug may look confusing, it was always just
.debug before.
Why is /usr/bin/gdb a symlink is offtopic for this bugreport, Fedora has it so
for some reasons.

It is always safest to look at the .debug file only after resolving all
symlinks on the binary file.

Differential revision: https://reviews.llvm.org/D42853

llvm-svn: 324224

6 years agoFix more print format specifiers in debug_rnglists dumping
James Henderson [Mon, 5 Feb 2018 10:47:13 +0000 (10:47 +0000)]
Fix more print format specifiers in debug_rnglists dumping

See also r324096.

I have made the assumption that DWARF64 is not an issue for the time
being with these fixes.

llvm-svn: 324223

6 years agoFix upper->lower case for /usr/lib/debug/.build-id/**.debug
Jan Kratochvil [Mon, 5 Feb 2018 10:46:56 +0000 (10:46 +0000)]
Fix upper->lower case for /usr/lib/debug/.build-id/**.debug

I have found the lookup by build-id
(when lookup by /usr/lib/debug/path/name/exec.debug failed) does not work as
LLDB tries the build-id hex string in uppercase but Fedora uses lowercase.

xubuntu-16.10 also uses lowercase during my test:
/usr/lib/debug/.build-id/6c/61f3566329f43d03f812ae7057e9e7391b5ff6.debug

Differential revision: https://reviews.llvm.org/D42852

llvm-svn: 324222

6 years ago[ELF] Implement --[no-]apply-dynamic-relocs option.
Peter Smith [Mon, 5 Feb 2018 10:15:08 +0000 (10:15 +0000)]
[ELF] Implement --[no-]apply-dynamic-relocs option.

When resolving dynamic RELA relocations the addend is taken from the
relocation and not the place being relocated. Accordingly lld does not
write the addend field to the place like it would for a REL relocation.
Unfortunately there is some system software, in particlar dynamic loaders
such as Bionic's linker64 that use the value of the place prior to
relocation to find the offset that they have been loaded at. Both gold
and bfd control this behavior with the --[no-]apply-dynamic-relocs option.
This change implements the option and defaults it to true for compatibility
with gold and bfd.

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

llvm-svn: 324221

6 years ago[clangd] Expclictly set the init value of -assume-header-dir option, NFC.
Haojian Wu [Mon, 5 Feb 2018 10:14:16 +0000 (10:14 +0000)]
[clangd] Expclictly set the init value of -assume-header-dir option, NFC.

llvm-svn: 324220

6 years ago[ELF] - Report valid binary filename when reporting error.
George Rimar [Mon, 5 Feb 2018 09:47:24 +0000 (09:47 +0000)]
[ELF] - Report valid binary filename when reporting error.

We did not report valid filename for duplicate symbol error when
symbol came from binary input file.
Patch fixes it.

Differential revision: https://reviews.llvm.org/D42635

llvm-svn: 324217

6 years agoRevert [SimplifyCFG] Relax restriction for folding unconditional branches
Serguei Katkov [Mon, 5 Feb 2018 09:05:43 +0000 (09:05 +0000)]
Revert [SimplifyCFG] Relax restriction for folding unconditional branches

The patch causes the failure of the test
compiler-rt/test/profile/Linux/counter_promo_nest.c

To unblock buildbot, revert the patch while investigation is in progress.

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

llvm-svn: 324214

6 years ago[X86] Add isel patterns for selecting masked SUBV_BROADCAST with bitcasts. Remove...
Craig Topper [Mon, 5 Feb 2018 08:37:37 +0000 (08:37 +0000)]
[X86] Add isel patterns for selecting masked SUBV_BROADCAST with bitcasts. Remove combineBitcastForMaskedOp.

Add test cases for the merge masked versions to make sure we have all those covered.

llvm-svn: 324210

6 years ago[NFC] Add tests for PR35743
Max Kazantsev [Mon, 5 Feb 2018 08:09:49 +0000 (08:09 +0000)]
[NFC] Add tests for PR35743

llvm-svn: 324209

6 years ago[SimplifyCFG] Relax restriction for folding unconditional branches
Serguei Katkov [Mon, 5 Feb 2018 07:56:43 +0000 (07:56 +0000)]
[SimplifyCFG] Relax restriction for folding unconditional branches

The commit rL308422 introduces a restriction for folding unconditional
branches. Specifically if empty block with unconditional branch leads to
header of the loop then elimination of this basic block is prohibited.
However it seems this condition is redundantly strict.
If elimination of this basic block does not introduce more back edges
then we can eliminate this block.

The patch implements this relax of restriction.

Reviewers: efriedma, mcrosier, pacxx, hsung, davidxl
Reviewed By: pacxx
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42691

llvm-svn: 324208

6 years ago[X86] Remove unused lambda. NFC
Craig Topper [Mon, 5 Feb 2018 06:56:33 +0000 (06:56 +0000)]
[X86] Remove unused lambda. NFC

llvm-svn: 324206

6 years ago[X86] Remove X86ISD::SHUF128 from combineBitcastForMaskedOp. Use isel patterns instead.
Craig Topper [Mon, 5 Feb 2018 06:00:23 +0000 (06:00 +0000)]
[X86] Remove X86ISD::SHUF128 from combineBitcastForMaskedOp. Use isel patterns instead.

We always created X86ISD::SHUF128 with a 64-bit element type so we can use isel patterns to detect a bitconvert to 32-bit to handle masking.

The test changes are because we also match the bitconvert even if there is no masking. This leads to unnecessary isel pattern, but it requires more multiclass hackery in tablegen to get rid of it.

llvm-svn: 324205

6 years agoRe-apply [SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 5 Feb 2018 05:49:47 +0000 (05:49 +0000)]
Re-apply [SCEV] Fix isLoopEntryGuardedByCond usage

ScalarEvolution::isKnownPredicate invokes isLoopEntryGuardedByCond without check
that SCEV is available at entry point of the loop. It is incorrect and fixed by patch.

To bugs additionally fixed:
assert is moved after the check whether loop is not a nullptr.
Usage of isLoopEntryGuardedByCond in ScalarEvolution::isImpliedCondOperandsViaNoOverflow
is guarded by isAvailableAtLoopEntry.

Reviewers: sanjoy, mkazantsev, anna, dorit, reames
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42417

llvm-svn: 324204

6 years ago[demangler] return early if conditional expr parsing failed
Erik Pilkington [Mon, 5 Feb 2018 02:34:41 +0000 (02:34 +0000)]
[demangler] return early if conditional expr parsing failed

This should fix some bugs found by oss-fuzz.

llvm-svn: 324203

6 years ago[X86] Auto-generate full checks. NFC
Craig Topper [Sun, 4 Feb 2018 23:48:51 +0000 (23:48 +0000)]
[X86] Auto-generate full checks. NFC

llvm-svn: 324202

6 years agoRecommit rL323890: [AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions
Daniil Fukalov [Sun, 4 Feb 2018 22:32:07 +0000 (22:32 +0000)]
Recommit rL323890: [AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions

Fixed asserts in tests.

llvm-svn: 324201

6 years agoX86 Tests: Add shuffle that can be improved by widening elements. NFC
Zvi Rackover [Sun, 4 Feb 2018 19:31:14 +0000 (19:31 +0000)]
X86 Tests: Add shuffle that can be improved by widening elements. NFC

To be improved by D42044

llvm-svn: 324200

6 years ago[PartialInliner] Update test (NFC).
Florian Hahn [Sun, 4 Feb 2018 18:40:24 +0000 (18:40 +0000)]
[PartialInliner] Update test (NFC).

llvm-svn: 324199

6 years ago[InlineFunction] Set arg attrs even if there only are VarArg attrs.
Florian Hahn [Sun, 4 Feb 2018 18:27:47 +0000 (18:27 +0000)]
[InlineFunction] Set arg attrs even if there only are VarArg attrs.

When using the partial inliner, we might have attributes for forwarded
varargs, but the CodeExtractor does not create an empty argument
attribute set for regular arguments in that case, because it does not know
of the additional arguments. So in case we have attributes for VarArgs, we
also have to make sure we create (empty) attributes for all regular arguments.

This fixes PR36210.

llvm-svn: 324197

6 years ago[TableGen][AsmMatcherEmitter] Fix tied-constraint checking for InstAliases
Sander de Smalen [Sun, 4 Feb 2018 16:24:17 +0000 (16:24 +0000)]
[TableGen][AsmMatcherEmitter] Fix tied-constraint checking for InstAliases

Summary:
This is a bit of a reimplementation the work done in
https://reviews.llvm.org/D41446, since that patch only really works for
tied operands of instructions, not aliases.

Instead of checking the constraints based on the matched instruction's opcode,
this patch uses the match-info's convert function to check the operand
constraints for that specific instruction/alias.
This is based on the matched operands for the instruction, not the
resulting opcode of the MCInst.

This patch adds the following enum/table to the *GenAsmMatcher.inc file:
  enum {
    Tie0_1_1,
    Tie0_1_2,
    Tie0_1_5,
    ...
  };

  const char TiedAsmOperandTable[][3] = {
    /* Tie0_1_1 */ { 0, 1, 1 },
    /* Tie0_1_2 */ { 0, 1, 2 },
    /* Tie0_1_5 */ { 0, 1, 5 },
    ...
  };

And it is referenced directly in the ConversionTable, like this:
static const uint8_t ConversionTable[CVT_NUM_SIGNATURES][13] = {
  ...
  { CVT_95_addRegOperands, 1,
    CVT_95_addRegOperands, 2,
    CVT_Tied, Tie0_1_5,
    CVT_95_addRegOperands, 6, CVT_Done },
  ...

The Tie0_1_5 (and corresponding table) encodes that:
* Result operand 0 is the operand to copy (which is e.g. done when
  building up the operands to the MCInst in convertToMCInst())
* Asm operands 1 and 5 should be the same operands (which is checked
  in checkAsmTiedOperandConstraints()).

Reviewers: olista01, rengolin, fhahn, craig.topper, echristo, apazos, dsanders

Reviewed By: olista01

Subscribers: llvm-commits

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

llvm-svn: 324196

6 years ago[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking
Chad Rosier [Sun, 4 Feb 2018 15:42:24 +0000 (15:42 +0000)]
[LV] Use Demanded Bits and ValueTracking for reduction type-shrinking

The type-shrinking logic in reduction detection, although narrow in scope, is
also rather ad-hoc, which has led to bugs (e.g., PR35734). This patch modifies
the approach to rely on the demanded bits and value tracking analyses, if
available. We currently perform type-shrinking separately for reductions and
other instructions in the loop. Long-term, we should probably think about
computing minimal bit widths in a more complete way for the loops we want to
vectorize.

PR35734
Differential Revision: https://reviews.llvm.org/D42309

llvm-svn: 324195

6 years agoFix initialization of array<const T, 0> with GCC.
Eric Fiselier [Sun, 4 Feb 2018 08:02:35 +0000 (08:02 +0000)]
Fix initialization of array<const T, 0> with GCC.

Previously, when handling zero-sized array of const objects we
used a const version of aligned_storage_t, which is not an array type.
However, GCC complains about initialization of the form: array<const T, 0> arr = {};

This patch fixes that bug by making the dummy object used to represent
the zero-sized array an array itself. This avoids GCC's complaints
about the uninitialized const member.

llvm-svn: 324194

6 years agoMark LWG 3014 as complete. No code changes needed
Eric Fiselier [Sun, 4 Feb 2018 07:37:09 +0000 (07:37 +0000)]
Mark LWG 3014 as complete. No code changes needed

llvm-svn: 324193

6 years agoImplement LWG 3014 - Fix more noexcept issues in filesystem.
Eric Fiselier [Sun, 4 Feb 2018 07:35:36 +0000 (07:35 +0000)]
Implement LWG 3014 - Fix more noexcept issues in filesystem.

This patch removes the noexcept declaration from filesystem
operations which require creating temporary paths or
creating a directory iterator. Either of these operations
can throw.

llvm-svn: 324192

6 years agoMark LWG 3013 as already complete. See r316941
Eric Fiselier [Sun, 4 Feb 2018 07:29:53 +0000 (07:29 +0000)]
Mark LWG 3013 as already complete. See r316941

llvm-svn: 324191

6 years agoRemove debug println from rec.dir.itr.increment test
Eric Fiselier [Sun, 4 Feb 2018 03:26:55 +0000 (03:26 +0000)]
Remove debug println from rec.dir.itr.increment test

llvm-svn: 324190

6 years agoImplement LWG2989: path's streaming operators allow everything under the sun.
Eric Fiselier [Sun, 4 Feb 2018 03:10:53 +0000 (03:10 +0000)]
Implement LWG2989: path's streaming operators allow everything under the sun.

Because path can be constructed from a ton of different types, including string
and wide strings, this caused it's streaming operators to suck up all sorts
of silly types via silly conversions. For example:

using namespace std::experimental::filesystem::v1;
std::wstring w(L"wide");
std::cout << w; // converts to path.

This patch tentatively adopts the resolution to LWG2989 and fixes the issue
by making the streaming operators friends of path.

llvm-svn: 324189

6 years agoMark issue 2851 as complete
Eric Fiselier [Sun, 4 Feb 2018 02:45:33 +0000 (02:45 +0000)]
Mark issue 2851 as complete

llvm-svn: 324188

6 years agoAddress LWG 2849 and fix missing failure condition in copy_file.
Eric Fiselier [Sun, 4 Feb 2018 02:43:32 +0000 (02:43 +0000)]
Address LWG 2849 and fix missing failure condition in copy_file.

Previously copy_file didn't handle the case where the input and
output were the same file.

llvm-svn: 324187

6 years agocorrect comment about C++03 assignment operators
Eric Fiselier [Sun, 4 Feb 2018 02:22:33 +0000 (02:22 +0000)]
correct comment about C++03 assignment operators

llvm-svn: 324186

6 years agoMake array<const T, 0> non-CopyAssignable and make swap and fill ill-formed.
Eric Fiselier [Sun, 4 Feb 2018 02:17:02 +0000 (02:17 +0000)]
Make array<const T, 0> non-CopyAssignable and make swap and fill ill-formed.

The standard isn't exactly clear how std::array should handle zero-sized arrays
with const element types. In particular W.R.T. copy assignment, swap, and fill.

This patch takes the position that those operations should be ill-formed,
and makes changes to libc++ to make it so.

This follows up on commit r324182.

llvm-svn: 324185

6 years ago[X86] Add DAG combine to turn (bitcast (and/or/xor (bitcast X), Y)) -> (and/or/xor...
Craig Topper [Sun, 4 Feb 2018 01:43:48 +0000 (01:43 +0000)]
[X86] Add DAG combine to turn (bitcast (and/or/xor (bitcast X), Y)) -> (and/or/xor X, (bitcast Y)) when casting between GPRs and mask operations.

This reduces the number of transitions between k-registers and GPRs, reducing the number of instructions.

There's still some room for improvement to remove more transitions, but this is a good start.

llvm-svn: 324184

6 years ago[X86] Remove unused function argument. NFC
Craig Topper [Sun, 4 Feb 2018 01:43:44 +0000 (01:43 +0000)]
[X86] Remove unused function argument. NFC

llvm-svn: 324183

6 years ago[libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default construc...
Eric Fiselier [Sun, 4 Feb 2018 01:03:08 +0000 (01:03 +0000)]
[libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default constructible types.

Summary:
This patch fixes llvm.org/PR35491 and LWG2157  (https://cplusplus.github.io/LWG/issue2157)

The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: lichray, cfe-commits

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

llvm-svn: 324182

6 years ago[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst...
Craig Topper [Sat, 3 Feb 2018 23:00:31 +0000 (23:00 +0000)]
[DAGCombiner] When folding fold (sext/zext (and/or/xor (sextload/zextload x), cst)) -> (and/or/xor (sextload/zextload x), (sext/zext cst)) make sure we check the legality of the full extended load.

Summary:
If the load is already an extended load we should be using the memory VT for the legality check, not just the VT of the current extension.

I don't have a test case, just noticed it while investigating some load extension improvements.

Reviewers: RKSimon, spatel, niravd

Reviewed By: niravd

Subscribers: llvm-commits

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

llvm-svn: 324181

6 years ago[MIPS] Regenerate vector tests with update script
Simon Pilgrim [Sat, 3 Feb 2018 22:11:22 +0000 (22:11 +0000)]
[MIPS] Regenerate vector tests with update script

Hopefully help make this a lot more maintainable

llvm-svn: 324180

6 years ago[SelectionDAG] Don't use simple VT in generic shuffle code
Simon Pilgrim [Sat, 3 Feb 2018 21:34:42 +0000 (21:34 +0000)]
[SelectionDAG] Don't use simple VT in generic shuffle code

Better to assume that any value type may be commuted, not just MVTs.

No test case right now, but discovered while investigating possible shuffle combines.

llvm-svn: 324179

6 years ago[X86][SSE] Don't chain shuffles together in schedule tests
Simon Pilgrim [Sat, 3 Feb 2018 21:20:19 +0000 (21:20 +0000)]
[X86][SSE] Don't chain shuffles together in schedule tests

This is necessary to prevent the shuffles from being combined/simplified in an upcoming patch.

llvm-svn: 324178

6 years ago[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.
Craig Topper [Sat, 3 Feb 2018 20:18:25 +0000 (20:18 +0000)]
[X86] Remove and autoupgrade kand/kandn/kor/kxor/kxnor/knot intrinsics.

Clang already stopped using these a couple months ago.

The test cases aren't great as there is nothing forcing the operations to stay in k-registers so some of them moved back to scalar ops due to the bitcasts being moved around.

llvm-svn: 324177

6 years agoRemove unneeded -debug argument from new test
David Green [Sat, 3 Feb 2018 17:33:50 +0000 (17:33 +0000)]
Remove unneeded -debug argument from new test

llvm-svn: 324176

6 years ago[ORC] Rename NullResolver to NullLegacyResolver.
Lang Hames [Sat, 3 Feb 2018 16:52:48 +0000 (16:52 +0000)]
[ORC] Rename NullResolver to NullLegacyResolver.

This resolver conforms to the LegacyJITSymbolResolver interface, and will be
replaced with a null-returning resolver conforming to the newer
orc::SymbolResolver interface in the near future. This patch renames the class
to avoid a clash.

llvm-svn: 324175

6 years ago[InstCombine] Allow common type conversions to i8/i16/i32
David Green [Sat, 3 Feb 2018 16:51:03 +0000 (16:51 +0000)]
[InstCombine] Allow common type conversions to i8/i16/i32

This, in instcombine, allows conversions to i8/i16/i32 (very
common cases) even if the resulting type is not legal according
to the data layout. This can often open up extra combine
opportunities.

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

llvm-svn: 324174

6 years agoRecommit rL323952: [DebugInfo] Enable debug information for C99 VLA types.
Sander de Smalen [Sat, 3 Feb 2018 13:55:59 +0000 (13:55 +0000)]
Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types.

Fixed build issue when building with g++-4.8 (specialization after instantiation).

llvm-svn: 324173

6 years ago[RISCV] Update two RISCV codegen tests after rL323991
Alex Bradbury [Sat, 3 Feb 2018 13:02:30 +0000 (13:02 +0000)]
[RISCV] Update two RISCV codegen tests after rL323991

From the discussion in D41835 it looks possible the change will be backed out,
but for now let's fix the RISCV tests.

llvm-svn: 324172

6 years agoFix MSVC signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Sat, 3 Feb 2018 12:38:56 +0000 (12:38 +0000)]
Fix MSVC signed/unsigned comparison warning. NFCI.

llvm-svn: 324171

6 years ago[RISCV] Create a LinuxTargetInfo when targeting Linux
Alex Bradbury [Sat, 3 Feb 2018 11:56:11 +0000 (11:56 +0000)]
[RISCV] Create a LinuxTargetInfo when targeting Linux

Previously, RISCV32TargetInfo or RISCV64TargetInfo were created
unconditionally. Use LinuxTargetInfo<RISCV??TargetInfo> to ensure that the
proper OS-specific defines are present.

This patch only adds logic to instantiate LinuxTargetInfo and leaves a TODO,
as I'm reluctant to add logic for other targets (e.g. FreeBSD, RTEMS) until
I've produced and tested at least one binary for that OS+target combo.

Thanks to @mgrang to reporting the issue.

llvm-svn: 324170

6 years ago[ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.
Michael Kruse [Sat, 3 Feb 2018 06:59:47 +0000 (06:59 +0000)]
[ScopBuilder] Make -polly-stmt-granularity=scalar-indep the default.

Splitting basic blocks into multiple statements if there are now
additional scalar dependencies gives more freedom to the scheduler, but
more statements also means higher compile-time complexity. Switch to
finer statement granularity, the additional compile time should be
limited by the number of operations quota.

The regression tests are written for the -polly-stmt-granularity=bb
setting, therefore we add that flag to those tests that break with the
new default. Some of the tests only fail because the statements are
named differently due to a basic block resulting in multiple statements,
but which are removed during simplification of statements without
side-effects. Previous commits tried to reduce this effect, but it is
not completely avoidable.

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

llvm-svn: 324169

6 years ago[ScopInfo] Allow epilogues to be the main statement of a BB.
Michael Kruse [Sat, 3 Feb 2018 05:43:00 +0000 (05:43 +0000)]
[ScopInfo] Allow epilogues to be the main statement of a BB.

Do not add a "_last" suffix to the statement name if there is no (other)
main statement for a basic block. In other words, it becomes the main
statement itself. This further reduces the statement naming difference
between -polly-stmt-granularity=bb and
-polly-stmt-granularity=scalar-indep.

llvm-svn: 324168

6 years agoRevert r324166 "[analyzer] Add a checker for mmap()...".
Artem Dergachev [Sat, 3 Feb 2018 03:57:32 +0000 (03:57 +0000)]
Revert r324166 "[analyzer] Add a checker for mmap()...".

Due to Buildbot failures - most likely that's because target triples were not
specified in the tests, even though the checker behaves differently with
different target triples.

llvm-svn: 324167

6 years ago[analyzer] Add a checker for mmap()s which are both writable and executable.
Artem Dergachev [Sat, 3 Feb 2018 02:33:42 +0000 (02:33 +0000)]
[analyzer] Add a checker for mmap()s which are both writable and executable.

This is a security check which is disabled by default but will be enabled
whenever the user consciously enables the security package. If mmap()ed memory
is both writable and executable, it makes it easier for the attacker to execute
arbitrary code when contents of this memory are compromised. Some applications
require such mmap()s though, such as different sorts of JIT.

Patch by David Carlier!

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

llvm-svn: 324166

6 years agoWork around GCC constexpr initialization bug
Eric Fiselier [Sat, 3 Feb 2018 01:48:21 +0000 (01:48 +0000)]
Work around GCC constexpr initialization bug

llvm-svn: 324165

6 years agoWork around Clang bug introduced in r324062
Eric Fiselier [Sat, 3 Feb 2018 01:45:35 +0000 (01:45 +0000)]
Work around Clang bug introduced in r324062

When Clang encounters an already invalid class declaration, it can
emit incorrect diagnostics about the exception specification on
some of its members. This patch temporarily works around that
incorrect diagnostic.

The clang bug was introduced in r324062.

llvm-svn: 324164

6 years ago[hwasan] Add a paragraph on stack instrumentation.
Evgeniy Stepanov [Sat, 3 Feb 2018 01:06:21 +0000 (01:06 +0000)]
[hwasan] Add a paragraph on stack instrumentation.

Reviewers: kcc

Subscribers: cfe-commits

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

llvm-svn: 324163

6 years ago[analyzer] Do not infer nullability inside function-like macros, even when macro...
George Karpenkov [Sat, 3 Feb 2018 00:55:21 +0000 (00:55 +0000)]
[analyzer] Do not infer nullability inside function-like macros, even when macro is explicitly returning NULL

We already suppress such reports for inlined functions, we should then
get the same behavior for macros.
The underlying reason is that the same macro, can be called from many
different contexts, and nullability can only be expected in _some_ of
them.
Assuming that the macro can return null in _all_ of them sometimes leads
to a large number of false positives.

E.g. consider the test case for the dynamic cast implementation in
macro: in such cases, the bug report is unwanted.

Tracked in rdar://36304776

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

llvm-svn: 324161

6 years agoFix crash when trying to pack-expand a GNU statement expression.
Richard Smith [Sat, 3 Feb 2018 00:44:57 +0000 (00:44 +0000)]
Fix crash when trying to pack-expand a GNU statement expression.

We could in principle support such pack expansion, using techniques similar to
what we do for pack expansion of lambdas, but it's not clear it's worthwhile.
For now at least, cleanly reject these cases rather than crashing.

llvm-svn: 324160

6 years agoTurn off the deprecated ALWAYS_SEARCH_USER_PATHS feature
Jason Molenda [Sat, 3 Feb 2018 00:37:46 +0000 (00:37 +0000)]
Turn off the deprecated ALWAYS_SEARCH_USER_PATHS feature
in debugserver.  This is already set this way in the lldb
project files but not in debugserver.  Updating for
consistency.

llvm-svn: 324158

6 years ago[WebAssembly] Refactor linker-generated symbols. NFC.
Sam Clegg [Fri, 2 Feb 2018 22:59:56 +0000 (22:59 +0000)]
[WebAssembly] Refactor linker-generated symbols. NFC.

Group all synthetic symbols in the in single struct to match
the ELF linker.

This change is part of a larger change to add more linker
symbols such as `_end` and `_edata`.

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

llvm-svn: 324157

6 years agoFix a copy of a fixed length, possibly non-nul terminated, string
Jason Molenda [Fri, 2 Feb 2018 22:48:45 +0000 (22:48 +0000)]
Fix a copy of a fixed length, possibly non-nul terminated, string
into a std::string so we don't run off the end of the array when
there is no nul byte in ProcessElfCore::parseLinuxNotes.
Found with ASAN testing.

<rdar://problem/37134319>

Differential revision: https://reviews.llvm.org/D42828

llvm-svn: 324156

6 years agoSimplify.
Rui Ueyama [Fri, 2 Feb 2018 22:48:09 +0000 (22:48 +0000)]
Simplify.

llvm-svn: 324155

6 years agoUpdate Eq so that it uses NAME just like B does. NFC.
Rui Ueyama [Fri, 2 Feb 2018 22:45:47 +0000 (22:45 +0000)]
Update Eq so that it uses NAME just like B does. NFC.

llvm-svn: 324154

6 years agoFix has_unique_object_representation after Clang commit r324134.
Eric Fiselier [Fri, 2 Feb 2018 22:39:59 +0000 (22:39 +0000)]
Fix has_unique_object_representation after Clang commit r324134.

Clang previously reported an empty union as having a unique object
representation. This was incorrect and was fixed in a recent Clang commit.

This patch fixes the libc++ tests.

llvm-svn: 324153

6 years agoFix incorrect usage of std::is_assignable.
Richard Smith [Fri, 2 Feb 2018 22:29:54 +0000 (22:29 +0000)]
Fix incorrect usage of std::is_assignable.

We want to check that we can assign to an lvalue here, not a prvalue.

llvm-svn: 324152

6 years agoAdd missing direct-init / parameter-declaration-clause disambiguation when
Richard Smith [Fri, 2 Feb 2018 22:24:54 +0000 (22:24 +0000)]
Add missing direct-init / parameter-declaration-clause disambiguation when
parsing a trailing-return-type of a (function pointer) variable declaration.

llvm-svn: 324151

6 years agoAdd -{no,}-check-sections flags to enable/disable section overlchecking
Rui Ueyama [Fri, 2 Feb 2018 22:24:06 +0000 (22:24 +0000)]
Add -{no,}-check-sections flags to enable/disable section overlchecking

GNU linkers have this option.

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

llvm-svn: 324150

6 years ago[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)
Daniel Neilson [Fri, 2 Feb 2018 22:03:03 +0000 (22:03 +0000)]
[InstCombine] Use getDestAlignment in SimplifyMemSet (NFC)

Summary:
Small NFC change to change the name of the function used getting and setting
the alignment of a memset.

llvm-svn: 324148

6 years ago[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEqu...
Craig Topper [Fri, 2 Feb 2018 21:59:46 +0000 (21:59 +0000)]
[X86] Prefer to create a ISD::SETCC over X86ISD::PCMPEQ in combineVectorSizedSetCCEquality.

This is running pre-legalize, we should try to use target independent nodes. This will give the best opportunity for target independent optimizations.

llvm-svn: 324147

6 years agoStrip .note.gnu.build-id sections if --build-id is given.
Rui Ueyama [Fri, 2 Feb 2018 21:56:24 +0000 (21:56 +0000)]
Strip .note.gnu.build-id sections if --build-id is given.

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

llvm-svn: 324146

6 years agoAdd --no-gnu-unique and --no-undefined-version for completeness.
Rui Ueyama [Fri, 2 Feb 2018 21:44:06 +0000 (21:44 +0000)]
Add --no-gnu-unique and --no-undefined-version for completeness.

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

llvm-svn: 324145