]> granicus.if.org Git - llvm/log
llvm
7 years agoAllow truncated and extend memory operations in Store Merge. NFCI.
Nirav Dave [Mon, 19 Jun 2017 15:32:28 +0000 (15:32 +0000)]
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.

Relanding after fixing selection between truncated and normal store.

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

7 years ago[JumpThreading][LVI] Invalidate LVI information after blocks are merged
Anna Thomas [Mon, 19 Jun 2017 15:23:33 +0000 (15:23 +0000)]
[JumpThreading][LVI] Invalidate LVI information after blocks are merged

Summary:
After a single predecessor is merged into a basic block, we need to invalidate
the LVI information for the new merged block, when LVI is not provably true for
all of instructions in the new block.
The test cases added show the correct LVI information using the LVI printer
pass.

Reviewers: reames, dberlin, davide, sanjoy

Reviewed by: dberlin, davide

Subscribers: llvm-commits

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

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

7 years ago[TRE] Improve code motion in TRE, use AA to tell whether a load can be moved before...
Xin Tong [Mon, 19 Jun 2017 15:21:18 +0000 (15:21 +0000)]
[TRE] Improve code motion in TRE, use AA to tell whether a load can be moved before a call that writes to memory.

Summary: use AA to tell whether a load can be moved before a call that writes to memory.

Reviewers: dberlin, davide, sanjoy, hfinkel

Reviewed By: hfinkel

Subscribers: hfinkel, llvm-commits

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

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

7 years agoAdd test for store merge with noimplicitfloat
Nirav Dave [Mon, 19 Jun 2017 15:18:20 +0000 (15:18 +0000)]
Add test for store merge with noimplicitfloat

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

7 years ago[AArch64] Fix order of checks in shouldScheduleAdjacent.
Florian Hahn [Mon, 19 Jun 2017 13:45:41 +0000 (13:45 +0000)]
[AArch64] Fix order of checks in shouldScheduleAdjacent.

We need to check the opcode of FirstMI before accessing the operands. This
caused a buildbot failure during bootstrapping on AArch64.

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

7 years agoUse range for loops. NFCI.
Simon Pilgrim [Mon, 19 Jun 2017 13:24:12 +0000 (13:24 +0000)]
Use range for loops. NFCI.

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

7 years agoAMDGPU/GlobalISel: Mark G_BITCAST s32 <--> <2 x s16> legal
Tom Stellard [Mon, 19 Jun 2017 13:15:45 +0000 (13:15 +0000)]
AMDGPU/GlobalISel: Mark G_BITCAST s32 <--> <2 x s16> legal

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits

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

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

7 years ago[GlobalISel][X86] Fold FI/G_GEP into LDR/STR instruction addressing mode.
Igor Breger [Mon, 19 Jun 2017 13:12:57 +0000 (13:12 +0000)]
[GlobalISel][X86] Fold FI/G_GEP into LDR/STR instruction addressing mode.

Summary: Implement some of the simplest addressing modes.It should help to test ABI.

Reviewers: zvi, guyblank

Reviewed By: guyblank

Subscribers: rovka, llvm-commits, kristof.beyls

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

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

7 years agoRecommit rL305677: [CodeGen] Add generic MacroFusion pass
Florian Hahn [Mon, 19 Jun 2017 12:53:31 +0000 (12:53 +0000)]
Recommit rL305677: [CodeGen] Add generic MacroFusion pass

Use llvm::make_unique to avoid ambiguity with MSVC.

This patch adds a generic MacroFusion pass, that is used on X86 and
AArch64, which both define target-specific shouldScheduleAdjacent
functions. This generic pass should make it easier for other targets to
implement macro fusion and I intend to add macro fusion for ARM shortly.

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

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

7 years ago[ARM] GlobalISel: Support G_ICMP for s8 and s16
Diana Picus [Mon, 19 Jun 2017 11:47:28 +0000 (11:47 +0000)]
[ARM] GlobalISel: Support G_ICMP for s8 and s16

Widen to s32 (like all other binary ops).

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

7 years agoRevert r305677 [CodeGen] Add generic MacroFusion pass.
Florian Hahn [Mon, 19 Jun 2017 11:26:15 +0000 (11:26 +0000)]
Revert r305677 [CodeGen] Add generic MacroFusion pass.

This causes Windows buildbot failures do an ambiguous call.

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

7 years ago[CodeGen] Add generic MacroFusion pass.
Florian Hahn [Mon, 19 Jun 2017 10:51:38 +0000 (10:51 +0000)]
[CodeGen] Add generic MacroFusion pass.

Summary:
This patch adds a generic MacroFusion pass, that is used on X86 and
AArch64, which both define target-specific shouldScheduleAdjacent
functions. This generic pass should make it easier for other targets to
implement macro fusion and I intend to add macro fusion for ARM shortly.

Reviewers: craig.topper, evandro, t.p.northover, atrick, MatzeB

Reviewed By: MatzeB

Subscribers: atrick, aemerson, mgorny, javed.absar, kristof.beyls, llvm-commits

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

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

7 years ago[ARM] GlobalISel: Support G_ICMP for i32 and pointers
Diana Picus [Mon, 19 Jun 2017 09:40:51 +0000 (09:40 +0000)]
[ARM] GlobalISel: Support G_ICMP for i32 and pointers

Add support throughout the pipeline:
- mark as legal for s32 and pointers
- map to GPRs
- lower to a sequence of instructions, which moves 0 or 1 into the
  result register based on the flags set by a CMPrr

We have copied from FastISel a helper function which maps CmpInst
predicates into ARMCC codes. Ideally, we should be able to move it
somewhere that both FastISel and GlobalISel can use.

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

7 years ago[X86] Simplify vector-shuffle-v48 test. NFC.
Guy Blank [Mon, 19 Jun 2017 08:58:13 +0000 (08:58 +0000)]
[X86] Simplify vector-shuffle-v48 test. NFC.

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

7 years ago[SCEV] Teach SCEVExpander to expand BinPow
Max Kazantsev [Mon, 19 Jun 2017 06:24:53 +0000 (06:24 +0000)]
[SCEV] Teach SCEVExpander to expand BinPow

Current implementation of SCEVExpander demonstrates a very naive behavior when
it deals with power calculation. For example, a SCEV for x^8 looks like

  (x * x * x * x * x * x * x * x)

If we try to expand it, it generates a very straightforward sequence of muls, like:

  x2 = mul x, x
  x3 = mul x2, x
  x4 = mul x3, x
      ...
  x8 = mul x7, x

This is a non-efficient way of doing that. A better way is to generate a sequence of
binary power calculation. In this case the expanded calculation will look like:

  x2 = mul x, x
  x4 = mul x2, x2
  x8 = mul x4, x4

In some cases the code size reduction for such SCEVs is dramatic. If we had a loop:

  x = a;
  for (int i = 0; i < 3; i++)
    x = x * x;

And this loop have been fully unrolled, we have something like:

  x = a;
  x2 = x * x;
  x4 = x2 * x2;
  x8 = x4 * x4;

The SCEV for x8 is the same as in example above, and if we for some reason
want to expand it, we will generate naively 7 multiplications instead of 3.
The BinPow expansion algorithm here allows to keep code size reasonable.

This patch teaches SCEV Expander to generate a sequence of BinPow multiplications
if we have repeating arguments in SCEVMulExpressions.

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

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

7 years ago[Doc] Fix getelementptr description about arguments
David Blaikie [Mon, 19 Jun 2017 05:34:21 +0000 (05:34 +0000)]
[Doc] Fix getelementptr description about arguments

Section "Arguments" of `getelementptr` [1] says the first argument is a
type, the second argument is a pointer or a vector of pointers, and is
the base address to start from. Update `getelementptr` FAQ [2]
accordingly, based on discussion with David on the mailing list [3].

[1] http://llvm.org/docs/LangRef.html#getelementptr-instruction
[2] http://llvm.org/docs/GetElementPtr.html
[3] http://lists.llvm.org/pipermail/llvm-dev/2017-June/114294.html

Patch by Wei-Ren Chen!

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

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

7 years agoNewGVN: Fix PR 33461, caused by slightly overzealous verification.
Daniel Berlin [Mon, 19 Jun 2017 00:24:00 +0000 (00:24 +0000)]
NewGVN: Fix PR 33461, caused by slightly overzealous verification.

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

7 years ago[x86] specify triples and auto-generate complete checks; NFC
Sanjay Patel [Sun, 18 Jun 2017 21:48:44 +0000 (21:48 +0000)]
[x86] specify triples and auto-generate complete checks; NFC

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

7 years ago[x86] specify triples and auto-generate complete checks; NFC
Sanjay Patel [Sun, 18 Jun 2017 21:42:19 +0000 (21:42 +0000)]
[x86] specify triples and auto-generate complete checks; NFC

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

7 years ago[x86] specify triple and auto-generate checks; NFC
Sanjay Patel [Sun, 18 Jun 2017 21:30:57 +0000 (21:30 +0000)]
[x86] specify triple and auto-generate checks; NFC

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

7 years agoDelete TypeDatabase.
Zachary Turner [Sun, 18 Jun 2017 20:52:45 +0000 (20:52 +0000)]
Delete TypeDatabase.

Merge the functionality into the random access type collection.
This class was only being used in 2 places, so getting rid of it
simplifies the code.

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

7 years ago[APFloat] Move the integerPartWidth constant into APFloatBase. Remove integerPart...
Craig Topper [Sun, 18 Jun 2017 18:15:41 +0000 (18:15 +0000)]
[APFloat] Move the integerPartWidth constant into APFloatBase. Remove integerPart typedef at file scope and just use the one in APFloatBase everywhere. NFC

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

7 years ago[Reassociate] Use APInt::isNullValue() instead of comparing with 0. NFC
Craig Topper [Sun, 18 Jun 2017 18:15:38 +0000 (18:15 +0000)]
[Reassociate] Use APInt::isNullValue() instead of comparing with 0. NFC

This should compile to slightly better code.

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

7 years agoImplement AllocateRWX and ReleaseRWX for NetBSD
Kamil Rytarowski [Sun, 18 Jun 2017 16:52:32 +0000 (16:52 +0000)]
Implement AllocateRWX and ReleaseRWX for NetBSD

Summary:
NetBSD ships with PaX MPROTECT disallowing RWX mappings.
There is a solution to bypass this restriction with double mapping
RX (code) and RW (data) using mremap(2) MAP_REMAPDUP.
The initial mapping must be mmap(2)ed with protection:
PROT_MPROTECT(PROT_EXEC).

This functionality to bypass PaX MPROTECT appeared in NetBSD-7.99.72.

This patch fixes 20 failing tests:
-    LLVM :: DebugInfo/debuglineinfo-macho.test
-    LLVM :: DebugInfo/debuglineinfo.test
-    LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/COFF_i386.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/COFF_x86_64.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_STT_FILE.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PC8_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_debug_frame.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86_64_StubBuf.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_i386_eh_frame.s
-    LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, lhames

Reviewed By: joerg

Subscribers: sdardis, llvm-commits, arichardson

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

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

7 years agox86] adjust test constants to maintain coverage; NFC
Sanjay Patel [Sun, 18 Jun 2017 14:45:23 +0000 (14:45 +0000)]
x86] adjust test constants to maintain coverage; NFC

Increment (add 1) could be transformed to sub -1, and we'd lose coverage for these patterns.

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

7 years ago[x86] adjust test constants to maintain coverage; NFC
Sanjay Patel [Sun, 18 Jun 2017 14:23:47 +0000 (14:23 +0000)]
[x86] adjust test constants to maintain coverage; NFC

Increment (add 1) could be transformed to sub -1, and we'd lose coverage for these patterns.

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

7 years ago[x86] adjust test constants to maintain coverage; NFC
Sanjay Patel [Sun, 18 Jun 2017 14:01:32 +0000 (14:01 +0000)]
[x86] adjust test constants to maintain coverage; NFC

Increment (add 1) could be transformed to sub -1, and we'd lose coverage for these patterns.

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

7 years agoRevert r305642
Ismail Donmez [Sun, 18 Jun 2017 10:15:57 +0000 (10:15 +0000)]
Revert r305642

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

7 years agoTest to correct triple for SUSE on ARMv7
Ismail Donmez [Sun, 18 Jun 2017 10:00:59 +0000 (10:00 +0000)]
Test to correct triple for SUSE on ARMv7

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

7 years agoAdd argmononly attribute to strlen and wcslen, i.e. they only read memory (string...
Xin Tong [Sun, 18 Jun 2017 03:10:26 +0000 (03:10 +0000)]
Add argmononly attribute to strlen and wcslen, i.e. they only read memory (string) passed to them.

Summary:
This allows strlen to be moved out of the loop in case its argument is
not modified in the loop in LICM.

Reviewers: hfinkel, davide, sanjoy, dberlin

Subscribers: llvm-commits

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

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

7 years agoFixed the warning introduced by r305625 to make ubuntu-gcc7.1-werror bot green.
Galina Kistanova [Sat, 17 Jun 2017 21:05:28 +0000 (21:05 +0000)]
Fixed the warning introduced by r305625 to make ubuntu-gcc7.1-werror bot green.

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

7 years ago[SROA] Add support for non-integral pointers
Sanjoy Das [Sat, 17 Jun 2017 20:28:13 +0000 (20:28 +0000)]
[SROA] Add support for non-integral pointers

Summary: C.f. http://llvm.org/docs/LangRef.html#non-integral-pointer-type

Reviewers: chandlerc, loladiro

Reviewed By: loladiro

Subscribers: reames, loladiro, mcrosier, llvm-commits

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

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

7 years ago[TRE] Add assertion for folding trivial return block
Xin Tong [Sat, 17 Jun 2017 16:55:12 +0000 (16:55 +0000)]
[TRE] Add assertion for folding trivial return block

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

7 years ago[TRE] Update comments. NFC
Xin Tong [Sat, 17 Jun 2017 16:18:36 +0000 (16:18 +0000)]
[TRE] Update comments. NFC

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

7 years ago[CMake] Get rid of generating obj.*-tblgen if CMake >= 3.9 for Ninja generator.
NAKAMURA Takumi [Sat, 17 Jun 2017 13:45:55 +0000 (13:45 +0000)]
[CMake] Get rid of generating obj.*-tblgen if CMake >= 3.9 for Ninja generator.

CMake-3.9 doesn't let compilation units depend on their dependent libraries.

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

7 years ago[CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override LLVM_DEFAULT_TARGET...
NAKAMURA Takumi [Sat, 17 Jun 2017 03:19:08 +0000 (03:19 +0000)]
[CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override LLVM_DEFAULT_TARGET_TRIPLE at runtime.

No behavior is changed if LLVM_TARGET_TRIPLE_ENV is blank or undefined.

If LLVM_TARGET_TRIPLE_ENV is "TEST_TARGET_TRIPLE" and $TEST_TARGET_TRIPLE is not blank,
llvm::sys::getDefaultTargetTriple() returns $TEST_TARGET_TRIPLE.
Lit resets config.target_triple and config.environment[LLVM_TARGET_TRIPLE_ENV] to change the default target.

Without changing LLVM_DEFAULT_TARGET_TRIPLE nor rebuilding, lit can be run;

  TEST_TARGET_TRIPLE=i686-pc-win32 bin/llvm-lit -sv path/to/test/
  TEST_TARGET_TRIPLE=i686-pc-win32 ninja check-clang-tools

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

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

7 years agoRework logic and comment out the default relocation models for PPC.
Eric Christopher [Sat, 17 Jun 2017 02:25:56 +0000 (02:25 +0000)]
Rework logic and comment out the default relocation models for PPC.

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

7 years agoTurn a large if block into a smaller early return for clarity.
Eric Christopher [Sat, 17 Jun 2017 02:25:55 +0000 (02:25 +0000)]
Turn a large if block into a smaller early return for clarity.

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

7 years agoRemove the old and unused PPC32 and PPC64TargetMachine classes.
Eric Christopher [Sat, 17 Jun 2017 02:25:53 +0000 (02:25 +0000)]
Remove the old and unused PPC32 and PPC64TargetMachine classes.

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

7 years agoRemove unused forward declaration.
Eric Christopher [Sat, 17 Jun 2017 02:25:51 +0000 (02:25 +0000)]
Remove unused forward declaration.

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

7 years agoTidy up some calls to getRegister for readability.
Eric Christopher [Sat, 17 Jun 2017 02:25:49 +0000 (02:25 +0000)]
Tidy up some calls to getRegister for readability.

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

7 years agoRegScavenging: Add scavengeRegisterBackwards()
Matthias Braun [Sat, 17 Jun 2017 02:08:18 +0000 (02:08 +0000)]
RegScavenging: Add scavengeRegisterBackwards()

Re-apply r276044/r279124/r305516. Fixed a problem where we would refuse
to place spills as the very first instruciton of a basic block and thus
artifically increase pressure (test in
test/CodeGen/PowerPC/scavenging.mir:spill_at_begin)

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@305625 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PPC] Remove isBarrier from CFENCE8's definition.
Tim Shen [Sat, 17 Jun 2017 01:25:34 +0000 (01:25 +0000)]
[PPC] Remove isBarrier from CFENCE8's definition.

Summary:
This is my misunderstanding on isBarrier. It's not for memory barriers,
but for other control flow purposes. lwsync doesn't have it either.

This fixes a simple crash with -verify-machineinstrs like below:

  define void @Foo() {
  entry:
    %tmp = load atomic i64, i64* undef acquire, align 8
    unreachable
  }

I deliberately don't want to check in the test, since there is little
chance to regress on such a mistake. Such a test adds noise to the code
base.

I plan to check in first, since it fixes a crash, and the fix is obvious.

Reviewers: kbarton, echristo

Subscribers: sanjoy, nemanjai, hiraditya, llvm-commits

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

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

7 years ago[SelectionDAG] Update Loop info after splitting critical edges.
Davide Italiano [Sat, 17 Jun 2017 00:56:27 +0000 (00:56 +0000)]
[SelectionDAG] Update Loop info after splitting critical edges.

The analysis is expected to be preserved by SelectionDAG.

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

7 years ago[InstCombine] Make FPMathOperator working with ConstantExpression(s).
Davide Italiano [Sat, 17 Jun 2017 00:07:22 +0000 (00:07 +0000)]
[InstCombine] Make FPMathOperator working with ConstantExpression(s).

Fixes PR33453.

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

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

7 years agoDon't crash if a type record can't be found.
Zachary Turner [Sat, 17 Jun 2017 00:02:24 +0000 (00:02 +0000)]
Don't crash if a type record can't be found.

This was a regression introduced in a previous patch.  Adding
back the code that handles this case.

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

7 years ago[WebAssembly] Use __stack_pointer global when writing wasm binary
Sam Clegg [Fri, 16 Jun 2017 23:59:10 +0000 (23:59 +0000)]
[WebAssembly] Use __stack_pointer global when writing wasm binary

This ensures that symbolic relocations are generated for stack
pointer manipulations.

These relocations are of type R_WEBASSEMBLY_GLOBAL_INDEX_LEB.
This change also adds support for reading relocations of this
type in WasmObjectFile.cpp.

Since its a globally imported symbol this does mean that
the get_global/set_global instruction won't be valid until
the objects are linked that global used in no longer an
imported global.

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

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

7 years ago[CodeView] Fix random access of type names.
Zachary Turner [Fri, 16 Jun 2017 23:42:44 +0000 (23:42 +0000)]
[CodeView] Fix random access of type names.

Suppose we had a type index offsets array with a boundary at type index
N. Then you request the name of the type with index N+1, and that name
requires the name of index N-1 (think a parameter list, for example). We
didn't handle this, and we would print something like (<unknown UDT>,
<unknown UDT>).

The fix for this is not entirely trivial, and speaks to a larger
problem. I think we need to kill TypeDatabase, or at the very least kill
TypeDatabaseVisitor. We need a thing that doesn't do any caching
whatsoever, just given a type index it can compute the type name "the
slow way". The reason for the bug is that we don't have anything like
that. Everything goes through the type database, and if we've visited a
record, then we're "done". It doesn't know how to do the expensive thing
of re-visiting dependent records if they've not yet been visited.

What I've done here is more or less copied the code (albeit greatly
simplified) from TypeDatabaseVisitor, but wrapped it in an interface
that just returns a std::string. The logic of caching the name is now in
LazyRandomTypeCollection. Eventually I'd like to move the record
database here as well and the visited record bitfield here as well, at
which point we can actually just delete TypeDatabase. I don't see any
reason for it if a "sequential" collection is just a special case of a
random access collection with an empty partial offsets array.

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

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

7 years agoRemove some dead code / includes.
Zachary Turner [Fri, 16 Jun 2017 23:42:15 +0000 (23:42 +0000)]
Remove some dead code / includes.

I'm trying to get rid of the TypeDatabase class, so the first
step is to minimize its footprint.

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

7 years agoobj2yaml: Improve error reporting
Sam Clegg [Fri, 16 Jun 2017 23:29:54 +0000 (23:29 +0000)]
obj2yaml: Improve error reporting

Previously only the error codes were reported which
meant that useful information about malformed inputs
was not shown.

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

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

7 years agobpf: fix a strict-aliasing issue
Yonghong Song [Fri, 16 Jun 2017 23:28:04 +0000 (23:28 +0000)]
bpf: fix a strict-aliasing issue

Davide Italiano reported the following issue if llvm
is compiled with gcc -Wstrict-aliasing -Werror:
.....
lib/Target/BPF/CMakeFiles/LLVMBPFCodeGen.dir/BPFISelDAGToDAG.cpp.o
../lib/Target/BPF/BPFISelDAGToDAG.cpp: In member function â€˜virtual
void {anonymous}::BPFDAGToDAGISel::PreprocessISelDAG()’:
../lib/Target/BPF/BPFISelDAGToDAG.cpp:264:26: warning: dereferencing
type-punned pointer will break strict-aliasing rules
[-Wstrict-aliasing]
       val = *(uint16_t *)new_val;
.....

The error is caused by my previous commit (revision 305560).

This patch fixed the issue by introducing an union to avoid
type casting.

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

7 years ago[ConstantRange] Implement getSignedMin/Max in a less complicated and faster way
Craig Topper [Fri, 16 Jun 2017 23:26:23 +0000 (23:26 +0000)]
[ConstantRange] Implement getSignedMin/Max in a less complicated and faster way

Summary: As far as I can tell we should be able to implement these almost the same way we do unsigned, but using signed comparisons and checks for min signed value instead of min unsigned value.

Reviewers: pete, davide, sanjoy

Reviewed By: davide

Subscribers: llvm-commits

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

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

7 years ago[SelectionDAG] Use APInt::isSubsetOf. NFC
Craig Topper [Fri, 16 Jun 2017 23:19:14 +0000 (23:19 +0000)]
[SelectionDAG] Use APInt::isSubsetOf. NFC

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

7 years ago[SelectionDAG] Use APInt::isNullValue/isOneValue. NFC
Craig Topper [Fri, 16 Jun 2017 23:19:12 +0000 (23:19 +0000)]
[SelectionDAG] Use APInt::isNullValue/isOneValue. NFC

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

7 years ago[TargetLowering] Use ConstantSDNode::isOne and getSExtValue instead of getting the...
Craig Topper [Fri, 16 Jun 2017 23:19:10 +0000 (23:19 +0000)]
[TargetLowering] Use ConstantSDNode::isOne and getSExtValue instead of getting the underlying APInt first. NFC

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

7 years agoRevert rL305578. There is still some buildbot failure to be fixed.
Wei Mi [Fri, 16 Jun 2017 23:14:35 +0000 (23:14 +0000)]
Revert rL305578. There is still some buildbot failure to be fixed.

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

7 years agoMove testcase into the target-appropriate subdirectory.
Adrian Prantl [Fri, 16 Jun 2017 23:02:05 +0000 (23:02 +0000)]
Move testcase into the target-appropriate subdirectory.

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

7 years agoImprove the accuracy of variable ranges .debug_loc location lists.
Adrian Prantl [Fri, 16 Jun 2017 22:40:04 +0000 (22:40 +0000)]
Improve the accuracy of variable ranges .debug_loc location lists.

For the following motivating example
  bool c();
  void f();
  bool start() {
    bool result = c();
    if (!c()) {
      result = false;
      goto exit;
    }
    f();
    result = true;
  exit:
    return result;
  }

we would previously generate a single DW_AT_const_value(1) because
only the DBG_VALUE in the second-to-last basic block survived
codegen. This patch improves the heuristic used to determine when a
DBG_VALUE is available at the beginning of its variable's enclosing
lexical scope:

- Stop giving singular constants blanket permission to take over the
  entire scope. There is still a special case for constants in the
  function prologue that we also miight want to retire later.

- Use the lexical scope information to determine available-at-entry
  instead of proximity to the function prologue.

After this patch we generate a location list with a more accurate
narrower availability for the constant true value. As a pleasant side
effect, we also generate inline locations instead of location lists
where a loacation covers the entire range of the enclosing lexical
scope.

Measured on compiling llc with four targets this doesn't have an
effect on compile time and reduces the size of the debug info for llc
by ~600K.

rdar://problem/30286912

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

7 years agoutils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo.
Peter Collingbourne [Fri, 16 Jun 2017 22:15:18 +0000 (22:15 +0000)]
utils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo.

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

7 years ago[DWARF] Corrected behavior for when no .apple_names section is present in the object.
Spyridoula Gravani [Fri, 16 Jun 2017 22:03:21 +0000 (22:03 +0000)]
[DWARF] Corrected behavior for when no .apple_names section is present in the object.
The verifier should not output any message in such a case.
Added test case with no .apple_name section in the file to verify new functionality.
Made existing test case more specific.

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

7 years agoClean up some things in the WindowsResource changes.
Eric Beckmann [Fri, 16 Jun 2017 22:00:42 +0000 (22:00 +0000)]
Clean up some things in the WindowsResource changes.

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

7 years ago[Object] Remove redundant std::move.
Benjamin Kramer [Fri, 16 Jun 2017 21:27:12 +0000 (21:27 +0000)]
[Object] Remove redundant std::move.

Found by -Wpessimizing-move.

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

7 years agoSwitch external cvtres.exe for llvm's own resource library.
Eric Beckmann [Fri, 16 Jun 2017 21:13:24 +0000 (21:13 +0000)]
Switch external cvtres.exe for llvm's own resource library.

In this patch, I flip the switch in DriverUtils from using the external
cvtres.exe tool to using the Windows Resource library in llvm.

I also fixed a bug where .rsrc sections were marked as discardable
memory and therefore were placed in the wrong order in the final PE.

Furthermore, I modified WindowsResource to write the coff directly to a
memory buffer instead of to file, also had it use the machine types
already declared in COFF.h instead creating my own enum.

Finally, I flipped the switch to allow all unit tests that had
previously run only on windows due to a winres dependency to run
cross-platform.

Reviewers: zturner, ruiu

Subscribers: llvm-commits, hiraditya

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

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

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