OSDN Git Service

android-x86/external-llvm.git
6 years agoLTO: Replace split dwarf implementation that uses objcopy with one that uses direct...
Peter Collingbourne [Mon, 21 May 2018 20:26:49 +0000 (20:26 +0000)]
LTO: Replace split dwarf implementation that uses objcopy with one that uses direct emission.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332884 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for cast-of-select; NFC
Sanjay Patel [Mon, 21 May 2018 20:23:58 +0000 (20:23 +0000)]
[InstCombine] add tests for cast-of-select; NFC

In all cases, we're pulling the cast above the select.
That's not a good canonicalization if we're creating
a select that then mismatches the operand size of its
condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332883 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to...
Peter Collingbourne [Mon, 21 May 2018 20:16:41 +0000 (20:16 +0000)]
CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332881 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRemove CMake workaround for LLD PR24476 which is no longer needed
Reid Kleckner [Mon, 21 May 2018 20:14:46 +0000 (20:14 +0000)]
Remove CMake workaround for LLD PR24476 which is no longer needed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332880 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Fix typo "DWARG" in test comment (NFC)
Brian Gesiak [Mon, 21 May 2018 19:48:27 +0000 (19:48 +0000)]
[DebugInfo] Fix typo "DWARG" in test comment (NFC)

Summary:
The correct spelling is "DWARF", the debugging format, not "DWARG".
The typo is in a (not executed by lit) comment in a test file, so
fixing it does not result in any functional change.

Test Plan: check-llvm, just in case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332878 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Introduce an ELF dwo object writer and teach llvm-mc about it.
Peter Collingbourne [Mon, 21 May 2018 19:44:54 +0000 (19:44 +0000)]
MC: Introduce an ELF dwo object writer and teach llvm-mc about it.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332875 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Update GCCBuiltin names for DS FP atomic intrinsics
Matt Arsenault [Mon, 21 May 2018 19:43:02 +0000 (19:43 +0000)]
AMDGPU: Update GCCBuiltin names for DS FP atomic intrinsics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332874 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DebugInfo] Use absolute addresses in location lists
Jonas Devlieghere [Mon, 21 May 2018 19:36:54 +0000 (19:36 +0000)]
[DebugInfo] Use absolute addresses in location lists

Rather than relying on the user to do the address calculating in
DW_AT_location we should just dump the absolute address.

rdar://problem/38513870

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332873 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases for D47012.
Craig Topper [Mon, 21 May 2018 19:33:42 +0000 (19:33 +0000)]
[X86] Add test cases for D47012.

Patch by Thomasz Krupa.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332872 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Extract a derived class from ELFObjectWriter. NFCI.
Peter Collingbourne [Mon, 21 May 2018 19:30:59 +0000 (19:30 +0000)]
MC: Extract a derived class from ELFObjectWriter. NFCI.

This class will be used to create regular, non-split ELF files.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332870 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases for missed vector rotate matching due to SimplifyDemandedBits...
Craig Topper [Mon, 21 May 2018 19:27:50 +0000 (19:27 +0000)]
[X86] Add test cases for missed vector rotate matching due to SimplifyDemandedBits interfering with the AND masks

As requested in D47116

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332869 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Separate creating a generic object writer from creating a target object writer...
Peter Collingbourne [Mon, 21 May 2018 19:20:29 +0000 (19:20 +0000)]
MC: Separate creating a generic object writer from creating a target object writer. NFCI.

With this we gain a little flexibility in how the generic object
writer is created.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332868 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Extract ELFObjectWriter's ELF writing functionality into an ELFWriter class....
Peter Collingbourne [Mon, 21 May 2018 19:18:28 +0000 (19:18 +0000)]
MC: Extract ELFObjectWriter's ELF writing functionality into an ELFWriter class. NFCI.

The idea is that we will be able to use this class to create multiple
files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332867 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix ubsan bounds check failure.
Peter Collingbourne [Mon, 21 May 2018 19:09:47 +0000 (19:09 +0000)]
Fix ubsan bounds check failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332866 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[EarlyCSE] Improve EarlyCSE of some absolute value cases.
Craig Topper [Mon, 21 May 2018 18:42:42 +0000 (18:42 +0000)]
[EarlyCSE] Improve EarlyCSE of some absolute value cases.

Change matchSelectPattern to return X and -X for ABS/NABS in a well defined order. Adjust EarlyCSE to account for this. Ensure the SPF result is some kind of min/max and not abs/nabs in one place in InstCombine that made me nervous.

Prevously we returned the two operands of the compare part of the abs pattern. The RHS is always going to be a 0i, 1 or -1 constant. This isn't a very meaningful thing to return for any one. There's also some freedom in the abs pattern as to what happens when the value is equal to 0. This freedom led to early cse failing to match when different constants were used in otherwise equivalent operations. By returning the input and its negation in a defined order we can ensure an exact match. This also makes sure both patterns use the exact same subtract instruction for the negation. I believe CSE should evebntually make this happen and properly merge the nsw/nuw flags. But I'm not familiar with CSE and what order it does things in so it seemed like it might be good to really enforce that they were the same.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332865 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Remove stream and output functions from MCObjectWriter. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:28:57 +0000 (18:28 +0000)]
MC: Remove stream and output functions from MCObjectWriter. NFCI.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332864 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Have the object writers return the number of bytes written. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:23:50 +0000 (18:23 +0000)]
MC: Have the object writers return the number of bytes written. NFCI.

This removes the last external use of the stream.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332863 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Add divergence analysis as a dependency for ISel
Stanislav Mekhanoshin [Mon, 21 May 2018 18:18:52 +0000 (18:18 +0000)]
[AMDGPU] Add divergence analysis as a dependency for ISel

AMDGPUDAGToDAGISel adds DivergenceAnalysis in getAnalysisUsage
but does not list it in pass dependencies which may lead to
crash.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332862 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change object writers to use endian::Writer. NFCI.
Peter Collingbourne [Mon, 21 May 2018 18:17:42 +0000 (18:17 +0000)]
MC: Change object writers to use endian::Writer. NFCI.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332861 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[VPlan] Reland r332654 and silence unused func warning
Diego Caballero [Mon, 21 May 2018 18:14:23 +0000 (18:14 +0000)]
[VPlan] Reland r332654 and silence unused func warning

r332654 was reverted due to an unused function warning in
release build. This commit includes the same code with the
warning silenced.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332860 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change MCAssembler::writeSectionData and writeFragmentPadding to take a raw_ostre...
Peter Collingbourne [Mon, 21 May 2018 18:11:35 +0000 (18:11 +0000)]
MC: Change MCAssembler::writeSectionData and writeFragmentPadding to take a raw_ostream. NFCI.

Also clean up a couple of hacks where we were writing the section
contents to another stream by setting the object writer's stream,
writing and setting it back.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332858 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectW...
Peter Collingbourne [Mon, 21 May 2018 17:57:19 +0000 (17:57 +0000)]
MC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectWriter. NFCI.

To make this work I needed to add an endianness field to MCAsmBackend
so that writeNopData() implementations know which endianness to use.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332857 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Address post-commit review comments for r332379
Tom Stellard [Mon, 21 May 2018 17:49:31 +0000 (17:49 +0000)]
AMDGPU/GlobalISel: Address post-commit review comments for r332379

MCRegisterInfo::getPhysRegSize() will be deprecated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332856 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Fix PR37526: MinMax patterns produce an infinite loop.
Alexey Bataev [Mon, 21 May 2018 17:46:34 +0000 (17:46 +0000)]
[InstCombine] Fix PR37526: MinMax patterns produce an infinite loop.

Summary:
This patch fixes PR37526 by simplifying the newly generated LoadInst
instructions. If the pointer address is a bitcast from the pointer to
the NewType, we can just remove this extra bitcast instead of creating
the new one. This fixes the PR37526 + may speed up the whole compilation
process.

Reviewers: spatel, RKSimon, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332855 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-mca] Removed an empty line generated by the timeline view. NFC.
Andrea Di Biagio [Mon, 21 May 2018 17:11:56 +0000 (17:11 +0000)]
[llvm-mca] Removed an empty line generated by the timeline view. NFC.

Also, regenerate all tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332853 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][BtVer2] Add a 'J' prefix to the PRF/RCU defs. NFC
Andrea Di Biagio [Mon, 21 May 2018 16:30:26 +0000 (16:30 +0000)]
[X86][BtVer2] Add a 'J' prefix to the PRF/RCU defs. NFC

This is to keep the Jaguar model's naming convention. Processor resources all
have a 'J' prefix in the BtVer2 scheduling model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332851 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Add DIBuilder Bindings For ObjC Classes
Robert Widmann [Mon, 21 May 2018 16:27:35 +0000 (16:27 +0000)]
[LLVM-C] Add DIBuilder Bindings For ObjC Classes

Summary: Add LLVMDIBuilderCreateObjCIVar, LLVMDIBuilderCreateObjCProperty, and LLVMDIBuilderCreateInheritance to allow declaring metadata for Objective-C class hierarchies and their associated properties and instance variables.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: harlanhaskins, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332850 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] - Avoid SFB pass - fix bug in updating the offsets for newly created copies
Lama Saba [Mon, 21 May 2018 16:23:16 +0000 (16:23 +0000)]
[X86] - Avoid SFB pass - fix bug in updating the offsets for newly created copies

Change-Id: I169ab6fe7e187727c0298c2a1e2868a683f3e688

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332849 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Refactor callback usage for .debug_line error handling
James Henderson [Mon, 21 May 2018 15:30:54 +0000 (15:30 +0000)]
[DWARF] Refactor callback usage for .debug_line error handling

Change the "recoverable" error callback to take an Error instaed of a
string.

Reviewed by: JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332845 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add an assert to ensure that rotation amount is converted to a scale
Simon Pilgrim [Mon, 21 May 2018 15:17:23 +0000 (15:17 +0000)]
[X86][SSE] Add an assert to ensure that rotation amount is converted to a scale

Missed in rL332832 where we added SSE v4i32 rotations for PR37426.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332844 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoARM: be conservative when asked load/store alignment of weird type.
Tim Northover [Mon, 21 May 2018 12:43:54 +0000 (12:43 +0000)]
ARM: be conservative when asked load/store alignment of weird type.

Chances are we'll be asked again after type legalization, but before that point
it's better to claim misaligned accesses aren't allowed than to assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332840 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agorevert r332610, it breaks cfi, see D46326
Nico Weber [Mon, 21 May 2018 11:44:39 +0000 (11:44 +0000)]
revert r332610, it breaks cfi, see D46326

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332838 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Revert Merge MipsLongBranch and MipsHazardSchedule passes
Aleksandar Beserminji [Mon, 21 May 2018 11:38:52 +0000 (11:38 +0000)]
[mips] Revert Merge MipsLongBranch and MipsHazardSchedule passes

Revert this patch due buildbot failure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332837 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CVP] Require DomTree for new Pass Manager
David Green [Mon, 21 May 2018 11:06:28 +0000 (11:06 +0000)]
[CVP] Require DomTree for new Pass Manager

We were previously using a DT in CVP through SimplifyQuery, but not requiring it in
the new pass manager. Hence it would crash if DT was not already available. This now
gets DT directly and plumbs it through to where it is used (instead of using it
through SQ).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332836 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix up a few grammar issues.
Eric Christopher [Mon, 21 May 2018 10:27:36 +0000 (10:27 +0000)]
Fix up a few grammar issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332835 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Merge MipsLongBranch and MipsHazardSchedule passes
Aleksandar Beserminji [Mon, 21 May 2018 10:20:02 +0000 (10:20 +0000)]
[mips] Merge MipsLongBranch and MipsHazardSchedule passes

MipsLongBranchPass and MipsHazardSchedule passes are joined to one pass
because of mutual conflict. When MipsHazardSchedule inserts 'nop's, it
potentially breaks some jumps, so they have to be expanded to long
branches. When some branch is expanded to long branch, it potentially
creates a hazard situation, which should be fixed by adding nops.
New pass is called MipsBranchExpansion, it combines these two passes,
and runs them alternately until one of them reports no changes were made.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332834 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Support v4i32 rotations (PR37426)
Simon Pilgrim [Mon, 21 May 2018 09:45:59 +0000 (09:45 +0000)]
[X86][SSE] Support v4i32 rotations (PR37426)

As suggested by Fabian on PR37426, we can use PMULUDQ to perform v4i32 vector rotations as the upper 32bits of the multiply will contain the 'wrapped' bits of the rotation.

v8i16/v16i8 rotations would be straightforward to add to lowerRotate in the future - ideally we'd mostly share code with the vector shifts lowering.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332832 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agowin: try more to fix dia tests with newer msvc versions
Nico Weber [Mon, 21 May 2018 02:55:41 +0000 (02:55 +0000)]
win: try more to fix dia tests with newer msvc versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332828 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agowin: try to fix dia tests with newer msvc versions
Nico Weber [Mon, 21 May 2018 02:09:57 +0000 (02:09 +0000)]
win: try to fix dia tests with newer msvc versions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332827 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Improve Bindings For Aliases
Robert Widmann [Sun, 20 May 2018 23:49:08 +0000 (23:49 +0000)]
[LLVM-C] Improve Bindings For Aliases

Summary: Add wrappers for a module's alias iterators and a getter and setter for the aliasee value.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits, harlanhaskins

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332826 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR...
Craig Topper [Sun, 20 May 2018 23:34:04 +0000 (23:34 +0000)]
[X86] Remove mask arguments from permvar builtins/intrinsics. Use a select in IR instead.

Someday maybe we'll use selects for all intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332824 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert 332750, llvm part (see comment on D46910).
Nico Weber [Sun, 20 May 2018 23:03:17 +0000 (23:03 +0000)]
Revert 332750, llvm part (see comment on D46910).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332823 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[mips] Add microMIPSR6 ll/sc instructions.
Simon Dardis [Sun, 20 May 2018 17:21:00 +0000 (17:21 +0000)]
[mips] Add microMIPSR6 ll/sc instructions.

Previously the compiler was using the microMIPSR3 variants, incorrectly.

Reviewers: atanasyan, abeserminji, smaksimovic

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332820 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] choose 1 form of abs and nabs as canonical
Sanjay Patel [Sun, 20 May 2018 14:23:23 +0000 (14:23 +0000)]
[InstCombine] choose 1 form of abs and nabs as canonical

We already do this for min/max (see the blob above the diff),
so we should do the same for abs/nabs.
A sign-bit check (<s 0) is used as a predicate for other IR
transforms and it's likely the best for codegen.

This might solve the motivating cases for D47037 and D47041,
but I think those patches still make sense. We can't guarantee
this canonicalization if the icmp has more than one use.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332819 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[cmake] Add a switch to enable/disable bindings.
Vassil Vassilev [Sun, 20 May 2018 08:37:54 +0000 (08:37 +0000)]
[cmake] Add a switch to enable/disable bindings.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332816 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases to show missed rotate opportunities due to SimplifyDemandedBits.
Craig Topper [Sun, 20 May 2018 02:32:45 +0000 (02:32 +0000)]
[X86] Add test cases to show missed rotate opportunities due to SimplifyDemandedBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332815 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[GlobalMerge] Exit early if only one global is to be merged
Haicheng Wu [Sat, 19 May 2018 18:00:02 +0000 (18:00 +0000)]
[GlobalMerge] Exit early if only one global is to be merged

To save some compilation time and prevent some unnecessary changes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332813 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRe-revert "[Option] Fix PR37006 prefix choice in findNearest"
Brian Gesiak [Sat, 19 May 2018 16:21:01 +0000 (16:21 +0000)]
Re-revert "[Option] Fix PR37006 prefix choice in findNearest"

Summary:
Reverting due to a test failure in an llvm-mt test on some buildbots, namely
http://green.lab.llvm.org/green/job/clang-stage2-configure-Rlto/26020/.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332812 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Use Length-Providing Value Name Getters and Setters
Robert Widmann [Sat, 19 May 2018 15:08:36 +0000 (15:08 +0000)]
[LLVM-C] Use Length-Providing Value Name Getters and Setters

Summary:
- Provide LLVMGetValueName2 and LLVMSetValueName2 that return and take the length of the provided C string respectively
- Deprecate LLVMGetValueName and LLVMSetValueName

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits, harlanhaskins

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332810 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IRCE] Fix miscompile with range checks against negative values
Max Kazantsev [Sat, 19 May 2018 13:06:37 +0000 (13:06 +0000)]
[IRCE] Fix miscompile with range checks against negative values

In the patch rL329547, we have lifted the over-restrictive limitation on collected range
checks, allowing to work with range checks with the end of their range not being
provably non-negative. However it appeared that the non-negativity of this value was
assumed in the utility function `ClampedSubtract`. In particular, its reasoning is based
on the fact that `0 <= SINT_MAX - X`, which is not true if `X` is negative.

The function `ClampedSubtract` is only called twice, once with `X = 0` (which is OK)
and the second time with `X = IRC.getEnd()`, where we may now see the problem if
the end is actually a negative value. In this case, we may sometimes miscompile.

This patch is the conservative fix of the miscompile problem. Rather than rejecting
non-provably non-negative `getEnd()` values, we will check it for non-negativity in
runtime. For this, we use function `smax(smin(X, 0), -1) + 1` that is equal to `1` if `X`
is non-negative and is equal to 0 if `X` is negative. If we multiply `Begin, End` of safe
iteration space by this function calculated for `X = IRC.getEnd()`, we will get the original
`[Begin, End)` if `IRC.getEnd()` was non-negative (and, thus, `ClampedSubtract` worked
correctly) and the empty range `[0, 0)` in case if ` IRC.getEnd()` was negative.

So we in fact prohibit execution of the main loop if at least one of range checks was
made against a negative value (and we figured it out in runtime). It is still better than
what we have before (non-negativity had to be proved in compile time) and prevents
us from miscompile, however it is sometiles too restrictive for unsigned range checks
against a negative value (which in fact can be eliminated).

Once we re-implement `ClampedSubtract` in a way that it handles negative `X` correctly,
this limitation can be lifted, too.

Differential Revision: https://reviews.llvm.org/D46860
Reviewed By: samparker

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332809 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MergeICmps] Don't crash when memcmp is not available
Benjamin Kramer [Sat, 19 May 2018 12:51:59 +0000 (12:51 +0000)]
[MergeICmps] Don't crash when memcmp is not available

Fixes clang crashing with -fno-builtin, PR37527.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix MSVC unused variable warning. NFCI.
Simon Pilgrim [Sat, 19 May 2018 12:46:02 +0000 (12:46 +0000)]
Fix MSVC unused variable warning. NFCI.

AMDGPURegisterInfo::getSubRegFromChannel is a static method - we don't need to get the AMDGPURegisterInfo instance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332807 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoUn-revert "[Option] Fix PR37006 prefix choice in findNearest"
Brian Gesiak [Sat, 19 May 2018 12:03:26 +0000 (12:03 +0000)]
Un-revert "[Option] Fix PR37006 prefix choice in findNearest"

Summary:
In https://reviews.llvm.org/rL332804 I loosed the assertion in
the Clang driver test that forced me to revert
https://reviews.llvm.org/rL332299. Once this lands I should be
able to narrow down what caused PS4 buildbots to fail, and
reinstate the check in that test.

Test Plan: check-llvm & check-clang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332805 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix build warning compiling TestPlugin on Windows and disable Passes plugin stuff...
Nico Weber [Sat, 19 May 2018 03:05:30 +0000 (03:05 +0000)]
Fix build warning compiling TestPlugin on Windows and disable Passes plugin stuff on Windows since it fundamentally can't work

Aaron Ballman reported that TestPlugin warned about it using exception handling
without /EHsc flag, and that llvmGetPassInfo() had conflicting export
attributes (dllimport in the header, dllexport in the source file).

/EHsc is because TestPlugin didn't use the llvm_ cmake functions, so
llvm_update_compile_flags didn't get called for the target
(llvm_update_compile_flags explicitly passes /Ehs-c-, which fixes the warning).
Use add_llvm_loadable_module instead of add_library(... MODULE) to fix this.
This also has the side effect of not building the plugin on Windows. That's not
a big problem, since before the plugin was built on Windows, but the test
didn't attempt to load it, due to -DLLVM_ENABLE_PLUGIN not being passed to
PluginsTests.cpp during compilation on Windows. This makes the plugin behavior
consistent with e.g. lib/Transforms/Hello/CMakeLists.txt. (This also
automatically sets LTDL_SHLIB_EXT correctly.)

The dllimport/dllexport warning is more serious: Since LLVM doesn't generally
use export annotations for its code, the only way the plugin could link was by
linking in some LLVM libraries both into the test and the dll, so the plugin
would call the llvm code in the dll instead of the copy in the main executable.
This means globals weren't shared, and things generally can't work. (I think
there's a build config where you can build a LLVM.dll which might work, but
that wasn't how the test was configured. If that config is used, the dll should
still be built, but I haven't checked).

Now that add_llvm_loadable_module is used, LLVM_LINK_COMPONENTS got linked into
both executable and plugin on posix too, so unset it after the executable so
that the plugin doesn't end up with a 2nd copy of things on posix.

https://reviews.llvm.org/D47082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332796 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix evaluator for non-zero alloca addr space
Yaxun Liu [Sat, 19 May 2018 02:58:16 +0000 (02:58 +0000)]
Fix evaluator for non-zero alloca addr space

The evaluator goes through BB and creates global vars as temporary values to evaluate
results of LLVM instructions. It creates undef for alloca, however it assumes alloca
in addr space 0. If the next instruction is addrspace cast to 0, then we get an invalid
cast instruction.

This patch let the temp global var have an address space matching alloca addr space,
so that the valuation can be done.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332794 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoEnable colored diagnostics in ninja builds when building with gcc 4.9+.
Nico Weber [Sat, 19 May 2018 02:36:27 +0000 (02:36 +0000)]
Enable colored diagnostics in ninja builds when building with gcc 4.9+.

GCC has supported -fdiagnostics-color since 4.9.

https://reviews.llvm.org/D47083

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332793 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoPropagate nonnull and dereferenceable throught launder
Piotr Padlewski [Fri, 18 May 2018 23:54:33 +0000 (23:54 +0000)]
Propagate nonnull and dereferenceable throught launder

Summary:
invariant.group.launder should not stop propagation
of nonnull and dereferenceable, because e.g. we would not be
able to hoist loads speculatively.

Reviewers: rsmith, amharc, kuhar, xbolva00, hfinkel

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332788 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDissallow non-empty metadata for invariant.group
Piotr Padlewski [Fri, 18 May 2018 23:53:46 +0000 (23:53 +0000)]
Dissallow non-empty metadata for invariant.group

Summary:
This feature is not needed, but it might be usefull in the future
to use metadata to mark what which function should support it
(and strip it when not).

Reviewers: rsmith, sanjoy, amharc, kuhar

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332787 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoConstant fold launder of null and undef
Piotr Padlewski [Fri, 18 May 2018 23:52:57 +0000 (23:52 +0000)]
Constant fold launder of null and undef

Summary:
This might be useful because clang will add
some barriers for pointer comparisons.

Reviewers: majnemer, dberlin, hfinkel, nlewycky, davide, rsmith, amharc,
kuhar

Subscribers: davide, amharc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332786 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MemDep] Fixed handling of invariant.group
Piotr Padlewski [Fri, 18 May 2018 22:40:34 +0000 (22:40 +0000)]
[MemDep] Fixed handling of invariant.group

Summary:
Memdep had funny bug related to invariant.groups - because it did not
invalidated cache, in some very rare cases it was possible to show memory
dependence of the instruction that was deleted, but because other
instruction took it's place it resulted in call to vtable!
Thanks @amharc for repro!.

Reviewers: dberlin, kuhar, amharc

Subscribers: llvm-commits

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

Co-authored-by: Krzysztof Pszeniczny <krzysztof.pszeniczny@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332781 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[x86] add more FP with FMF simplification tests; NFC
Sanjay Patel [Fri, 18 May 2018 22:31:43 +0000 (22:31 +0000)]
[x86] add more FP with FMF simplification tests; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332780 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDAG: Fix crash on shift with large shift amounts
Matt Arsenault [Fri, 18 May 2018 21:54:16 +0000 (21:54 +0000)]
DAG: Fix crash on shift with large shift amounts

Fixes bug 37521.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332774 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixing buildbot error introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 21:44:28 +0000 (21:44 +0000)]
Fixing buildbot error introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332772 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU: Add pass to optimize reqd_work_group_size
Matt Arsenault [Fri, 18 May 2018 21:35:00 +0000 (21:35 +0000)]
AMDGPU: Add pass to optimize reqd_work_group_size

Eliminate loads from the dispatch packet when they will have
a known value.

Also pattern match the code used by the library to handle partial
workgroup dispatches, which isn't necessary if reqd_work_group_size
is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332771 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] Qualify a select pattern based transform to restrct to only min/max...
Craig Topper [Fri, 18 May 2018 21:21:56 +0000 (21:21 +0000)]
[InstCombine] Qualify a select pattern based transform to restrct to only min/max and ignore abs/nabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332770 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[WebAssembly] Object: Add more error checking for object file reading
Sam Clegg [Fri, 18 May 2018 21:08:26 +0000 (21:08 +0000)]
[WebAssembly] Object: Add more error checking for object file reading

This should address some the assert failures the fuzzer has been
finding such as:
  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6719

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332769 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAddressing a couple of compiler warnings introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 20:51:16 +0000 (20:51 +0000)]
Addressing a couple of compiler warnings introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332766 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFixing build error introduced with r332759.
Wolfgang Pieb [Fri, 18 May 2018 20:35:13 +0000 (20:35 +0000)]
Fixing build error introduced with r332759.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332762 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[msan] Don't check divisor shadow in fdiv.
Evgeniy Stepanov [Fri, 18 May 2018 20:19:53 +0000 (20:19 +0000)]
[msan] Don't check divisor shadow in fdiv.

Summary:
Floating point division by zero or even undef does not have undefined
behavior and may occur due to optimizations.

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

Reviewers: kcc

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332761 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF v5] Improved support for .debug_rnglists (consumer). Enables any consumer to
Wolfgang Pieb [Fri, 18 May 2018 20:12:54 +0000 (20:12 +0000)]
[DWARF v5] Improved support for .debug_rnglists (consumer). Enables any consumer to
extract DWARF v5 encoded rangelists.

Reviewer: JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332759 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Change cast from r332739 to a static cast
Jessica Paquette [Fri, 18 May 2018 20:04:21 +0000 (20:04 +0000)]
[NFC] Change cast from r332739 to a static cast

The casts in the delta computation for size remarks should have
been static casts. This fixes that.

Thanks to Dávid Bolvanský for pointing that out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332758 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoSupport: Simplify endian stream interface. NFCI.
Peter Collingbourne [Fri, 18 May 2018 19:46:24 +0000 (19:46 +0000)]
Support: Simplify endian stream interface. NFCI.

Provide some free functions to reduce verbosity of endian-writing
a single value, and replace the endianness template parameter with
a field.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332757 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoadding baseline fp fold tests for unsafe on and off
Michael Berg [Fri, 18 May 2018 19:30:49 +0000 (19:30 +0000)]
adding baseline fp fold tests for unsafe on and off

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332756 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoDelete a test that was missed in the revert r332747.
Amara Emerson [Fri, 18 May 2018 19:21:40 +0000 (19:21 +0000)]
Delete a test that was missed in the revert r332747.

r332747 originally reverted r332654 which added this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332755 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/NFC: Set symbol's type that is coming from an argument in
Konstantin Zhuravlyov [Fri, 18 May 2018 18:41:37 +0000 (18:41 +0000)]
AMDGPU/NFC: Set symbol's type that is coming from an argument in
EmitAMDGPUSymbolType, instead of hard-coding it to STT_AMDGPU_HSA_KERNEL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332753 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Support] Avoid normalization in sys::getDefaultTargetTriple
Petr Hosek [Fri, 18 May 2018 18:33:07 +0000 (18:33 +0000)]
[Support] Avoid normalization in sys::getDefaultTargetTriple

The return value of sys::getDefaultTargetTriple, which is derived from
-DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target,
and in the future also to control the search path directly; as such it
should be used textually, without interpretation by LLVM.

Normalization of this value may lead to unexpected results, for example
if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu,
normalization will transform that value to x86_64--linux-gnu. Driver will
use that value to search for tools prefixed with x86_64--linux-gnu- which
may be confusing. This is also inconsistent with the behavior of the
--target flag which is taken as-is without any normalization and overrides
the value of LLVM_DEFAULT_TARGET_TRIPLE.

Users of sys::getDefaultTargetTriple already perform their own
normalization as needed, so this change shouldn't impact existing logic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332750 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMC: Change the streamer ctors to take an object writer instead of a stream. NFCI.
Peter Collingbourne [Fri, 18 May 2018 18:26:45 +0000 (18:26 +0000)]
MC: Change the streamer ctors to take an object writer instead of a stream. NFCI.

The idea is that a client that wants split dwarf would create a
specific kind of object writer that creates two files, and use it to
create the streamer.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332749 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Hexagon] Generate post-increment for floating point types
Brendon Cahoon [Fri, 18 May 2018 18:14:44 +0000 (18:14 +0000)]
[Hexagon] Generate post-increment for floating point types

The code that generates post-increments for Hexagon considered
integer values only. This patch adds support to generate them for
floating point values, f32 and f64.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332748 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReverted r332654 as it has broken some buildbots and left unfixed for a long time.
Galina Kistanova [Fri, 18 May 2018 18:14:06 +0000 (18:14 +0000)]
Reverted r332654 as it has broken some buildbots and left unfixed for a long time.

The introduced problem is:
llvm.src/lib/Transforms/Vectorize/VPlanVerifier.cpp:29:13: error: unused function 'hasDuplicates' [-Werror,-Wunused-function]
static bool hasDuplicates(const SmallVectorImpl<VPBlockBase *> &VPBlockVec) {
            ^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332747 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add GPR<->XMM Schedule Tags
Simon Pilgrim [Fri, 18 May 2018 17:58:36 +0000 (17:58 +0000)]
[X86] Add GPR<->XMM Schedule Tags

BtVer2 - fix NumMicroOp and account for the Lat+6cy GPR->XMM and Lat+1cy XMm->GPR delays (see rL332737)

The high number of MOVD/MOVQ equivalent instructions meant that there were a number of missed patterns in SNB/Znver1:
SNB - add missing GPR<->MMX costs (taken from Agner / Intel AOM)
Znver1 - add missing GPR<->XMM MOVQ costs (taken from Agner)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332745 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Directly legalize v16i16/v8i16 vselect to vXi8 vselect to use VPBLENDVB
Craig Topper [Fri, 18 May 2018 17:48:06 +0000 (17:48 +0000)]
[X86] Directly legalize v16i16/v8i16 vselect to vXi8 vselect to use VPBLENDVB

The intrinsic legalization for masked truncate uses ISD::TRUNCATE which can be constant folded by getNode. This prevents getVectorMaskingNode from seeing the ISD::TRUNCATE special case where it should emit X86ISD::SELECT instead of ISD::VSELECT. This causes a vselect with a v16i1 or v8i1 condition to be emitted during vector legalization. but vector legalization doesn't revisit nodes it creates. DAG combine will then promote this condition to match the result type. Then op legalization will try to legalize it, but the custom lowering hook returned SDValue(). But op legalization doesn't have an Expand for VSELECT because it expects vector legalization to have taken care of it. So the operation sticks around and fails in isel.

This patch adds a custom legalization hook to morph it to a vXi8 vselect instead.

This also simplifies the normal vXi16 vselect handling because vector legalization was normally expanding to AND/ANDN/OR and DAG combine was turning that into VBLENDVB. So we can skip a step by doing it directly.

Fixes PR37499

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332743 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert changes from D46265.
Than McIntosh [Fri, 18 May 2018 17:47:10 +0000 (17:47 +0000)]
Revert changes from D46265.

This is a revert of the changes from https://reviews.llvm.org/D46265;
the new test introduced (test/CodeGen/X86/PR37310.mir) causes buildbot
failures.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332742 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[MC] Relax .fill size requirements
Nirav Dave [Fri, 18 May 2018 17:45:48 +0000 (17:45 +0000)]
[MC] Relax .fill size requirements

Avoid requirement that number of values must be known at assembler
time.

Fixes PR33586.

Reviewers: rnk, peter.smith, echristo, jyknight

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332741 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Update fast-isel test cases for _mm256_mask_cvtepi16_epi8 to match clang r332738.
Craig Topper [Fri, 18 May 2018 17:29:47 +0000 (17:29 +0000)]
[X86] Update fast-isel test cases for _mm256_mask_cvtepi16_epi8 to match clang r332738.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332740 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd remarks describing when a pass changes the IR instruction count of a module
Jessica Paquette [Fri, 18 May 2018 17:26:39 +0000 (17:26 +0000)]
Add remarks describing when a pass changes the IR instruction count of a module

This patch adds a remark which tells the user when a pass changes the number of
IR instructions in a module.

It can be enabled by using -Rpass-analysis=size-info.

The point of this is to make it easier to collect statistics on how passes
modify programs in terms of code size. This is similar in concept to timing
reports, but using a remark-based interface makes it easy to diff changes over
multiple compilations of the same program.

By adding functionality like this, we can see
  * Which passes impact code size the most
  * How passes impact code size at different optimization levels
  * Which pass might have contributed the most to an overall code size
    regression

The patch lives in the legacy pass manager, but since it's simply emitting
remarks, it shouldn't be too difficult to adapt the functionality to the new
pass manager as well. This can also be adapted to handle MachineInstr counts in
code gen passes.

https://reviews.llvm.org/D38768

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332739 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][BtVer2] Improve simulation of (V)PINSR values
Simon Pilgrim [Fri, 18 May 2018 17:09:41 +0000 (17:09 +0000)]
[X86][BtVer2] Improve simulation of (V)PINSR values

Include the 6cy delay transferring from the GPR to FPU.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332737 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[docs] Scudo documentation minor update
Kostya Kortchinsky [Fri, 18 May 2018 17:02:35 +0000 (17:02 +0000)]
[docs] Scudo documentation minor update

Summary:
Minor changes to reflect changes to the code that were not documented:
- `SCUDO_DEFAULT_OPTIONS` compile time way of defining options;
- MIPS added as a supported architecture;
- clarification on how to fully disable the Quarantine;
- rewording in a few places.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: sdardis, arichardson, atanasyan, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332736 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] update coding standard links to HTTPS
JF Bastien [Fri, 18 May 2018 16:44:13 +0000 (16:44 +0000)]
[NFC] update coding standard links to HTTPS

Update one link which redirected, and remove an Amazon ref.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332735 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMCSchedModel: Add comments to IssueWidth.
Andrew Trick [Fri, 18 May 2018 15:57:54 +0000 (15:57 +0000)]
MCSchedModel: Add comments to IssueWidth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332729 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for lack of abs/nabs canonicalization; NFC
Sanjay Patel [Fri, 18 May 2018 15:26:38 +0000 (15:26 +0000)]
[InstCombine] add tests for lack of abs/nabs canonicalization; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332726 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] regenerate checks; NFC
Sanjay Patel [Fri, 18 May 2018 15:22:19 +0000 (15:22 +0000)]
[InstCombine] regenerate checks; NFC

There were a combination of auto-generated styles in use
here because the scripts have evolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332725 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][BtVer2] Partial vector stores (inc MMX) have a 2cy latency
Simon Pilgrim [Fri, 18 May 2018 14:22:22 +0000 (14:22 +0000)]
[X86][BtVer2] Partial vector stores (inc MMX) have a 2cy latency

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332722 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Ensure vector partial load/stores use the WriteVecLoad/WriteVecStore sched...
Simon Pilgrim [Fri, 18 May 2018 14:08:01 +0000 (14:08 +0000)]
[X86][SSE] Ensure vector partial load/stores use the WriteVecLoad/WriteVecStore scheduler classes

Retag some instructions that were missed when we split off vector load/store/moves - MOVQ/MOVD etc.

Fixes BtVer2/SLM which have different behaviours for GPR stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332718 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] VEXTRACTF128mr store is a WriteFStoreX not WriteFStore
Simon Pilgrim [Fri, 18 May 2018 13:17:51 +0000 (13:17 +0000)]
[X86][AVX] VEXTRACTF128mr store is a WriteFStoreX not WriteFStore

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332715 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Ensure float load/stores use the WriteFLoad/WriteFStore scheduler classes
Simon Pilgrim [Fri, 18 May 2018 13:13:59 +0000 (13:13 +0000)]
[X86][SSE] Ensure float load/stores use the WriteFLoad/WriteFStore scheduler classes

Retag some instructions that were missed when we split off vector load/store/moves - MOVSS/MOVSD/MOVHPD/MOVHPD/MOVLPD/MOVLPS etc.

Fixes BtVer2/SLM which have different behaviours for GPR stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332714 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ExynosM3] Fix scheduling info.
Clement Courbet [Fri, 18 May 2018 13:10:41 +0000 (13:10 +0000)]
[ExynosM3] Fix scheduling info.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332713 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][ZnVer1] Cleanup more single match instregexs
Simon Pilgrim [Fri, 18 May 2018 13:05:26 +0000 (13:05 +0000)]
[X86][ZnVer1] Cleanup more single match instregexs

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332712 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd Script to match open Phabricator reviews with potential reviewers.
Kristof Beyls [Fri, 18 May 2018 13:02:32 +0000 (13:02 +0000)]
Add Script to match open Phabricator reviews with potential reviewers.

At the last EuroLLVM, I gave a lightning talk about code review
statistics on Phabricator reviews and what we could derive from that
to try and reduce waiting-for-review bottlenecks. (see
https://llvm.org/devmtg/2018-04/talks.html#Lightning_2).

One of the items I pointed to is a script we've been using internally
for a little while to try and match open Phabricator reviews to people
who might be able to review them well. I received quite a few requests
to share that script, so here it is.

Warning: this is prototype quality!

The script uses 2 similar heuristics to try and match open reviews with
potential reviewers:

If there is overlap between the lines of code touched by the
patch-under-review and lines of code that a person has written, that
person may be a good reviewer.
If there is overlap between the files touched by the patch-under-review
and the source files that a person has made changes to, that person may
be a good reviewer.
The script provides a percentage for each of the above heuristics and
emails a summary. For example, a summary I received a few weeks ago
from the script is the following:

SUMMARY FOR kristof.beyls@arm.com (found 8 reviews):
[3.37%/41.67%] https://reviews.llvm.org/D46018 '[GlobalISel][IRTranslator] Split aggregates during IR translation' by Amara Emerson
[0.00%/100.00%] https://reviews.llvm.org/D46111 '[ARM] Enable misched for R52.' by Dave Green
[0.00%/50.00%] https://reviews.llvm.org/D45770 '[AArch64] Disable spill slot scavenging when stack realignment required.' by Paul Walker
[0.00%/40.00%] https://reviews.llvm.org/D42759 '[CGP] Split large data structres to sink more GEPs' by Haicheng Wu
[0.00%/25.00%] https://reviews.llvm.org/D45189 '[MachineOutliner][AArch64] Keep track of functions that use a red zone in AArch64MachineFunctionInfo and use that instead of checking for noredzone in the MachineOutliner' by Jessica Paquette
[0.00%/25.00%] https://reviews.llvm.org/D46107 '[AArch64] Codegen for v8.2A dot product intrinsics' by Oliver Stannard
[0.00%/12.50%] https://reviews.llvm.org/D45541 '[globalisel] Update GlobalISel emitter to match new representation of extending loads' by Daniel Sanders
[0.00%/6.25%] https://reviews.llvm.org/D44386 '[x86] Introduce the pconfig/enclv instructions' by Gabor Buella

The first percentage in square brackets is the percentage of lines in
the patch-under-review that changes lines that I wrote. The second
percentage is the percentage of files that I made at least some
changes to out of all of the files touched by the patch-under-review.

Both the script and the heuristics are far from perfect, but I've
heard positive feedback from the few colleagues the script has been
sending a summary to every day - hearing that this does help them to
quickly find patches-under-review they can help to review.

The script takes quite some time to run (I typically see it running
for 2 to 3 hours on weekdays when it gets started by a cron job early
in the morning). There are 2 reasons why it takes a long time:

The REST api into Phabricator isn't very efficient, i.e. a lot of
uninteresting data needs to be fetched. The script tries to reduce this
overhead partly by caching info it has fetched on previous runs, so as
to not have to refetch lots of Phabricator state on each run.
The script uses git blame to find for each line of code in the patch who
wrote the original line of code being altered. git blame is
sloooowww....
Anyway - to run this script:

First install a virtualenv as follows (using Python2.7 - Python3 is
almost certainly not going to work at the moment):
$ virtualenv venv
$ . ./venv/bin/activate
$ pip install Phabricator

Then to run the script, looking for open reviews that could be done by
X.Y@company.com, run (in the venv):
$ python ./find_interesting_reviews.py X.Y@company.com

Please note that "X.Y@company.com" needs to be the exact email address
(capitalization is important) that the git LLVM repository knows the
person as. Multiple email addresses can be specified on the command
line. Note that the script as is will email the results to all email
addresses specified on the command line - so be careful not to spam
people accidentally!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332711 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agouse standard llvm cmake formatting for targets defined in plugin tests
Nico Weber [Fri, 18 May 2018 12:42:30 +0000 (12:42 +0000)]
use standard llvm cmake formatting for targets defined in plugin tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332709 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-exegesis] Improve documentation.
Clement Courbet [Fri, 18 May 2018 12:33:57 +0000 (12:33 +0000)]
[llvm-exegesis] Improve documentation.

Summary:
- Better flag names.
- Fix flag reference in doc.
- Add usage examples in doc.

Fixes PR37497.

Reviewers: gchatelet

Subscribers: llvm-commits, tschuett

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332708 91177308-0d34-0410-b5e6-96231b3b80d8