OSDN Git Service

android-x86/external-llvm.git
7 years ago[ARM, x86] add more vector tests for bool math; NFC
Sanjay Patel [Mon, 24 Apr 2017 22:42:34 +0000 (22:42 +0000)]
[ARM, x86] add more vector tests for bool math; NFC

I'm proposing a fold for increment-of-sexted-bool in:
https://reviews.llvm.org/D31944
...so we need to know what happens in more cases like these.

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

7 years ago[git-llvm] Remove CR from middle of svn propget output
Reid Kleckner [Mon, 24 Apr 2017 22:26:46 +0000 (22:26 +0000)]
[git-llvm] Remove CR from middle of svn propget output

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

7 years agoMake getSlotAttributes return an AttributeSet instead of a wrapper list
Reid Kleckner [Mon, 24 Apr 2017 22:25:02 +0000 (22:25 +0000)]
Make getSlotAttributes return an AttributeSet instead of a wrapper list

Remove the temporary, poorly named getSlotSet method which did the same
thing. Also remove getSlotNode, which is a hold-over from when we were
dealing with AttributeSetNode* instead of AttributeSet.

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

7 years ago[git-llvm] Make `push` work on CRLF files with svn:eol-style=native
Reid Kleckner [Mon, 24 Apr 2017 22:09:08 +0000 (22:09 +0000)]
[git-llvm] Make `push` work on CRLF files with svn:eol-style=native

Summary:
`git apply` on Windows doesn't work for files that SVN checks out as
CRLF. There is no way to force SVN to check everything out with Unix
line endings on Windows. Files with svn:eol-style=native will always
come out with CRLF, breaking `git apply`, which wants Unix line endings.
My workaround is to list all files with this property set in the change,
and run `dos2unix` on them. SVN doesn't commit a massive line ending
change because the svn:eol-style property indicates that these are text
files.

Tested on r301245.

Reviewers: zturner, jlebar

Subscribers: llvm-commits

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

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

7 years ago[InstSimplify] use ConstantRange to simplify more and-of-icmps
Sanjay Patel [Mon, 24 Apr 2017 21:52:39 +0000 (21:52 +0000)]
[InstSimplify] use ConstantRange to simplify more and-of-icmps

We can simplify (and (icmp X, C1), (icmp X, C2)) to one of the icmps in many cases.
I had to check some of these with Alive to prove to myself it's right, but everything
seems to check out. Eg, the code in instcombine was completely ignoring predicates with
mismatched signedness.

Handling or-of-icmps would be a follow-up step.

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

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

7 years ago[DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.
Simon Pilgrim [Mon, 24 Apr 2017 21:43:21 +0000 (21:43 +0000)]
[DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.

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

7 years agoAMDGPU: Slightly simplify prolog reserved register handling
Matt Arsenault [Mon, 24 Apr 2017 21:08:32 +0000 (21:08 +0000)]
AMDGPU: Slightly simplify prolog reserved register handling

Rely on MachineRegisterInfo's knowledge of used physical
registers.

Move flat_scratch initialization earlier, so the uses are visible
when making these decisions.

This will make it easier to add another reserved register
at the end for the stack pointer rather than handling another
special case.

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

7 years agoCosmetic change.
Galina Kistanova [Mon, 24 Apr 2017 21:06:29 +0000 (21:06 +0000)]
Cosmetic change.

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

7 years agoProfileData: clean up some stale declarations (NFC)
Saleem Abdulrasool [Mon, 24 Apr 2017 21:05:05 +0000 (21:05 +0000)]
ProfileData: clean up some stale declarations (NFC)

These were removed in SVN r300381.  Remove the declarations.

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

7 years agoSmall addition on how to add a builder.
Galina Kistanova [Mon, 24 Apr 2017 20:48:40 +0000 (20:48 +0000)]
Small addition on how to add a builder.

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

7 years ago[AMDGPU][mc][tests][NFC] Bulk ISA tests: update for Gfx7/Gfx8, add for Gfx9.
Artem Tamazov [Mon, 24 Apr 2017 20:42:27 +0000 (20:42 +0000)]
[AMDGPU][mc][tests][NFC] Bulk ISA tests: update for Gfx7/Gfx8, add for Gfx9.

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

7 years ago[Bitcode] Refactor attribute group writing to avoid getSlotAttributes
Reid Kleckner [Mon, 24 Apr 2017 20:38:30 +0000 (20:38 +0000)]
[Bitcode] Refactor attribute group writing to avoid getSlotAttributes

Summary:
That API creates a temporary AttributeList to carry an index and a
single AttributeSet. We need to carry the index in addition to the set,
because that is how attribute groups are currently encoded.

NFC

Reviewers: pcc

Subscribers: llvm-commits

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

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

7 years agoUpdate profile during memory instrinsic optimization
Teresa Johnson [Mon, 24 Apr 2017 20:30:42 +0000 (20:30 +0000)]
Update profile during memory instrinsic optimization

Summary:
Ensure that the new merge BB (which contains the rest of the original BB
after the mem op being optimized) gets a profile frequency, in case
there are additional mem ops later in the BB. Otherwise they get skipped
as the merge BB looks cold.

Reviewers: davidxl, xur

Subscribers: llvm-commits

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

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

7 years agoRevert "StructurizeCFG: Directly invert cmp instructions"
Matt Arsenault [Mon, 24 Apr 2017 20:25:01 +0000 (20:25 +0000)]
Revert "StructurizeCFG: Directly invert cmp instructions"

This reverts commit r300732. This breaks a few tests.
I think the problem is related to adding more uses of
the condition that don't yet exist at this point.

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

7 years ago[LoopUnroll] Remove spurious newline.
Davide Italiano [Mon, 24 Apr 2017 20:17:38 +0000 (20:17 +0000)]
[LoopUnroll] Remove spurious newline.

Eli pointed out in the review, but I didn't squash the two commits
correctly. Pointy-hat to me.

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

7 years agoRevert "Refactor DynamicLibrary so searching for a symbol will have a defined order"
Frederich Munch [Mon, 24 Apr 2017 20:16:01 +0000 (20:16 +0000)]
Revert "Refactor DynamicLibrary so searching for a symbol will have a defined order"
The i686-mingw32-RA-on-linux bot is still having errors.

This reverts commit r301236.

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

7 years ago[LoopUnroll] Don't try to unroll non canonical loops.
Davide Italiano [Mon, 24 Apr 2017 20:14:11 +0000 (20:14 +0000)]
[LoopUnroll] Don't try to unroll non canonical loops.

The current Loop Unroll implementation works with loops having a
single latch that contains a conditional branch to a block outside
the loop (the other successor is, by defition of latch, the header).
If this precondition doesn't hold, avoid unrolling the loop as
the code is not ready to handle such circumstances.

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

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

7 years ago[LIR] Obey non-integral pointer semantics
Sanjoy Das [Mon, 24 Apr 2017 20:12:10 +0000 (20:12 +0000)]
[LIR] Obey non-integral pointer semantics

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

Reviewers: haicheng

Reviewed By: haicheng

Subscribers: mcrosier, mzolotukhin, llvm-commits

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

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

7 years agoAvoid unnecessary copies in some for loops
Saleem Abdulrasool [Mon, 24 Apr 2017 20:01:03 +0000 (20:01 +0000)]
Avoid unnecessary copies in some for loops

Use constant references rather than `const auto` which will cause the
copy constructor.  These particular cases cause issues for the swift
compiler.

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

7 years agoRefactor DynamicLibrary so searching for a symbol will have a defined order and
Frederich Munch [Mon, 24 Apr 2017 19:55:16 +0000 (19:55 +0000)]
Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

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

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

7 years agoMove value type list from TargetRegisterClass to TargetRegisterInfo
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:51:12 +0000 (19:51 +0000)]
Move value type list from TargetRegisterClass to TargetRegisterInfo

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

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

7 years agoRevert r301231: Accidentally committed stale files
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:48:51 +0000 (19:48 +0000)]
Revert r301231: Accidentally committed stale files

I forgot to commit local changes before commit.

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

7 years agoMove value type list from TargetRegisterClass to TargetRegisterInfo
Krzysztof Parzyszek [Mon, 24 Apr 2017 19:43:45 +0000 (19:43 +0000)]
Move value type list from TargetRegisterClass to TargetRegisterInfo

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

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

7 years agoAMDGPU: Select scratch mubuf offsets when pointer is a constant
Matt Arsenault [Mon, 24 Apr 2017 19:40:59 +0000 (19:40 +0000)]
AMDGPU: Select scratch mubuf offsets when pointer is a constant

In call sequence setups, there may not be a frame index base
and the pointer is a constant offset from the frame
pointer / scratch wave offset register.

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

7 years agoAMDGPU: Set StackGrowsUp in MCAsmInfo
Matt Arsenault [Mon, 24 Apr 2017 19:40:51 +0000 (19:40 +0000)]
AMDGPU: Set StackGrowsUp in MCAsmInfo

Not sure what this does though.

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

7 years ago[AMDGPU] Merge M0 initializations
Stanislav Mekhanoshin [Mon, 24 Apr 2017 19:37:54 +0000 (19:37 +0000)]
[AMDGPU] Merge M0 initializations

Merges equivalent initializations of M0 and hoists them into a common
dominator block. Technically the same code can be used with any
register, physical or virtual.

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

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

7 years agoHandle invariant.group.barrier in BasicAA
Piotr Padlewski [Mon, 24 Apr 2017 19:37:17 +0000 (19:37 +0000)]
Handle invariant.group.barrier in BasicAA

Summary:
llvm.invariant.group.barrier returns pointer that mustalias
pointer it takes. It can't be marked with `returned` attribute,
because it would be remove easily. The other reason is that
only Alias Analysis can know about this, because if any other
pass would know it, then the result would be replaced with it's
argument, which would be invalid.

We can think about returned pointer as something that mustalias, but
it doesn't have to be bitwise the same as the argument.

Reviewers: dberlin, chandlerc, hfinkel, sanjoy

Subscribers: reames, nlewycky, rsmith, anna, amharc

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

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

7 years ago[asan] Let the frontend disable gc-sections optimization for asan globals.
Evgeniy Stepanov [Mon, 24 Apr 2017 19:34:13 +0000 (19:34 +0000)]
[asan] Let the frontend disable gc-sections optimization for asan globals.

Also extend -asan-globals-live-support flag to all binary formats.

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

7 years ago[SimplifyCFG] Fix for non-determinism in codegen
Mandeep Singh Grang [Mon, 24 Apr 2017 19:20:45 +0000 (19:20 +0000)]
[SimplifyCFG] Fix for non-determinism in codegen

Summary: This patch fixes issues in codegen uncovered due to https://reviews.llvm.org/D26718

Reviewers: majnemer, chenli, davide

Reviewed By: davide

Subscribers: davide, arsenm, llvm-commits

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

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

7 years agoMove size and alignment information of regclass to TargetRegisterInfo
Krzysztof Parzyszek [Mon, 24 Apr 2017 18:55:33 +0000 (18:55 +0000)]
Move size and alignment information of regclass to TargetRegisterInfo

1. RegisterClass::getSize() is split into two functions:
   - TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const;
   - TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const;
2. RegisterClass::getAlignment() is replaced by:
   - TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const;

This will allow making those values depend on subtarget features in the
future.

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

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

7 years agoDon't test setting sticky bits on files for modern BSDs
Dimitry Andric [Mon, 24 Apr 2017 18:54:48 +0000 (18:54 +0000)]
Don't test setting sticky bits on files for modern BSDs

Summary: In rL297945, jhenderson added methods for setting permissions
to sys::fs, but some of the unittests that attempt to set sticky bits
(01000) on files fail on modern BSDs, such as FreeBSD, NetBSD and
OpenBSD.  This is because those systems do not allow regular users to
set sticky bits on files, only on directories.  Fix it by disabling
these particular tests on modern BSDs.

Reviewers: emaste, brad, jhenderson

Reviewed By: jhenderson

Subscribers: joerg, krytarowski, llvm-commits

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

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

7 years agoDon't emit CFI instructions at the end of a function
Adrian Prantl [Mon, 24 Apr 2017 18:45:59 +0000 (18:45 +0000)]
Don't emit CFI instructions at the end of a function

When functions are terminated by unreachable instructions, the last
instruction might trigger a CFI instruction to be generated. However,
emitting it would be be illegal since the function (and thus the FDE
the CFI is in) has already ended with the previous instruction.

Darwin's dwarfdump --verify --eh-frame complains about this and the
specification supports this.
Relevant bits from the DWARF 5 standard (6.4 Call Frame Information):

"[The] address_range [field in an FDE]: The number of bytes of
 program instructions described by this entry."

"Row creation instructions: [...]
 The new location value is always greater than the current one."
The first quotation implies that a CFI cannot describe a target
address outside of the enclosing FDE's range.

rdar://problem/26244988

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

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

7 years agoUpdates documentation for a syntax sugar libfuzzer flag,
George Karpenkov [Mon, 24 Apr 2017 18:39:52 +0000 (18:39 +0000)]
Updates documentation for a syntax sugar libfuzzer flag,

as implemented in https://reviews.llvm.org/D32193

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

7 years agoCodeGen: Add a hook for getFenceOperandTy
Yaxun Liu [Mon, 24 Apr 2017 18:26:27 +0000 (18:26 +0000)]
CodeGen: Add a hook for getFenceOperandTy

Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0.
This is fine for most targets. However for amdgcn target, the size of pointer in address space 0
depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is
32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target
triple environment. Therefore a hook is need in target lowering for getting the fence operand type.

This patch has no effect on targets other than amdgcn.

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

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

7 years agoRevert "Compute safety information in a much finer granularity."
Evgeniy Stepanov [Mon, 24 Apr 2017 18:25:07 +0000 (18:25 +0000)]
Revert "Compute safety information in a much finer granularity."

Use-after-free in llvm::isGuaranteedToExecute.

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

7 years ago[InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine
Sanjay Patel [Mon, 24 Apr 2017 18:24:36 +0000 (18:24 +0000)]
[InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine

This is a straight cut and paste, but there's a bigger problem: if this
fold exists for simplifyOr, there should be a DeMorganized version for
simplifyAnd. But more than that, we have a patchwork of ad hoc logic
optimizations in InstCombine. There should be some structure to ensure
that we're not missing sibling folds across and/or/xor.

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

7 years agoX86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC
Matthias Braun [Mon, 24 Apr 2017 18:15:00 +0000 (18:15 +0000)]
X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC

Re-Commit of r300922 and r300923 with less aggressive assert (see
discussion at the end of https://reviews.llvm.org/D32205)

X86RegisterInfo::eliminateFrameIndex() and
X86FrameLowering::getFrameIndexReference() both had logic to compute the
base register. This consolidates the code.

Also use MachineInstr::isReturn instead of manually enumerating tail
call instructions (return instructions were not included in the previous
list because they never reference frame indexes).

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

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

7 years agoUse DW_OP_stack_value when reconstructing variable values with arithmetic.
Adrian Prantl [Mon, 24 Apr 2017 18:11:42 +0000 (18:11 +0000)]
Use DW_OP_stack_value when reconstructing variable values with arithmetic.

When the location description of a source variable involves arithmetic
on the value itself, it needs to be marked with DW_OP_stack_value since it
is not describing the variable's location, but rather its value.

This is a follow-up to r297971 and fixes the source testcase quoted in
the comment in debuginfo-dce.ll.

rdar://problem/30725338

This reapplies r301093 without modifications.

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

7 years agoAdd a testcase for DIExpression(DW_OP_stack_value)
Adrian Prantl [Mon, 24 Apr 2017 18:11:38 +0000 (18:11 +0000)]
Add a testcase for DIExpression(DW_OP_stack_value)
and relax the assertion that prohibited its emission.

This fixes the assertion failure uncovered by r301093.

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

7 years agoAMDGPU: Add StackPtr and FramePtr registers to MFI
Matt Arsenault [Mon, 24 Apr 2017 18:05:16 +0000 (18:05 +0000)]
AMDGPU: Add StackPtr and FramePtr registers to MFI

These will be necessary for setting up call sequences.

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

7 years agoAMDGPU: Move trap lowering to DAG
Matt Arsenault [Mon, 24 Apr 2017 17:49:13 +0000 (17:49 +0000)]
AMDGPU: Move trap lowering to DAG

Fixes traps in any block besides the entry block,
and fixes depending on a live-in physical register
by using a virtual register copy.

Also happens to stop emitting a nop in the case
debug trap is not supported.

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

7 years ago[DomPrinter] Add a way to programmatically dump a dot representation.
Davide Italiano [Mon, 24 Apr 2017 17:48:44 +0000 (17:48 +0000)]
[DomPrinter] Add a way to programmatically dump a dot representation.

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

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

7 years ago[llvm-pdbdump] Merge functionality of graphical and text dumpers.
Zachary Turner [Mon, 24 Apr 2017 17:47:52 +0000 (17:47 +0000)]
[llvm-pdbdump] Merge functionality of graphical and text dumpers.

The *real* difference between these two was that

a) The "graphical" dumper could recurse, while the text one could
   not.
b) The "text" dumper could display nested types and functions,
   while the graphical one could not.

Merge these two so that there is only one dumper that can recurse
arbitrarily deep and optionally display nested types or not.

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

7 years ago[llvm-pdbdump] Re-write the record layout code to be more resilient.
Zachary Turner [Mon, 24 Apr 2017 17:47:24 +0000 (17:47 +0000)]
[llvm-pdbdump] Re-write the record layout code to be more resilient.

This reworks the way virtual bases are handled, and also the way
padding is detected across multiple levels of aggregates, producing
a much more accurate result.

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

7 years ago[APInt] Simplify the zext and sext methods
Craig Topper [Mon, 24 Apr 2017 17:37:10 +0000 (17:37 +0000)]
[APInt] Simplify the zext and sext methods

This replaces a hand written copy loop with a call to memcpy for both zext and sext.

For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits.

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

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

7 years agoTesting commit credentials
George Karpenkov [Mon, 24 Apr 2017 17:28:32 +0000 (17:28 +0000)]
Testing commit credentials

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

7 years agoInstCombine: Fix assert when reassociating fsub with undef
Matt Arsenault [Mon, 24 Apr 2017 17:24:37 +0000 (17:24 +0000)]
InstCombine: Fix assert when reassociating fsub with undef

There is logic to track the expected number of instructions
produced. It thought in this case an instruction would
be necessary to negate the result, but here it folded
into a ConstantExpr fneg when the non-undef value operand
was cancelled out by the second fsub.

I'm not sure why we don't fold constant FP ops with undef currently,
but I think that would also avoid this problem.

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

7 years ago[APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ashrInPlace.
Craig Topper [Mon, 24 Apr 2017 17:18:47 +0000 (17:18 +0000)]
[APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ashrInPlace.

This patch adds an in place version of ashr to match lshr and shl which were recently added.

I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting.

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

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

7 years agoAMDGPU: Move v_readlane lane select from VGPR to SGPR
Nicolai Haehnle [Mon, 24 Apr 2017 17:17:36 +0000 (17:17 +0000)]
AMDGPU: Move v_readlane lane select from VGPR to SGPR

Summary:
Fix a compiler bug when the lane select happens to end up in a VGPR.

Clarify the semantic of the corresponding intrinsic to be that of
the corresponding GLSL: the lane select must be uniform across a
wave front, otherwise results are undefined.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

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

7 years agoCompute safety information in a much finer granularity.
Xin Tong [Mon, 24 Apr 2017 17:12:22 +0000 (17:12 +0000)]
Compute safety information in a much finer granularity.

Summary:
Instead of keeping a variable indicating whether there are early exits
in the loop.  We keep all the early exits. This improves LICM's ability to
move instructions out of the loop based on is-guaranteed-to-execute.

I am going to update compilation time as well soon.

Reviewers: hfinkel, sanjoy, efriedma, mkuper

Reviewed By: hfinkel

Subscribers: llvm-commits, mzolotukhin

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

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

7 years agoInstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}
Nicolai Haehnle [Mon, 24 Apr 2017 17:08:43 +0000 (17:08 +0000)]
InstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}

Summary:
The return value of these intrinsics should always have 0 bits for
inactive threads. This means that when all arguments are constant
and the comparison evaluates to true, the intrinsic should return
the current exec mask.

Fixes some GL_ARB_shader_ballot tests.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

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

7 years ago[GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.
Igor Breger [Mon, 24 Apr 2017 17:05:52 +0000 (17:05 +0000)]
[GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.

Summary: [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.

Reviewers: zvi, t.p.northover, guyblank

Reviewed By: t.p.northover

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

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

7 years ago[DAGCombiner] Updated bswap byte offset variable names to be more descriptive. NFC
Simon Pilgrim [Mon, 24 Apr 2017 17:05:14 +0000 (17:05 +0000)]
[DAGCombiner] Updated bswap byte offset variable names to be more descriptive. NFC

As discussed on D32039, use MaskByteOffset to describe the variable and also pull out repeated getOpcode() calls.

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

7 years ago[APInt] Fix repeated word in comments. NFC
Craig Topper [Mon, 24 Apr 2017 17:00:22 +0000 (17:00 +0000)]
[APInt] Fix repeated word in comments. NFC

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

7 years agoAMDGPU: Fix crash when scheduling non-memory SMRD instructions
Nicolai Haehnle [Mon, 24 Apr 2017 16:53:52 +0000 (16:53 +0000)]
AMDGPU: Fix crash when scheduling non-memory SMRD instructions

Summary: Fixes piglit spec/arb_shader_clock/execution/*

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

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

7 years ago[SDAG] Teach Chain Analysis about BaseIndexOffset addressing.
Nirav Dave [Mon, 24 Apr 2017 15:37:20 +0000 (15:37 +0000)]
[SDAG] Teach Chain Analysis about BaseIndexOffset addressing.

While we use BaseIndexOffset in FindBetterNeighborChains to
appropriately realize they're almost the same address and should be
improved concurrently we do not use it in isAlias using the non-index
understanding FindBaseOffset instead. Adding a BaseIndexOffset check
in isAlias like should allow indexed stores to be merged.

FindBaseOffset to be excised in subsequent patch.

Reviewers: jyknight, aditya_nandakumar, bogner

Subscribers: llvm-commits

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

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

7 years ago[X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructions
Simon Pilgrim [Mon, 24 Apr 2017 14:26:30 +0000 (14:26 +0000)]
[X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructions

Had to split btver2/znver1 checks as only btver2 suppresses zeroupper

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

7 years ago[SystemZ] Update kill-flag in splitMove().
Jonas Paulsson [Mon, 24 Apr 2017 12:40:28 +0000 (12:40 +0000)]
[SystemZ]  Update kill-flag in splitMove().

EarlierMI needs to clear the kill flag on the first operand in case of a store.

Review: Ulrich Weigand

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

7 years ago[DWARF] Move test to x86 directory
Renato Golin [Mon, 24 Apr 2017 12:37:11 +0000 (12:37 +0000)]
[DWARF] Move test to x86 directory

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

7 years ago[RegionInfo] Fix dangling references created by moving RegionInfo objects
Philip Pfaffe [Mon, 24 Apr 2017 11:54:37 +0000 (11:54 +0000)]
[RegionInfo] Fix dangling references created by moving RegionInfo objects

Summary: Region objects capture the address of the creating RegionInfo instance. Because the RegionInfo class is movable, moving a RegionInfo object creates dangling references. This patch fixes these references by walking the Regions post-move, and updating references to the new parent.

Reviewers: Meinersbur, grosser

Reviewed By: Meinersbur, grosser

Subscribers: llvm-commits

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

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

7 years agoAdd SUSE vendor
Ismail Donmez [Mon, 24 Apr 2017 11:18:29 +0000 (11:18 +0000)]
Add SUSE vendor

Summary: SUSE's ARM triples end with -gnueabi even though they are hard-float. This requires special handling of SUSE ARM triples. Hence we need a way to differentiate the SUSE as vendor. This CL adds that.

Reviewers: chandlerc, compnerd, echristo, rengolin

Reviewed By: rengolin

Subscribers: aemerson, rengolin, llvm-commits

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

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

7 years ago[LLVM][MIPS] Fix different definition of off_t in LLDB and LLVM.
Nitesh Jain [Mon, 24 Apr 2017 10:36:46 +0000 (10:36 +0000)]
[LLVM][MIPS] Fix different definition of off_t in LLDB and LLVM.

Reviewers: beanz

Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste

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

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

7 years ago[DWARF] - Take relocations in account when extracting ranges from .debug_ranges
George Rimar [Mon, 24 Apr 2017 10:19:45 +0000 (10:19 +0000)]
[DWARF] - Take relocations in account when extracting ranges from .debug_ranges

I found this when investigated "Bug 32319 - .gdb_index is broken/incomplete" for LLD.

When we have object file with .debug_ranges section it may be filled with zeroes.
Relocations are exist in file to relocate this zeroes into real values later, but until that
a pair of zeroes is treated as terminator. And DWARF parser thinks there is no ranges at all
when I am trying to collect address ranges for building .gdb_index.

Solution implemented in this patch is to take relocations in account when parsing ranges.

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

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

7 years ago[ARM] GlobalISel: Legalize s8 and s16 G_(S|U)DIV
Diana Picus [Mon, 24 Apr 2017 09:12:19 +0000 (09:12 +0000)]
[ARM] GlobalISel: Legalize s8 and s16 G_(S|U)DIV

We have to widen the operands to 32 bits and then we can either use
hardware division if it is available or lower to a libcall otherwise.

At the moment it is not enough to set the Legalizer action to
WidenScalar, since for libcalls it won't know what to do (it won't be
able to find what size to widen to, because it will find Libcall and not
Legal for 32 bits). To hack around this limitation, we request Custom
lowering, and as part of that we widen first and then we run another
legalizeInstrStep on the widened DIV.

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

7 years ago[Arch64AsmParser] better diagnostic for isb
Sjoerd Meijer [Mon, 24 Apr 2017 08:22:20 +0000 (08:22 +0000)]
[Arch64AsmParser] better diagnostic for isb

Instruction isb takes as an operand either 'sy' or an immediate value. This
improves the diagnostic when the string is not 'sy' and adds a test case for
this which was missing. This also adds tests to check invalid inputs for dsb
and dmb.

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

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

7 years ago[ARM] GlobalISel: Support G_(S|U)DIV for s32
Diana Picus [Mon, 24 Apr 2017 08:20:05 +0000 (08:20 +0000)]
[ARM] GlobalISel: Support G_(S|U)DIV for s32

Add support for both targets with hardware division and without. For
hardware division we have to add support throughout the pipeline
(legalizer, reg bank select, instruction select). For targets without
hardware division, we only need to mark it as a libcall.

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

7 years ago[GlobalISel] Legalize G_(S|U)DIV libcalls
Diana Picus [Mon, 24 Apr 2017 07:22:31 +0000 (07:22 +0000)]
[GlobalISel] Legalize G_(S|U)DIV libcalls

Treat them the same as the other binary operations that we have so far,
but on integers rather than floating point types. Extract the common
code into a helper.

This will be used in the ARM backend.

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

7 years ago[ARM] GlobalISel: Select G_CONSTANT with CImm operands
Diana Picus [Mon, 24 Apr 2017 06:30:56 +0000 (06:30 +0000)]
[ARM] GlobalISel: Select G_CONSTANT with CImm operands

When selecting a G_CONSTANT to a MOVi, we need the value to be an Imm
operand. We used to just leave the G_CONSTANT operand unchanged, which
works in some cases (such as the GEP offsets that we create when
referring to stack slots). However, in many other places the G_CONSTANTs
are created with CImm operands. This patch makes sure to handle those as
well, and to error out gracefully if in the end we don't end up with an
Imm operand.

Thanks to Oliver Stannard for reporting this issue.

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

7 years ago[XRay][tools] Fixup for pedantic and permissive errors/warnings
Dean Michael Berris [Mon, 24 Apr 2017 06:15:53 +0000 (06:15 +0000)]
[XRay][tools] Fixup for pedantic and permissive errors/warnings

Remove extraneous semicolons and fully qualify the Trace type.

Follow-up to D29320.

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

7 years ago[XRay] A tool for Comparing xray function call graphs
Dean Michael Berris [Mon, 24 Apr 2017 05:54:33 +0000 (05:54 +0000)]
[XRay] A tool for Comparing xray function call graphs

Summary:
This is a tool for comparing the function graphs produced by the
llvm-xray graph too. It takes the form of a new subcommand of the
llvm-xray tool 'graph-diff'.

This initial version of the patch is very rough, but it is close to
feature complete.

Depends on D29363

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

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

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

7 years ago[APInt] Make behavior of ashr by BitWidth consistent between single and multi word.
Craig Topper [Mon, 24 Apr 2017 05:38:26 +0000 (05:38 +0000)]
[APInt] Make behavior of ashr by BitWidth consistent between single and multi word.

Previously single word would always return 0 regardless of the original sign. Multi word would return all 0s or all 1s based on the original sign. Now single word takes into account the sign as well.

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

7 years agoRevert "Refactor DynamicLibrary so searching for a symbol will have a defined order.”
Frederich Munch [Mon, 24 Apr 2017 03:33:30 +0000 (03:33 +0000)]
Revert "Refactor DynamicLibrary so searching for a symbol will have a defined order.”
The changes are causing the i686-mingw32 build to fail.

This reverts commit r301153, and the changes for a separate warning on i686-mingw32 in r301155  and r301156.

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

7 years agoFix warning converting from boolean to pointer introduced in r301153.
Frederich Munch [Mon, 24 Apr 2017 03:12:16 +0000 (03:12 +0000)]
Fix warning converting from boolean to pointer introduced in r301153.

This reverts commit r301155, which was incorrect.

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

7 years agoFix warning converting from void* to boolean introduced in r301153.
Frederich Munch [Mon, 24 Apr 2017 02:51:40 +0000 (02:51 +0000)]
Fix warning converting from void* to boolean introduced in r301153.

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

7 years agoRevert "[SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds"
Sanjoy Das [Mon, 24 Apr 2017 02:35:19 +0000 (02:35 +0000)]
Revert "[SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds"

This reverts commit r301150.  It breaks CodeGen/Hexagon/hwloop-wrap2.ll, reverting
while I investigate.

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

7 years agoRefactor DynamicLibrary so searching for a symbol will have a defined order and
Frederich Munch [Mon, 24 Apr 2017 02:30:12 +0000 (02:30 +0000)]
Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

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

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

7 years ago[Orc] Fix a warning by removing an unused lambda capture.
Lang Hames [Mon, 24 Apr 2017 01:21:23 +0000 (01:21 +0000)]
[Orc] Fix a warning by removing an unused lambda capture.

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

7 years agoFix unused variables / fields warnings in release builds
Sanjoy Das [Mon, 24 Apr 2017 00:46:40 +0000 (00:46 +0000)]
Fix unused variables / fields warnings in release builds

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

7 years ago[SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds
Sanjoy Das [Mon, 24 Apr 2017 00:41:58 +0000 (00:41 +0000)]
[SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds

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

7 years ago[SCEV] Fix exponential time complexity by caching
Sanjoy Das [Mon, 24 Apr 2017 00:09:46 +0000 (00:09 +0000)]
[SCEV] Fix exponential time complexity by caching

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

7 years ago[PartialInine]: add triaging options
Xinliang David Li [Sun, 23 Apr 2017 23:39:04 +0000 (23:39 +0000)]
[PartialInine]: add triaging options

There are more bugs (runtime failures) triggered when partial
inlining is turned on. Add options to help triaging problems.

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

7 years ago[Orc] Use recursive mutexes for Error serialization.
Lang Hames [Sun, 23 Apr 2017 23:36:13 +0000 (23:36 +0000)]
[Orc] Use recursive mutexes for Error serialization.

Errors can be nested, so we need recursive locking for serialization /
deserialization.

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

7 years ago[SCEV] Move towards a verifier without false positives
Sanjoy Das [Sun, 23 Apr 2017 23:04:45 +0000 (23:04 +0000)]
[SCEV] Move towards a verifier without false positives

This change reboots SCEV's current (off by default) verification logic
to avoid false failures.  Instead of stringifying trip counts, it maps
old and new trip counts to the same ScalarEvolution "universe" and
asks ScalarEvolution to compute the difference between them.  If the
difference comes out to be a non-zero constant, then (barring some
corner cases) we *know* we messed up.

I've not yet enabled this by default since it hits an exponential time
issue in SCEV, but once I fix that, I'll flip it on by default in
EXPENSIVE_CHECKS builds.

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

7 years ago[X86][AVX] Add scheduling latency/throughput tests for some AVX1 instructions
Simon Pilgrim [Sun, 23 Apr 2017 22:08:17 +0000 (22:08 +0000)]
[X86][AVX] Add scheduling latency/throughput tests for some AVX1 instructions

More instructions will be added in future commits

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

7 years ago[InstCombine] add/move folds for [not]-xor
Sanjay Patel [Sun, 23 Apr 2017 22:00:02 +0000 (22:00 +0000)]
[InstCombine] add/move folds for [not]-xor

We handled all of the commuted variants for plain xor already,
although they were scattered around and sometimes folded less
efficiently using distributive laws. We had no folds for not-xor.

Handling all of these patterns consistently is part of trying to
reinstate:
https://reviews.llvm.org/rL300977

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

7 years ago[PartialInlining] Add optimization remark support
Xinliang David Li [Sun, 23 Apr 2017 21:40:58 +0000 (21:40 +0000)]
[PartialInlining] Add optimization remark support

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

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

7 years ago[X86][SSE] Add scheduler class support for SSE42 (PCMPGT) instructions
Simon Pilgrim [Sun, 23 Apr 2017 21:23:27 +0000 (21:23 +0000)]
[X86][SSE] Add scheduler class support for SSE42 (PCMPGT) instructions

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

7 years ago[X86][SSE] Add scheduling latency/throughput tests for (most) SSE42 instructions
Simon Pilgrim [Sun, 23 Apr 2017 21:00:25 +0000 (21:00 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for (most) SSE42 instructions

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

7 years ago[InstCombine] add tests for not-xor and remove redundant tests; NFC
Sanjay Patel [Sun, 23 Apr 2017 20:59:00 +0000 (20:59 +0000)]
[InstCombine] add tests for not-xor and remove redundant tests; NFC

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

7 years ago[JumpThread] We want to fold (not thread) when all predecessor go to single BB's...
Xin Tong [Sun, 23 Apr 2017 20:56:29 +0000 (20:56 +0000)]
[JumpThread] We want to fold (not thread) when all predecessor go to single BB's successor.

Summary:
In case all predecessor go to a single successor of current BB. We want to fold (not thread).

I failed to update the phi nodes properly in the last patch https://reviews.llvm.org/rL300657.

Phi nodes values are per predecessor in LLVM.

Reviewers: sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

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

7 years ago[X86][SSE] Add scheduling latency/throughput tests for (most) SSE41 instructions
Simon Pilgrim [Sun, 23 Apr 2017 20:05:21 +0000 (20:05 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for (most) SSE41 instructions

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

7 years ago[X86][SSE] Add missing scheduling latency/throughput test for PINSRW
Simon Pilgrim [Sun, 23 Apr 2017 19:56:49 +0000 (19:56 +0000)]
[X86][SSE] Add missing scheduling latency/throughput test for PINSRW

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

7 years agoCorrect grammar. NFC
Xin Tong [Sun, 23 Apr 2017 17:36:25 +0000 (17:36 +0000)]
Correct grammar. NFC

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

7 years ago[APInt] Make clearUnusedBits branch free.
Craig Topper [Sun, 23 Apr 2017 17:16:26 +0000 (17:16 +0000)]
[APInt] Make clearUnusedBits branch free.

This makes the WordBits calculation calculate a value between 1 and 64 for the number of bits in the last word. Previously if the BitWidth was a multiple of 64 bits the WordBits value was 0 and we had to bail out early to avoid an undefined shift. Now with a value of 64 we no longer have an undefined shift issue.

This shows a 15-16k reduction in the size of the opt binary on my local x86-64 build.

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

7 years ago[APInt] In sext single word case, use SignExtend64 and let the APInt constructor...
Craig Topper [Sun, 23 Apr 2017 17:16:24 +0000 (17:16 +0000)]
[APInt] In sext single word case, use SignExtend64 and let the APInt constructor mask off any excess bits.

The current code is trying to be clever with shifts to avoid needing to clear unused bits. But it looks like the compiler is unable to optimize out the unused bit handling in the APInt constructor. Given this its better to just use SignExtend64 and have more readable code.

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

7 years ago[InstCombine] add tests for or-to-xor; NFC
Sanjay Patel [Sun, 23 Apr 2017 16:37:36 +0000 (16:37 +0000)]
[InstCombine] add tests for or-to-xor; NFC

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

7 years ago[InstCombine] add pattern matches for commuted variants of xor-to-xor
Sanjay Patel [Sun, 23 Apr 2017 16:03:00 +0000 (16:03 +0000)]
[InstCombine] add pattern matches for commuted variants of xor-to-xor

There's probably some better way to write this that eliminates the
code duplication without hurting readability, but at least this
eliminates the logic holes and is hopefully slightly more efficient
than creating new instructions.

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

7 years ago[InstCombine] add tests for xor-to-xor; NFC
Sanjay Patel [Sun, 23 Apr 2017 14:51:03 +0000 (14:51 +0000)]
[InstCombine] add tests for xor-to-xor; NFC

Besides missing 2 commuted patterns, the way we handle these folds is inefficient.

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

7 years ago[X86][SSE] Add scheduling latency/throughput tests for SSSE3 instructions
Simon Pilgrim [Sun, 23 Apr 2017 14:01:55 +0000 (14:01 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for SSSE3 instructions

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

7 years ago[X86][SSE] Add scheduling latency/throughput tests for SSE3 instructions
Simon Pilgrim [Sun, 23 Apr 2017 13:59:29 +0000 (13:59 +0000)]
[X86][SSE] Add scheduling latency/throughput tests for SSE3 instructions

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