Commit Graph

133325 Commits

Author SHA1 Message Date
Sanjay Patel
2ae3d2cd86 [InstCombine] fix outdated comment, simplify logic; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:31:52 +00:00
Evgeny Stupachenko
3cb6afa22a The patch set unroll disable pragma when unroll
with user specified count has been applied.

Summary:
Previously SetLoopAlreadyUnrolled() set the disable pragma only if
there was some loop metadata.
Now it set the pragma in all cases. This helps to prevent multiple
unroll when -unroll-count=N is given.

Reviewers: mzolotukhin

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:21:24 +00:00
Xinliang David Li
8c60b4112d [PM] Refector LoopAccessInfo analysis code
This is the preparation patch to port the analysis to new PM

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:15:37 +00:00
Sanjay Patel
0406782714 [InstCombine] reduce indent; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:09:04 +00:00
Tim Shen
c4d0eaa0ba [MemCpyOpt] Do not exchange llvm.lifetime.start and llvm.memcpy
Reviewers: iteratee

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:42:32 +00:00
Sanjay Patel
0a41b20ac6 [InstCombine] use copyIRFlags() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:33:52 +00:00
Benjamin Kramer
36538ffe93 Apply most suggestions of clang-tidy's performance-unnecessary-value-param
Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:09:22 +00:00
Adrian McCarthy
fa4edba0da Generate codeview for array type metadata.
Differential Revision: http://reviews.llvm.org/D21107

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 18:22:59 +00:00
Benjamin Kramer
4fb8b608a6 [CodeView] Remove manual expansion of the default copy ctor.
It provides nothing over the default one but makes the class not
trivially copyable. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 18:19:38 +00:00
George Burgess IV
05f452d9a1 Attempt #2 to appease the buildbots.
MSVC calls the copy ctor on StratifiedSets for some reason. So,
undelete it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:56:35 +00:00
Reid Kleckner
d3fa84042c [codeview] Avoid emitting an empty file checksum table
Again, the Microsoft linker does not like empty substreams.

We still emit an empty string table if CodeView is enabled, but that
doesn't cause problems because it always contains at least one null
byte.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:50:29 +00:00
Sanjoy Das
8999baf434 [SCEV] Break out of loop if there is no more work to do
This is NFC as far as externally visible behavior is concerned, but will
keep us from spinning in the worklist traversal algorithm unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:46 +00:00
Sanjoy Das
27dabd2db6 [SCEV] Track no-abnormal-exits instead of no-throw calls
Absence of may-unwind calls is not enough to guarantee that a
UB-generating use of an add-rec poison in the loop latch will actually
cause UB.  We also need to guard against calls that terminate the thread
or infinite loop themselves.

This partially addresses PR28012.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:42 +00:00
Sanjoy Das
39ede080e2 Teach isGuarantdToTransferExecToSuccessor about debug info intrinsics
Calls to `@llvm.dbg.*` can be assumed to terminate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:36 +00:00
Sanjoy Das
e118351c7e Fix a bug in SCEV's poison value propagation
The worklist algorithm introduced in rL271151 didn't check to see if the
direct users of the post-inc add recurrence propagates poison.  This
change fixes the problem and makes the code structure more obvious.

Note for release managers: correctness wise, this bug wasn't a
regression introduced by rL271151 -- the behavior of SCEV around
post-inc add recurrences was strictly improved (in terms of correctness)
in rL271151.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:31 +00:00
Quentin Colombet
76354c5724 [RegBankSelect] Silence an unused variable warning in release mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:39:47 +00:00
Quentin Colombet
4eb9d7cdeb [RegBankSelect] Comment on how we could improve repairing with copies.
When repairing with a copy, instead of accounting for the cost of that
copy and actually inserting it, we may be able to use an alternative
source for the register to repair and just use it.

Make sure this is documented, so that we consider that opportunity at
some point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:39:43 +00:00
Zachary Turner
47b89fc720 [pdb] Fix build errors in PDB unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:32:25 +00:00
George Burgess IV
6f686563fd Try to appease buildbots.
r272064 apparently made them angry. This undoes some changes made in
r272064 (defaulting move ctors) to make them happy again.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:27:14 +00:00
Zachary Turner
99272168e0 [pdb] Handle stream index errors better.
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:26:39 +00:00
Rui Ueyama
bdd8d795bb Remove a patch .rej file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:54:31 +00:00
Quentin Colombet
792b56f6a7 [AArch64][RegisterBankInfo] G_OR are fine on either GPR or FPR.
Teach AArch64RegisterBankInfo that G_OR can be mapped on either GPR or
FPR for 64-bit or 32-bit values.

Add test cases demonstrating how this information is used to coalesce a
computation on a single register bank.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:53:32 +00:00
Quentin Colombet
75072bc260 [RegBankSelect] Use RegisterBankInfo applyMapping method.
The RegBankSelect pass can now rely on the target to do the remapping of
the instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:45:04 +00:00
Vedant Kumar
8a025f711a [ProfileData] Update llvm's copy of InstrProfData.inc
The new version of the header introduces the INSTR_PROF_VISIBILITY
macro. See http://reviews.llvm.org/D21116 for more details.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272166 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:39:32 +00:00
Quentin Colombet
5972504d7b [RegisterBankInfo] Implement the method to apply a mapping.
Now, the target will be able to provide its how implementation to remap
an instruction. This open the way to crazier optimizations, but to
beginning with, we will be able to handle something else than the
default mapping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:39:21 +00:00
Quentin Colombet
05d61b46ed [RegBankSelect] Use the OperandMapper class to hold remap information.
Now that we have an entity that hold the remap information the
rewritting should be easier to do.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272164 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:30:55 +00:00
Quentin Colombet
cf4d78fc0d [RegBankSelect] Use const_iterator instead of iterator for repairReg.
The repairing code has no reason to change the source or destination of
the registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:24:55 +00:00
Quentin Colombet
94a69dc2a1 [RegisterBankInfo] Introduce OperandsMapper class.
This helper class is used to encapsulate the necessary information
to remap an instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:18:13 +00:00
Quentin Colombet
4a3ecf8a53 [Target] Introduce a generic opcode for bitwise OR: G_OR.
This G_OR is used in GlobalISel to represent bitwise OR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 16:12:19 +00:00
Quentin Colombet
470be6185a [RegBankSelect] Introduce a command line option to override the running mode.
When the command line option is set, it overrides any thing that the
target may have set. The rationale is that we get what we asked for.

Options are respectively regbankselect-fast and regbankselect-greedy for
fast and greedy mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 15:49:23 +00:00
Quentin Colombet
ad15246a5e [RegBankSelect] Explain what it would take to support non-copy
repairing.

Copies are easy because we repair only when there is a mismatch. For
non-copy repairing, i.e., cases that involves breaking down or gathering
up the value, one of the operand may not have a register bank yet. Thus,
derivate a cost from that, requires more work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 15:40:32 +00:00
Oliver Stannard
25429add0f [ARM] MSR instructions implicitly set CPSR
The MSR instructions can write to the CPSR, but we did not model this
fact, so we could emit them in the middle of IT blocks, changing the
condition flags for later instructions in the block.

The tests use two calls to llvm.write_register.i32 because it is valid
to use these instructions at the end of an IT block, which if conversion
does do in some cases. With two calls, the first clobbers the flags, so
a branch has to be used to make the second one conditional.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 15:26:34 +00:00
Daniel Dunbar
3a7c4849b7 [lit] Ensure we get bytes when reading redirected output files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 14:41:44 +00:00
Saleem Abdulrasool
e169351252 Support: correct AArch64 TargetParser implementation
The architecture enumeration is shared across ARM and AArch64.  However, the
data is not.  The code incorrectly would index into the array using the
architecture index which was offset by the ARMv7 architecture enumeration.  We
do not have a marker for indicating the architectural family to which the
enumeration belongs so we cannot be clever about offsetting the index (at least
it is not immediately apparent to me).  Instead, fall back to the tried-and-true
method of slowly iterating the array (its not a large array, so the impact of
this is not too high).

Because of the incorrect indexing, if we were lucky, we would crash, but usually
we would return an invalid StringRef.  We did not have any tests for the AArch64
target parser previously;.  Extend the previous tests I had added for ARM to
cover AArch64 for ensuring that we return expected StringRefs.

Take the opportunity to change some iterator types to references.

This work is needed to support parsing `.arch name` directives in the AArch64
target asm parser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 14:30:00 +00:00
Davide Italiano
a99c29794a [PM] LoopSimplify. Remove unneeded pass dependencies. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272140 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 13:56:59 +00:00
Davide Italiano
9491ddb86e [PM/SimplifyCFG] Preserve GlobalsAA even if the IR is mutated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272139 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 13:32:23 +00:00
Vasileios Kalintiris
a0fa31c900 [mips] Add a proper file header in MipsFastISel.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 13:13:15 +00:00
Krzysztof Parzyszek
7bf435bbe7 [Hexagon] Modify HexagonExpandCondsets to handle subregisters
Also, switch to using functions from LiveIntervalAnalysis to update
live intervals, instead of performing the updates manually.

Re-committing r272045.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 12:31:16 +00:00
Diana Picus
c5d0b1da6e [ARM] Remove redundant check. NFC
isSwift is tested earlier and known to be false when we reach this code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272127 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 10:29:02 +00:00
Benjamin Kramer
04a303b821 Avoid copies of std::strings and APInt/APFloats where we only read from it
As suggested by clang-tidy's performance-unnecessary-copy-initialization.
This can easily hit lifetime issues, so I audited every change and ran the
tests under asan, which came back clean.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 10:01:20 +00:00
Igor Breger
1e48871118 [AVX512] Fix cvtusi2sd instruction Opcode, it should be 0x7B instead of 0x2A.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 07:48:23 +00:00
Matt Arsenault
c9cf0c849e Make LiveDebugValues preserve CFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 05:18:01 +00:00
Kostya Serebryany
819b4d1da2 [libFuzzer] add 'weak' back to __sanitizer_malloc_hook and __sanitizer_free_hook
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 04:49:29 +00:00
Kostya Serebryany
fd9cb1a5c5 [libFuzzer] add a test that is built w/o coverage instrumentation but has the coverage rt (it should now fail with a descriptive message)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:46:13 +00:00
Kostya Serebryany
9f5007947e [libFuzzer] docs: merge two lines with cmake instructions, add -DLLVM_ENABLE_ASSERTIONS=ON
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:31:40 +00:00
Quentin Colombet
d292b5eaf2 [AArch64][RegisterBankInfo] Use the generic implementation of copyCost.
Long term we may want to give high cost at FPR to/from GPR copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:24:00 +00:00
Quentin Colombet
178ae081fb [RegisterBankInfo] Adapt the copy cost logic to give something sane by default.
The generic implementation stated that all copies were free, which is
unlikely. Now, only the copies within the same register bank are free.
We assume they will get coalesced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:17:10 +00:00
Quentin Colombet
edb4f7c12a [RegisterBankInfo] Add a size argument for the cost of copy.
The cost of a copy may be different based on how many bits we have to
copy around. E.g., a 8-bit copy may be different than a 32-bit copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:11:03 +00:00
Quentin Colombet
5c05d4112b [RegisterBankInfo] Move a hidden function into a static method. NFC.
This will allow code reuse in the coming commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 01:04:32 +00:00
Matthias Braun
0f19dc2756 MIR: Fix parsing of stack object references in MachineMemOperands
The MachineMemOperand parser lacked the code to handle %stack.X
references (%fixed-stack.X was working).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 00:47:07 +00:00