OSDN Git Service

android-x86/external-llvm.git
7 years ago[InstCombine] Set correct insertion point for selects generated while folding phis
Anna Thomas [Fri, 16 Jun 2017 21:08:37 +0000 (21:08 +0000)]
[InstCombine] Set correct insertion point for selects generated while folding phis

Summary:
When we fold vector constants that are operands of phi's that feed into select,
we need to set the correct insertion point for the *new* selects that get generated.
The correct insertion point is the incoming block for the phi.
Such cases can occur with patch r298845, which fixed folding of
vector constants, but the new selects could be inserted incorrectly (as the added
test case shows).

Reviewers: majnemer, spatel, sanjoy

Reviewed by: spatel

Subscribers: llvm-commits

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

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

7 years agoChange YAML traits for vector<string> to flow_vector.
Evgeniy Stepanov [Fri, 16 Jun 2017 20:50:41 +0000 (20:50 +0000)]
Change YAML traits for vector<string> to flow_vector.

This is a workaround for an ODR conflict with the definition in
AMDGPUCodeObjectMetadata.cpp.

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

7 years ago[SCCP] Simplify the code a bit. NFCI.
Davide Italiano [Fri, 16 Jun 2017 20:50:31 +0000 (20:50 +0000)]
[SCCP] Simplify the code a bit. NFCI.

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

7 years ago[SCCP] Clarify a comment about unhandled instructions.
Davide Italiano [Fri, 16 Jun 2017 20:27:17 +0000 (20:27 +0000)]
[SCCP] Clarify a comment about unhandled instructions.

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

7 years ago[GVN] Recommit the patch "Add phi-translate support in scalarpre".
Wei Mi [Fri, 16 Jun 2017 20:21:01 +0000 (20:21 +0000)]
[GVN] Recommit the patch "Add phi-translate support in scalarpre".

The recommit fixes two bugs: The first one is to use CurrentBlock instead of
PREInstr's Parent as param of performScalarPREInsertion because the Parent
of a clone instruction may be uninitialized. The second one is stop PRE when
CurrentBlock to its predecessor is a backedge and an operand of CurInst is
defined inside of CurrentBlock. The same value defined inside of loop in last
iteration can not be regarded as available.

Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.

long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();

void foo(long a, long b, long c, long d) {

  g1 = a * b;
  if (__builtin_expect(g2 > 3, 0)) {
    a = c;
    b = d;
    g2 = a * b;
  }
  g3 = a * b;      // fully redundant.

}
The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.

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

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

7 years ago[SCCP] Remove redundant instruction visitors.
Davide Italiano [Fri, 16 Jun 2017 19:43:57 +0000 (19:43 +0000)]
[SCCP] Remove redundant instruction visitors.

Whenever we don't know what to do with an instruction, we send
it to overdefined anyway.

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

7 years ago[DWARF] Replaced mem-initializers with non-static data member initializers in DWARFVe...
Spyridoula Gravani [Fri, 16 Jun 2017 18:55:01 +0000 (18:55 +0000)]
[DWARF] Replaced mem-initializers with non-static data member initializers in DWARFVerifier class.

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

7 years agoRevert "RegScavenging: Add scavengeRegisterBackwards()"
Matthias Braun [Fri, 16 Jun 2017 17:48:08 +0000 (17:48 +0000)]
Revert "RegScavenging: Add scavengeRegisterBackwards()"

Revert because of reports of some PPC input starting to spill when it
was predicted that it wouldn't and no spillslot was reserved.

This reverts commit r305516.

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

7 years agoFix function name /NFC
Xinliang David Li [Fri, 16 Jun 2017 16:54:13 +0000 (16:54 +0000)]
Fix function name /NFC

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

7 years ago[InstCombine] Add test cases to show missed opportunities due to overly conservative...
Craig Topper [Fri, 16 Jun 2017 16:44:36 +0000 (16:44 +0000)]
[InstCombine] Add test cases to show missed opportunities due to overly conservative single use checks. NFC

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

7 years agobpf: avoid load from read-only sections
Yonghong Song [Fri, 16 Jun 2017 15:41:16 +0000 (15:41 +0000)]
bpf: avoid load from read-only sections

If users tried to have a structure decl/init code like below
   struct test_t t = { .memeber1 = 45 };
It is very likely that compiler will generate a readonly section
to hold up the init values for variable t. Later load of t members,
e.g., t.member1 will result in a read from readonly section.

BPF program cannot handle relocation. This will force users to
write:
  struct test_t t = {};
  t.member1 = 45;
This is just inconvenient and unintuitive.

This patch addresses this issue by implementing BPF PreprocessISelDAG.
For any load from a global constant structure or an global array of
constant struct, it attempts to
translate it into a constant directly. The traversal of the
constant struct and other constant data structures are similar
to where the assembler emits read-only sections.

Four different unit test cases are also added to cover
different scenarios.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305560 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agobpf: set missing types in insn tablegen file
Yonghong Song [Fri, 16 Jun 2017 15:30:55 +0000 (15:30 +0000)]
bpf: set missing types in insn tablegen file

o This is discovered during my study of 32-bit subregister
  support.
o This is no impact on current functionality since we
  only support 64-bit registers.
o Searching the web, looks like the issue has been discovered
  before, so fix it now.

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305559 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Atomics] Rename and change prototype for atomic memcpy intrinsic
Daniel Neilson [Fri, 16 Jun 2017 14:43:59 +0000 (14:43 +0000)]
[Atomics] Rename and change prototype for atomic memcpy intrinsic

Summary:

Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic.

Reviewers: reames, sanjoy, efriedma

Reviewed By: reames

Subscribers: mzolotukhin, anna, llvm-commits, skatkov

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

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

7 years agoRevert "[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP"
Simon Dardis [Fri, 16 Jun 2017 14:00:33 +0000 (14:00 +0000)]
Revert "[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP"

This reverts commit r305455. This commit was reported as breaking one of
the sanitizer buildbots. Reverting until lab.llvm.org comes back online.

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

7 years ago[TableGen] Do not assume that the first variant is the original pattern
Krzysztof Parzyszek [Fri, 16 Jun 2017 13:44:34 +0000 (13:44 +0000)]
[TableGen] Do not assume that the first variant is the original pattern

The variant generation for commutative/associative patterns would simply
delete the first output from the list assuming that it was identical to
the original pattern. This does not have to be the case, and a legitimate
variant could actually be removed that way.

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

7 years ago[Hexagon] Don't kill live registers when creating mux out of tfr
Krzysztof Parzyszek [Fri, 16 Jun 2017 12:24:03 +0000 (12:24 +0000)]
[Hexagon] Don't kill live registers when creating mux out of tfr

The second part of r305300: when placing the mux at the later location,
make sure that it won't use any register that was killed between the
two original instructions. Remove any such kills and transfer them to
the mux.

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

7 years ago[MachineBlockPlacement] trivial fix in comments, NFC
Hiroshi Inoue [Fri, 16 Jun 2017 12:23:04 +0000 (12:23 +0000)]
[MachineBlockPlacement] trivial fix in comments, NFC

- Topologocal is abbreviated as "topo" in comments, but "top" is used in only one comment. Modify it for consistency.
- Capitalize "succ" and "pred" for consistency in one figure.
- Other trivial fixes.

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

7 years ago[InstCombine] Fold (!iszero(A & K1) & !iszero(A & K2)) -> (A & (K1 | K2)) == (K1...
Craig Topper [Fri, 16 Jun 2017 05:10:37 +0000 (05:10 +0000)]
[InstCombine] Fold (!iszero(A & K1) & !iszero(A & K2)) ->  (A & (K1 | K2)) == (K1 | K2) if K1 and K2 are a 1-bit mask

Summary: This is the demorganed version of the case we already handle for the OR of iszero.

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

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

7 years agoFix buildbots.
Rui Ueyama [Fri, 16 Jun 2017 02:42:33 +0000 (02:42 +0000)]
Fix buildbots.

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

7 years agoFix msan buildbot.
Rui Ueyama [Fri, 16 Jun 2017 02:17:35 +0000 (02:17 +0000)]
Fix msan buildbot.

This patch should fix sanitizer-x86_64-linux-fast bot.

The problem was that the contents of this stream are aligned to 4 byte,
and the paddings were created just by incrementing `Offset`, so paddings
had undefined values. When the entire stream is written to an output,
it triggered msan.

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

7 years ago[CorrelatedValuePropagation] Remove superfluous semicolon. NFC
Craig Topper [Fri, 16 Jun 2017 01:53:20 +0000 (01:53 +0000)]
[CorrelatedValuePropagation] Remove superfluous semicolon. NFC

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

7 years ago[BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and Include...
Eugene Zelenko [Fri, 16 Jun 2017 00:43:26 +0000 (00:43 +0000)]
[BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoFix build warning on 32-bit targets where sizeof(size_t) < sizeof(long long).
Evgeniy Stepanov [Fri, 16 Jun 2017 00:32:11 +0000 (00:32 +0000)]
Fix build warning on 32-bit targets where sizeof(size_t) < sizeof(long long).

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

7 years ago[cfi] CFI-ICall for ThinLTO.
Evgeniy Stepanov [Fri, 16 Jun 2017 00:18:29 +0000 (00:18 +0000)]
[cfi] CFI-ICall for ThinLTO.

Implement ControlFlowIntegrity for indirect function calls in ThinLTO.
Design follows the RFC in llvm-dev, see
https://groups.google.com/d/msg/llvm-dev/MgUlaphu4Qc/kywu0AqjAQAJ

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

7 years ago[llvm-pdbutil] Add support for dumping cross module imports/exports.
Zachary Turner [Fri, 16 Jun 2017 00:04:24 +0000 (00:04 +0000)]
[llvm-pdbutil] Add support for dumping cross module imports/exports.

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

7 years ago[llvm-pdbutil] Add a function for iterating over debug subsections.
Zachary Turner [Thu, 15 Jun 2017 23:59:56 +0000 (23:59 +0000)]
[llvm-pdbutil] Add a function for iterating over debug subsections.

NFC, just adds a helper function to reduce boilerplate.

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

7 years ago[PartialInlining] Code Refactoring
Xinliang David Li [Thu, 15 Jun 2017 23:56:59 +0000 (23:56 +0000)]
[PartialInlining] Code Refactoring

This is a NFC code refactoring and interface cleanup. This paves the
way to enable outlining-only mode for the partial inliner.

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

7 years ago[llvm-pdbutil] Add support for dumping lines and inlinee lines.
Zachary Turner [Thu, 15 Jun 2017 23:56:19 +0000 (23:56 +0000)]
[llvm-pdbutil] Add support for dumping lines and inlinee lines.

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

7 years agoTry to fix uninitialized read reported by msan.
Zachary Turner [Thu, 15 Jun 2017 23:44:19 +0000 (23:44 +0000)]
Try to fix uninitialized read reported by msan.

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

7 years agoRevert "[DAG] Allow truncated and extend memory operations in Store Merge. NFCI."
Ahmed Bougacha [Thu, 15 Jun 2017 23:29:47 +0000 (23:29 +0000)]
Revert "[DAG] Allow truncated and extend memory operations in Store Merge. NFCI."

This reverts commit r305468, as it caused PR33475.

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

7 years ago[llvm-pdbutil] Add back support for dumping file checksums.
Zachary Turner [Thu, 15 Jun 2017 23:12:41 +0000 (23:12 +0000)]
[llvm-pdbutil] Add back support for dumping file checksums.

When dumping module source files, also dump checksums.

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

7 years agotest-release.sh: Run the test-suite using phase3 clang
Tom Stellard [Thu, 15 Jun 2017 23:05:21 +0000 (23:05 +0000)]
test-release.sh: Run the test-suite using phase3 clang

Summary: We were using the system compiler to run the test suite.

Reviewers: hansw

Subscribers: llvm-commits

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

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

7 years ago[llvm-pdbutil] Add back the ability to dump hashes and index offsets.
Zachary Turner [Thu, 15 Jun 2017 23:04:42 +0000 (23:04 +0000)]
[llvm-pdbutil] Add back the ability to dump hashes and index offsets.

This was regressed in a previous patch that re-wrote the dumper,
and I'm incrementally adding back the pieces that are missing.

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

7 years ago [AMDGPU] Testing commit access only, no real change
Alfred Huang [Thu, 15 Jun 2017 23:02:55 +0000 (23:02 +0000)]
[AMDGPU] Testing commit access only, no real change

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

7 years agoUnitTests: Followup to 305519
Matthias Braun [Thu, 15 Jun 2017 22:50:57 +0000 (22:50 +0000)]
UnitTests: Followup to 305519

We have to use ASSERT_XXX instead of EXPECT_XXX if the test cannot
continue in the failure case.

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

7 years ago[libFuzzer] change the default max_len from 64 to 4096. This will affect cases where...
Kostya Serebryany [Thu, 15 Jun 2017 22:43:40 +0000 (22:43 +0000)]
[libFuzzer] change the default max_len from 64 to 4096. This will affect cases where libFuzzer is run w/o initial corpus or with a corpus of very small items.

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

7 years agoUnitTests: Replace some if(x)report_fatal_error() with EXPECT_TRUE(!x)
Matthias Braun [Thu, 15 Jun 2017 22:31:08 +0000 (22:31 +0000)]
UnitTests: Replace some if(x)report_fatal_error() with EXPECT_TRUE(!x)

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

7 years agoResubmit "[llvm-pdbutil] rewrite the "raw" output style."
Zachary Turner [Thu, 15 Jun 2017 22:24:24 +0000 (22:24 +0000)]
Resubmit "[llvm-pdbutil] rewrite the "raw" output style."

This resubmits commit c0c249e9f2ef83e1d1e5f166b50673d92f3579d7.

It was broken due to some weird template issues, which have
since been fixed.

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

7 years agoRegScavenging: Add scavengeRegisterBackwards()
Matthias Braun [Thu, 15 Jun 2017 22:14:55 +0000 (22:14 +0000)]
RegScavenging: Add scavengeRegisterBackwards()

Re-apply r276044/r279124. Trying to reproduce or disprove the ppc64
problems reported in the stage2 build last time, which I cannot
reproduce right now.

This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.

This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.

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

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

7 years agodocs/Phabricator: Better git examples to produce full context patches
Matthias Braun [Thu, 15 Jun 2017 22:09:30 +0000 (22:09 +0000)]
docs/Phabricator: Better git examples to produce full context patches

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

7 years ago[InstCombine] Add two FIXMEs for bad single use checks. NFC
Craig Topper [Thu, 15 Jun 2017 21:38:48 +0000 (21:38 +0000)]
[InstCombine] Add two FIXMEs for bad single use checks. NFC

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

7 years ago[InstCombine] Add test cases to demonstrate instcombine increasing instruction count...
Craig Topper [Thu, 15 Jun 2017 21:38:44 +0000 (21:38 +0000)]
[InstCombine] Add test cases to demonstrate instcombine increasing instruction count when trying to fold (select (icmp eq (and X, C1), 0), Y, (or Y, C2))->(or (shl (and X, C1), C3), y) when the pieces have multiple uses.

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

7 years agoAdded braces to work around gcc warning in googletest: suggest explicit braces to...
Galina Kistanova [Thu, 15 Jun 2017 21:00:40 +0000 (21:00 +0000)]
Added braces to work around gcc warning in googletest: suggest explicit braces to avoid ambiguous 'else'. NFC.

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

7 years agoRevert "[llvm-pdbutil] rewrite the "raw" output style."
Zachary Turner [Thu, 15 Jun 2017 20:55:51 +0000 (20:55 +0000)]
Revert "[llvm-pdbutil] rewrite the "raw" output style."

This reverts commit 83ea17ebf2106859a51fbc2a86031b44d33696ad.

This is failing due to some strange template problems, so reverting
until it can be straightened out.

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

7 years ago[DWARF] Removed dead code. The verifier functionality is provided by
Spyridoula Gravani [Thu, 15 Jun 2017 20:40:08 +0000 (20:40 +0000)]
[DWARF] Removed dead code. The verifier functionality is provided by
the DWARFVerifier class (as it should).

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

7 years agoSplit PGO memory intrinsic optimization into its own source file
Teresa Johnson [Thu, 15 Jun 2017 20:23:57 +0000 (20:23 +0000)]
Split PGO memory intrinsic optimization into its own source file

Summary:
Split the PGOMemOPSizeOpt pass out from IndirectCallPromotion.cpp into
its own file.

Reviewers: davidxl

Subscribers: mgorny, llvm-commits

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

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

7 years agoFix some more warnings.
Zachary Turner [Thu, 15 Jun 2017 20:03:57 +0000 (20:03 +0000)]
Fix some more warnings.

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

7 years agoFix some -Wreorder issues.
Zachary Turner [Thu, 15 Jun 2017 19:45:25 +0000 (19:45 +0000)]
Fix some -Wreorder issues.

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

7 years ago[llvm-pdbutil] rewrite the "raw" output style.
Zachary Turner [Thu, 15 Jun 2017 19:34:41 +0000 (19:34 +0000)]
[llvm-pdbutil] rewrite the "raw" output style.

After some internal discussions, we agreed that the raw output style had
outlived its usefulness. It was originally created before we had even
thought of dumping to YAML, and it was intended to give us some insight
into the internals of a PDB file. Now we have YAML mode which does
almost exactly this but is more powerful in that it can round-trip back
to a PDB, which the raw mode could not do. So the raw mode had become
purely a maintenance burden.

One option was to just delete it. However, its original goal was to be
as readable as possible while staying close to the "metal" - i.e.
presenting the output in a way that maps directly to the underlying file
format. We don't actually need that last requirement anymore since it's
covered by the yaml mode, so we could repurpose "raw" mode to actually
just be as readable as possible.

This patch implements about 80% of the functionality previously in raw
mode, but in a completely different style that is more akin to what
cvdump outputs. Records are very compressed, often times appearing on
just one line. One nice thing about this is that it makes full record
matching easier, because you can grep for indices, names, and leaf types
on a single line often.

See the tests for some examples of what the new output looks like.

Note that this patch actually regresses the functionality of raw mode in
a few areas, but only because the patch was already unreasonably large
and going 100% would have been even worse. Specifically, this patch is
missing:

The ability to dump module debug subsections (checksums, lines, etc)
The ability to dump section headers
Aside from that everything is here. While goign through the tests fixing
them all up, I found many duplicate tests. They've been deleted. In
subsequent patches I will go through and re-add the missing
functionality.

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

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

7 years agoDivergencyAnalysis patch for review
Alexander Timofeev [Thu, 15 Jun 2017 19:33:10 +0000 (19:33 +0000)]
DivergencyAnalysis patch for review

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

7 years ago[InstCombine] Make the context instruction parameter of foldOrOfICmps a reference...
Craig Topper [Thu, 15 Jun 2017 19:09:51 +0000 (19:09 +0000)]
[InstCombine] Make the context instruction parameter of foldOrOfICmps a reference to discourage passing nullptr and to remove the '&' from all of the call sites. NFC

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

7 years ago[InstCombine] Pre-commit test cases for the transform proposed in D34244.
Craig Topper [Thu, 15 Jun 2017 18:56:05 +0000 (18:56 +0000)]
[InstCombine] Pre-commit test cases for the transform proposed in D34244.

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

7 years ago[MachineLICM] Hoist TOC-based address instructions
Lei Huang [Thu, 15 Jun 2017 18:29:59 +0000 (18:29 +0000)]
[MachineLICM] Hoist TOC-based address instructions

Add condition for MachineLICM to safely hoist instructions that utilize
non constant registers that are reserved.

On PPC, global variable access is done through the table of contents (TOC)
which is always in register X2.  The ABI reserves this register in any
functions that have calls or access global variables.

A call through a function pointer involves saving, changing and restoring
this register around the call and thus MachineLICM does not consider it to
be invariant. We can however guarantee the register is preserved across the
call and thus is invariant.

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

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

7 years agoFold variable into assert.
Benjamin Kramer [Thu, 15 Jun 2017 17:58:24 +0000 (17:58 +0000)]
Fold variable into assert.

Silences an unused variable warning in Release builds.

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

7 years ago[InstCombine] Handle (iszero(A & K1) | iszero(A & K2)) -> (A & (K1 | K2)) != (K1...
Craig Topper [Thu, 15 Jun 2017 17:55:20 +0000 (17:55 +0000)]
[InstCombine] Handle (iszero(A & K1) | iszero(A & K2)) -> (A & (K1 | K2)) != (K1 | K2) when the one of the Ands is commuted relative to the other

Currently we expect A to be on the same side in both Ands but nothing guarantees that.

While there also switch to using matchers for some of the code.

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

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

7 years agoSilence warning with assertions disabled.
Peter Collingbourne [Thu, 15 Jun 2017 17:41:32 +0000 (17:41 +0000)]
Silence warning with assertions disabled.

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

7 years agoISel: Fix FastISel of swifterror values
Arnold Schwaighofer [Thu, 15 Jun 2017 17:34:42 +0000 (17:34 +0000)]
ISel: Fix FastISel of swifterror values

The code assumed that we process instructions in basic block order.  FastISel
processes instructions in reverse basic block order. We need to pre-assign
virtual registers before selecting otherwise we get def-use relationships wrong.

This only affects code with swifterror registers.

rdar://32659327

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

7 years ago[BasicAA] Add test case that goes with r305481.
Craig Topper [Thu, 15 Jun 2017 17:27:56 +0000 (17:27 +0000)]
[BasicAA] Add test case that goes with r305481.

Forgot to 'git add' the file.

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

7 years agoApply summary-based dead stripping to regular LTO modules with summaries.
Peter Collingbourne [Thu, 15 Jun 2017 17:26:13 +0000 (17:26 +0000)]
Apply summary-based dead stripping to regular LTO modules with summaries.

If a regular LTO module has a summary index, then instead of linking
it into the combined regular LTO module right away, add it to the
combined summary index and associate it with a special module that
represents the combined regular LTO module.

Any such modules are linked during LTO::run(), at which time we use
the results of summary-based dead stripping to control whether to
link prevailing symbols.

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

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

7 years ago[BasicAA] Don't call isKnownNonEqual if we might be have gone through a PHINode.
Craig Topper [Thu, 15 Jun 2017 17:16:56 +0000 (17:16 +0000)]
[BasicAA] Don't call isKnownNonEqual if we might be have gone through a PHINode.

This is a fix for the test case in PR32314.

Basic Alias Analysis can ask if two nodes are known non-equal after looking through a phi node to find a GEP. isAddOfNonZero saw an add of a constant from the same phi and said that its output couldn't be equal. But Basic Alias Analysis was really asking about the value from the previous loop iteration.

This patch at least makes that case not happen anymore, I'm not sure if there were still other ways this can fail. As was discussed in the bug, it looks like fixing BasicAA would be difficult so this patch seemed like a possible workaround

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

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

7 years ago[PowerPC] fix potential verification errors on CFENCE8
Hiroshi Inoue [Thu, 15 Jun 2017 16:51:28 +0000 (16:51 +0000)]
[PowerPC] fix potential verification errors on CFENCE8

This patch fixes a potential verification error (64-bit register operands for cmpw) with -verify-machineinstrs.

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

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

7 years ago[mips] Fix documentation of member variable. NFCI.
Simon Dardis [Thu, 15 Jun 2017 16:28:28 +0000 (16:28 +0000)]
[mips] Fix documentation of member variable. NFCI.

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

7 years ago[DAG] As StoreMerge now generates only legal nodes remove unecessary guard when run...
Nirav Dave [Thu, 15 Jun 2017 16:27:49 +0000 (16:27 +0000)]
[DAG] As StoreMerge now generates only legal nodes remove unecessary guard when run post-legalization NFCI.

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

7 years agoRemove trailing whitespace. NFCI.
Simon Pilgrim [Thu, 15 Jun 2017 16:20:27 +0000 (16:20 +0000)]
Remove trailing whitespace. NFCI.

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

7 years ago[Doc] Document prof metadata in LangRef
Teresa Johnson [Thu, 15 Jun 2017 15:57:12 +0000 (15:57 +0000)]
[Doc] Document prof metadata in LangRef

Summary:
Points to existing documentation for branch_weights and
function_entry_count, and adds an example for VP value profile metadata.

Reviewers: davidxl, reames

Subscribers: llvm-commits

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

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

7 years ago[InstCombine] auto-generate complete checks; NFC
Sanjay Patel [Thu, 15 Jun 2017 15:13:19 +0000 (15:13 +0000)]
[InstCombine] auto-generate complete checks; NFC

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

7 years ago[DAG] Defer Pre/Post IndexStore merge to after mergestore. NFCI.
Nirav Dave [Thu, 15 Jun 2017 15:05:48 +0000 (15:05 +0000)]
[DAG] Defer Pre/Post IndexStore merge to after mergestore. NFCI.

In preparation for doing storemerge post-legalization, reorder
visitSTORE passes to move pre/post-index combining after store
merge. Reordered passes other than store merge are unaffected.

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

7 years ago[X86][AVX2] Fix issue in lowerV8I16GeneralSingleInputVectorShuffle that was assuming...
Simon Pilgrim [Thu, 15 Jun 2017 14:52:30 +0000 (14:52 +0000)]
[X86][AVX2] Fix issue in lowerV8I16GeneralSingleInputVectorShuffle that was assuming v8i16 vectors

We can use this with v16i16/v32i16 as well.

Found during fuzz testing.

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

7 years ago[AArch64] Add indexed check to splitStores. NFC.
Nirav Dave [Thu, 15 Jun 2017 14:47:44 +0000 (14:47 +0000)]
[AArch64] Add indexed check to splitStores. NFC.

Add explicit check for unhandled cases in preparation for delaying
splitStores to post-legalization.

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

7 years agoRevert r305465: [X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove...
Simon Pilgrim [Thu, 15 Jun 2017 14:39:34 +0000 (14:39 +0000)]
Revert r305465: [X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).

This is causing windows buildbot failures

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

7 years ago[DAG] Allow truncated and extend memory operations in Store Merge. NFCI.
Nirav Dave [Thu, 15 Jun 2017 14:04:07 +0000 (14:04 +0000)]
[DAG] Allow truncated and extend memory operations in Store Merge. NFCI.

As all store merges checks are based on the memory operation
performed, allow use of truncated stores and extended loads as valid
input candidates for merging.

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

7 years ago[DAG] Make MergeStores generate legalized stores. NFCI.
Nirav Dave [Thu, 15 Jun 2017 13:34:54 +0000 (13:34 +0000)]
[DAG] Make MergeStores generate legalized stores. NFCI.

Realized merged stores as truncstores if store will be realized as
such by legalization.

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

7 years ago[DAG] Use correct size for truncated store merge of load. NFCI.
Nirav Dave [Thu, 15 Jun 2017 13:28:06 +0000 (13:28 +0000)]
[DAG] Use correct size for truncated store merge of load. NFCI.

Avoid non-legal memory ops by checking correct size when merging
stores of loads into a extload-truncstore pair.

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

7 years ago[X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift...
Ayman Musa [Thu, 15 Jun 2017 13:02:37 +0000 (13:02 +0000)]
[X86][AVX512] Improve lowering of AVX512 compare intrinsics (remove redundant shift left+right instructions).

AVX512 compare instructions return v*i1 types.
In cases where the number of elements in the returned value are less than 8, clang adds zeroes to get a mask of v8i1 type.
Later on it's replaced with CONCAT_VECTORS, which then is lowered to many DAG nodes including insert/extract element and shift right/left nodes.
The fact that AVX512 compare instructions put the result in a k register and zeroes all its upper bits allows us to remove the extra nodes simply by copying the result to the required register class.

When lowering, identify these cases and transform them into an INSERT_SUBVECTOR node (marked legal), then catch this pattern in instructions selection phase and transform it into one avx512 cmp instruction.

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

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

7 years ago[ScalarEvolution] Apply Depth limit to getMulExpr
Max Kazantsev [Thu, 15 Jun 2017 11:48:21 +0000 (11:48 +0000)]
[ScalarEvolution] Apply Depth limit to getMulExpr

This is a fix for PR33292 that shows a case of extremely long compilation
of a single .c file with clang, with most time spent within SCEV.

We have a mechanism of limiting recursion depth for getAddExpr to avoid
long analysis in SCEV. However, there are calls from getAddExpr to getMulExpr
and back that do not propagate the info about depth. As result of this, a chain

  getAddExpr -> ... .> getAddExpr -> getMulExpr -> getAddExpr -> ... -> getAddExpr

can be extremely long, with every segment of getAddExpr's being up to max depth long.
This leads either to long compilation or crash by stack overflow. We face this situation while
analyzing big SCEVs in the test of PR33292.

This patch applies the same limit on max expression depth for getAddExpr and getMulExpr.

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

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

7 years ago[ARM] GlobalISel: Add support for i32 modulo
Diana Picus [Thu, 15 Jun 2017 10:53:31 +0000 (10:53 +0000)]
[ARM] GlobalISel: Add support for i32 modulo

Add support for modulo for targets that have hardware division and for
those that don't. When hardware division is not available, we have to
choose the correct libcall to use. This is generally straightforward,
except for AEABI.

The AEABI variant is trickier than the other libcalls because it
returns { quotient, remainder }, instead of just one value like the
other libcalls that we've seen so far. Therefore, we need to use custom
lowering for it. However, we don't want to have too much special code,
so we refactor the target-independent code in the legalizer by adding a
helper for replacing an instruction with a libcall. This helper is used
by the legalizer itself when dealing with simple calls, and also by the
custom ARM legalization for the more complicated AEABI divmod calls.

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

7 years ago[ARM] GlobalISel: Lower only homogeneous struct args
Diana Picus [Thu, 15 Jun 2017 09:42:02 +0000 (09:42 +0000)]
[ARM] GlobalISel: Lower only homogeneous struct args

Lowering mixed struct args, params and returns used G_INSERT, which is a
bit more convoluted to support through the entire pipeline. Since they
don't occur that often in practice, it's probably wiser to leave them
out until later.

Meanwhile, we can lower homogeneous structs using G_MERGE_VALUES, which
has good support in the legalizer. These occur e.g. as the return of
__aeabi_idivmod, so it's nice to be able to support them.

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

7 years ago[AArch64] Enable FeatureFuseAES for the generic processor model.
Florian Hahn [Thu, 15 Jun 2017 09:31:23 +0000 (09:31 +0000)]
[AArch64] Enable FeatureFuseAES for the generic processor model.

Summary:
Scheduling AESE/AESMC and AESD/AESIMC instruction pairs back-to-back
gives a double digit speedup on benchmarks using those instructions on
Cortex-A processors. In GCC, this optimization is part of the generic
processor model as well.

This change should not have a major performance impact on processors
that do not optimize AES instruction pairs, although I only had access
to Cortex-A processors for benchmarking.

Reviewers: rengolin, kristof.beyls, javed.absar, evandro, silviu.baranga, MatzeB, mcrosier, joelkevinjones, joel_k_jones, bmakam, t.p.northover

Reviewed By: evandro

Subscribers: sbaranga, aemerson, llvm-commits

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

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

7 years ago[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Zoran Jovanovic [Thu, 15 Jun 2017 09:14:33 +0000 (09:14 +0000)]
[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
The following instructions are examined and transformed, if possible:
ADDIU instruction is transformed into 16-bit instruction ADDIUSP
ADDIU instruction is transformed into 16-bit instruction ADDIUR1SP
Differential Revision: https://reviews.llvm.org/D33887

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

7 years ago[formatv] Add the ability to specify a fill character when aligning.
Zachary Turner [Thu, 15 Jun 2017 03:06:38 +0000 (03:06 +0000)]
[formatv] Add the ability to specify a fill character when aligning.

Previously if you used fmt_align(7, Center) you would get the
output '   7   '.  It may be desirable for the user to specify
the fill character though, for example producing '---7---'.  This
patch adds that.

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

7 years ago[InstCombine] Add a test case to show a case where don't handle a partially commuted...
Craig Topper [Thu, 15 Jun 2017 01:01:01 +0000 (01:01 +0000)]
[InstCombine] Add a test case to show a case where don't handle a partially commuted IR. NFC

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

7 years agoRemoval of accidental duplication in test assembly file. NFC.
Wolfgang Pieb [Wed, 14 Jun 2017 23:55:39 +0000 (23:55 +0000)]
Removal of accidental duplication in test assembly file. NFC.

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

7 years ago[DWARF] Minor coding style modifications, no functionality change.
Spyridoula Gravani [Wed, 14 Jun 2017 23:40:26 +0000 (23:40 +0000)]
[DWARF] Minor coding style modifications, no functionality change.

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

7 years agoFixing section name for Darwin platforms for sanitizer coverage
George Karpenkov [Wed, 14 Jun 2017 23:40:25 +0000 (23:40 +0000)]
Fixing section name for Darwin platforms for sanitizer coverage

On Darwin, section names have a 16char length limit.

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

7 years agoIR: Tweak the API around adding modules to the summary index.
Peter Collingbourne [Wed, 14 Jun 2017 22:35:27 +0000 (22:35 +0000)]
IR: Tweak the API around adding modules to the summary index.

The current name (addModulePath) and return value
(ModulePathStringTableTy::iterator) is a little confusing. This
API adds a module, not just a path. And the iterator is basically
just an implementation detail of the summary index. Address
both of those issues by renaming to addModule and introducing a
ModuleSummaryIndex::ModuleInfo type that the function returns.

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

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

7 years agoDon't include TestingSupport in LLVM_LINK_COMPONENTS.
Zachary Turner [Wed, 14 Jun 2017 22:33:43 +0000 (22:33 +0000)]
Don't include TestingSupport in LLVM_LINK_COMPONENTS.

Instead use target_link_libraries directly.  Thanks to
Juergen Ributzka for the suggestion, which fixes an issue
when llvm is configured with no targets.

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

7 years ago[ADT] Partial re-commit of r303383. Fix some Clang-tidy modernize-use-using and Inclu...
Eugene Zelenko [Wed, 14 Jun 2017 21:42:24 +0000 (21:42 +0000)]
[ADT] Partial re-commit of r303383. Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

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

7 years agoPredicateInfo: Don't insert conditional info when a conditional branch jumps to the...
Daniel Berlin [Wed, 14 Jun 2017 21:19:52 +0000 (21:19 +0000)]
PredicateInfo: Don't insert conditional info when a conditional branch jumps to the same target regardless of condition

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

7 years agoNewGVN: This is wrong by inspection, it will not cause an issue currently due to...
Daniel Berlin [Wed, 14 Jun 2017 21:19:28 +0000 (21:19 +0000)]
NewGVN: This is wrong by inspection, it will not cause an issue currently due to other limitations, i believe.  This also means i can't make a test for it.

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

7 years ago[x86] avoid unnecessary shuffle mask math in combineX86ShufflesRecursively()
Sanjay Patel [Wed, 14 Jun 2017 20:37:11 +0000 (20:37 +0000)]
[x86] avoid unnecessary shuffle mask math in combineX86ShufflesRecursively()

This is a follow-up to https://reviews.llvm.org/D34174 / https://reviews.llvm.org/rL305398.

We mentioned replacing the multiplies with shifts, but the real win seems to be in
bypassing the extra ops in the common case when the RootRatio and OpRatio are one.

This gives us another 1-2% overall win for the test in PR32037:
https://bugs.llvm.org/show_bug.cgi?id=32037

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

7 years agoAllow -profile-guided-section-prefix more than once
David Callahan [Wed, 14 Jun 2017 20:35:33 +0000 (20:35 +0000)]
Allow -profile-guided-section-prefix more than once

Summary:
At present, `-profile-guided-section-prefix` is a `cl::Optional` option, which means it demands to be passed exactly zero or one times.  Our build system makes it pretty tricky to guarantee this.  We often accidentally pass the flag more than once (but always with the same "false" value) which results in an error, after which compilation fails:

```
clang (LLVM option parsing): for the -profile-guided-section-prefix option: may only occur zero or one times!
```

While we work on improving our build system, it also seems reasonable just to allow `-profile-guided-section-prefix` to be passed more than once, by to `cl::ZeroOrMore`.  Quoting [[ http://llvm.org/docs/CommandLine.html#controlling-the-number-of-occurrences-required-and-allowed | the documentation ]]:

> The cl::ZeroOrMore modifier ... indicates that your program will allow the option to be specified zero or more times.
> ...
> If an option is specified multiple times for an option of the cl::opt class, only the last value will be retained.

Reviewers: danielcdh

Reviewed By: danielcdh

Subscribers: twoh, david2050, llvm-commits

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

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

7 years ago[StringExtras] overload toHex for ArrayRef<uint8_t>
Zachary Turner [Wed, 14 Jun 2017 20:11:46 +0000 (20:11 +0000)]
[StringExtras] overload toHex for ArrayRef<uint8_t>

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

7 years ago[EarlyCSE] Make PhiToCheck in removeMSSA() a set.
Davide Italiano [Wed, 14 Jun 2017 19:29:53 +0000 (19:29 +0000)]
[EarlyCSE] Make PhiToCheck in removeMSSA() a set.

This way we end up not looking at PHI args already removed.
MemSSA now goes through the updater so we can prune
it to avoid having redundant MemoryPHI arguments, but that
doesn't quite work for the general case.

Discussed with Daniel Berlin, fixes PR33406.

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

7 years agoHide dbgs() stream for when built with -fmodules.
Frederich Munch [Wed, 14 Jun 2017 19:16:22 +0000 (19:16 +0000)]
Hide dbgs() stream for when built with -fmodules.

Summary: Make DebugCounter::print and dump methods to be const correct.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: llvm-commits

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

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

7 years agoMC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table.
Peter Collingbourne [Wed, 14 Jun 2017 18:52:12 +0000 (18:52 +0000)]
MC, Object: Reserve a section type, SHT_LLVM_ODRTAB, for the ODR table.

This is part of the ODR checker proposal:
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113820.html

Per discussion on the gnu-gabi mailing list [1] the section type range
0x6fff4c00..0x6fff4cff is reserved for LLVM.

[1] https://sourceware.org/ml/gnu-gabi/2017-q2/msg00030.html

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

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

7 years agoSpecified ReportError as noreturn friendly to old compilers.
Galina Kistanova [Wed, 14 Jun 2017 17:32:53 +0000 (17:32 +0000)]
Specified ReportError as noreturn friendly to old compilers.

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

7 years agoSupressed warning: declared ‘static’ but never defined.
Galina Kistanova [Wed, 14 Jun 2017 17:30:35 +0000 (17:30 +0000)]
Supressed warning: declared ‘static’ but never defined.

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

7 years agoTest commit - NFC.
Lei Huang [Wed, 14 Jun 2017 17:25:55 +0000 (17:25 +0000)]
Test commit - NFC.

Modified a comment to confirm commit access functionality.

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

7 years ago[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non...
Craig Topper [Wed, 14 Jun 2017 17:04:59 +0000 (17:04 +0000)]
[ValueTracking] Correct early out in computeKnownBitsFromOperator to work with non power of 2 bit widths

There's an early out that's trying to detect when we don't know any bits that make up the legal range of a shift. The code subtracts one from BitWidth which creates a mask in the lower bits for power of 2 bit widths. This is then ANDed with the known bits to see if any of those bits are known. If the bit width isn't a power of 2 this creates a non-sensical mask.

This patch corrects this by rounding up to a power of 2 before doing the subtract and mask.

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

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

7 years ago[x86] replace div/rem with shift/mask for better shuffle combining perf
Sanjay Patel [Wed, 14 Jun 2017 17:00:57 +0000 (17:00 +0000)]
[x86] replace div/rem with shift/mask for better shuffle combining perf

We know that shuffle masks are power-of-2 sizes, but there's no way (?) for LLVM to know that,
so hack combineX86ShufflesRecursively() to be much faster by replacing div/rem with shift/mask.

This makes the motivating compile-time bug in PR32037 ( https://bugs.llvm.org/show_bug.cgi?id=32037 )
about 9% faster overall.

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

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