Reid Kleckner [Fri, 13 Feb 2015 21:27:28 +0000 (21:27 +0000)]
Fix R600 test deadlock on Windows by giving FileCheck an argument
llc would hang trying to write output to a full pipe that FileCheck
wasn't reading. FileCheck wasn't reading from stdin because it needs a
file as a positional argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229157
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 21:10:58 +0000 (21:10 +0000)]
[PM] Fix a compile error I introduced in r229094 and didn't notice
because I didn't have binutils set up properly to build the gold plugin.
Fixes PR22581 which was filed because this broke the build for folks
relying on the plugin. Very sorry! =]
I've gotten the plugin stuff building now as well so it shouldn't keep
happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229156
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 13 Feb 2015 21:07:22 +0000 (21:07 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229155
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 13 Feb 2015 21:06:45 +0000 (21:06 +0000)]
[modules] Mark include/llvm/Support/Dwarf.def as being a textually-included header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229154
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Fri, 13 Feb 2015 21:05:11 +0000 (21:05 +0000)]
Clean up some inappropriate choices of type in the bitcode reader. None of
these are expected to fix any 64->32 bit real truncation issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229153
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Feb 2015 21:02:37 +0000 (21:02 +0000)]
R600/SI: Refactor SOP1 classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229152
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Feb 2015 21:02:36 +0000 (21:02 +0000)]
R600/SI: Lowercase register names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229151
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Feb 2015 21:02:33 +0000 (21:02 +0000)]
R600/SI: Remove some unused TableGen classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229150
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 13 Feb 2015 20:45:14 +0000 (20:45 +0000)]
Reapply r229142 with some enable_if magic to avoid memcpying between differing types.
Original commit message:
SmallVector: Resolve a long-standing fixme by using the existing unitialized_copy dispatch.
This makes append() use memcpy for trivially copyable types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229149
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 13 Feb 2015 19:45:28 +0000 (19:45 +0000)]
Revert r229142. It breaks the world for unknown reasons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229144
91177308-0d34-0410-b5e6-
96231b3b80d8
Dimitry Andric [Fri, 13 Feb 2015 19:45:19 +0000 (19:45 +0000)]
Increase the CPU time timeout for testing from 10 to 20 minutes, to
compensate for slow machines, and the growing number of tests.
Prodded by: Hans Wennborg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229143
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 13 Feb 2015 19:20:39 +0000 (19:20 +0000)]
SmallVector: Resolve a long-standing fixme by using the existing unitialized_copy dispatch.
This makes append() use memcpy for trivially copyable types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229142
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 13 Feb 2015 19:14:22 +0000 (19:14 +0000)]
[mips] Refactor and simplify MipsSEDAGToDAGISel::selectIntAddrLSL2MM(). NFC.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7618
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229140
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 13 Feb 2015 19:12:16 +0000 (19:12 +0000)]
[mips] Use isa<> instead of dyn_cast<> with unused value. NFC.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7615
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229138
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Feb 2015 19:05:07 +0000 (19:05 +0000)]
R600/SI: Remove handling of fpimm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229136
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Feb 2015 19:05:03 +0000 (19:05 +0000)]
R600/SI: Allow f64 inline immediates in i64 operands
This requires considering the size of the operand when
checking immediate legality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229135
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Feb 2015 19:04:56 +0000 (19:04 +0000)]
R600/SI: Minor test scheduling fixes
This prevents these from failing in a later commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229134
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 18:11:49 +0000 (18:11 +0000)]
Fix -Wunused-variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229130
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 17:57:09 +0000 (17:57 +0000)]
llvm-pdbdump: Improve printing of functions and signatures.
This correctly prints the function pointers, and also prints
function signatures for symbols as opposed to just types. So
actual functions in your program will now be printed with full
name and signature, as opposed to just name as before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229129
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Fri, 13 Feb 2015 17:51:27 +0000 (17:51 +0000)]
[mips][microMIPS] Delay slot filler: Replace the microMIPS JR with the JRC
This patch adds functionality in MIPS delay slot filler such as if delay slot
filler have to put NOP instruction into the delay slot of microMIPS JR
instruction, then instead of emitting NOP this instruction is replaced by
compact jump instruction JRC.
Differential Revision: http://reviews.llvm.org/D7522
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229128
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 13 Feb 2015 16:33:34 +0000 (16:33 +0000)]
[InstCombine] Fix regression introduced at r227197.
This patch fixes a problem I accidentally introduced in an instruction combine
on select instructions added at r227197. That revision taught the instruction
combiner how to fold a cttz/ctlz followed by a icmp plus select into a single
cttz/ctlz with flag 'is_zero_undef' cleared.
However, the new rule added at r227197 would have produced wrong results in the
case where a cttz/ctlz with flag 'is_zero_undef' cleared was follwed by a
zero-extend or truncate. In that case, the folded instruction would have
been inserted in a wrong location thus leaving the CFG in an inconsistent
state.
This patch fixes the problem and add two reproducible test cases to
existing test 'InstCombine/select-cmp-cttz-ctlz.ll'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229124
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Feb 2015 16:15:32 +0000 (16:15 +0000)]
Help: Document how to build and install with CMake.
Resolves PR21569.
Patch by: Stephen Kelly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229122
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 13 Feb 2015 16:15:29 +0000 (16:15 +0000)]
Help: Document the minimum CMake version required.
Patch by: Stephen Kelly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229121
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 13 Feb 2015 16:00:03 +0000 (16:00 +0000)]
Add run line that was missing in r228999.
Also, change the run lines to use -allow-empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229118
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Fri, 13 Feb 2015 14:15:48 +0000 (14:15 +0000)]
[CodeGenPrepare] Removed duplicate logic. SimplifyCFG already knows how to speculate calls to cttz/ctlz.
SimplifyCFG now knows how to speculate calls to intrinsic cttz/ctlz that are
'cheap' for the target. Therefore, some of the logic in CodeGenPrepare
that was originally added at revision 224899 can now be removed.
This patch is basically a no functional change. It removes the duplicated
logic in CodeGenPrepare and converts all the existing target specific tests
for cttz/ctlz into SimplifyCFG tests.
Differential Revision: http://reviews.llvm.org/D7608
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229105
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Fri, 13 Feb 2015 12:04:42 +0000 (12:04 +0000)]
[PBQP] Conservativelly allocatable nodes can be spilled and give a better solution
Although such nodes are allocatable, the cost of spilling may be less than
allocating to register, so spilling the node may provide a better solution.
The assert does not account for this case, so remove it for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229103
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Fri, 13 Feb 2015 11:08:40 +0000 (11:08 +0000)]
[SimplifyCFG] Add test for r229099
Add extra test that was accidentally not staged.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229101
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Fri, 13 Feb 2015 10:48:30 +0000 (10:48 +0000)]
[SimplifyCFG] Be more aggressive
Up the phi node folding threshold from a cheap "1" to a meagre "2".
Update tests for extra added selects and slight code churn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229099
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Fri, 13 Feb 2015 10:30:57 +0000 (10:30 +0000)]
[mips] Improve support for the .set at/noat assembler directives.
Summary:
Made the following changes:
Added calls to emitDirectiveSetNoAt() and emitDirectiveSetAt().
Added special emit function for .set at=$reg, emitDirectiveSetAtWithArg(unsigned RegNo).
Improved parsing error checks for .set at.
Refactored parser code for .set at.
Improved testing of both directives.
Improved code readability and comments.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229097
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 10:21:05 +0000 (10:21 +0000)]
[PM] Update the examples to reflect the removal of the
llvm/PassManager.h wrapper header and its using declarations. These now
directly use the legacy namespace.
I had updated the #include lines in my large commit but forgot that the
examples weren't being built and didn't update the code to use the
correct namespace. Sorry for the noise here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229095
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 10:01:29 +0000 (10:01 +0000)]
[PM] Remove the old 'PassManager.h' header file at the top level of
LLVM's include tree and the use of using declarations to hide the
'legacy' namespace for the old pass manager.
This undoes the primary modules-hostile change I made to keep
out-of-tree targets building. I sent an email inquiring about whether
this would be reasonable to do at this phase and people seemed fine with
it, so making it a reality. This should allow us to start bootstrapping
with modules to a certain extent along with making it easier to mix and
match headers in general.
The updates to any code for users of LLVM are very mechanical. Switch
from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h".
Qualify the types which now produce compile errors with "legacy::". The
most common ones are "PassManager", "PassManagerBase", and
"FunctionPassManager".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229094
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 09:14:30 +0000 (09:14 +0000)]
Re-sort the #include lines in bindings and examples which I managed to
miss previously.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229089
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 09:09:03 +0000 (09:09 +0000)]
Re-sort #include lines using my handy dandy ./utils/sort_includes.py
script. This is in preparation for changes to lots of include lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229088
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 07:55:29 +0000 (07:55 +0000)]
Fix the windows build *again*. Grrr, MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229081
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 07:52:39 +0000 (07:52 +0000)]
Revert a series of commits starting at r228886 which is triggering some
regressions for LLDB on Linux. Rafael indicated on lldb-dev that we
should just go ahead and revert these but that he wasn't at a computer.
The patches backed out are as follows:
r228980: Add support for having multiple sections with the name and ...
r228889: Invert the section relocation map.
r228888: Use the existing SymbolTableIndex intsead of doing a lookup.
r228886: Create the Section -> Rel Section map when it is first needed.
These patches look pretty nice to me, so hoping its not too hard to get
them re-instated. =D
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229080
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 07:45:49 +0000 (07:45 +0000)]
Fix non-windows builds unhappy about a missing header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229079
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 07:42:25 +0000 (07:42 +0000)]
[X86] Add support for parsing and printing the mnemonic aliases for the XOP VPCOM instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229078
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 07:42:15 +0000 (07:42 +0000)]
[X86] Fix XOP vpcom intrinsic autoupgrade to map 'true' and 'false' to the correct immediates. Seems they were swapped.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229077
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 07:40:03 +0000 (07:40 +0000)]
llvm-pdbdump: Add more comprehensive dumping of symbol types.
In particular this patch adds the ability to dump complete
function signature information including argument types as
correctly formatted strings. A side effect of this is that
almost all symbol and meta types are now formatted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229076
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 13 Feb 2015 07:38:04 +0000 (07:38 +0000)]
InstCombine: cleanup redundant dyn_cast<> (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229075
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 06:07:29 +0000 (06:07 +0000)]
Fix a typo in a comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229071
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 06:07:27 +0000 (06:07 +0000)]
Fix probable typo in test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229070
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 06:07:24 +0000 (06:07 +0000)]
[X86] Remove int_x86_sse2_psll_dq_bs and int_x86_sse2_psrl_dq_bs intrinsics. The builtins aren't used by clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229069
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 13 Feb 2015 06:07:14 +0000 (06:07 +0000)]
[X86] Remove references to builtin names that have been removed from clang. Hope to remove the intrinsics themselves soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229068
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 05:31:46 +0000 (05:31 +0000)]
[unroll] Concede defeat and disable the unroll analyzer for now.
The issues with the new unroll analyzer are more fundamental than code
cleanup, algorithm, or data structure changes. I've sent an email to the
original commit thread with details and a proposal for how to redesign
things. I'm disabling this for now so that we don't spend time
debugging issues with it in its current state.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229064
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Fri, 13 Feb 2015 04:51:26 +0000 (04:51 +0000)]
[InstCombine] Fix a bug when combining `icmp` from `ptrtoint`
- First, there's a crash when we try to combine that pointers into `icmp`
directly by creating a `bitcast`, which is invalid if that two pointers are
from different address spaces.
- It's not always appropriate to cast one pointer to another if they are from
different address spaces as that is not no-op cast. Instead, we only combine
`icmp` from `ptrtoint` if that two pointers are of the same address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229063
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:39:05 +0000 (04:39 +0000)]
[unroll] Merge the simplification and DCE estimation methods on the
UnrollAnalyzer.
Now they share a single worklist and have less implicit state between
them. There was no real benefit to separating these two things out.
I'm going to subsequently refactor things to share even more code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229062
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:33:21 +0000 (04:33 +0000)]
[unroll] Remove pointless dyn_cast<>s to Instruction - the users of an
instruction must by definition be instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229061
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:30:44 +0000 (04:30 +0000)]
[unroll] Don't check the loop set for whether an instruction is
contained in it each time we try to add it to the worklist, just check
this when pulling it off the worklist. That way we do it at most once
per instruction with the cost of the worklist set we would need to pay
anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229060
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:27:50 +0000 (04:27 +0000)]
[unroll] Change the other worklist in the unroll analyzer to be a set
vector.
In addition to dramatically reducing the work required for contrived
example loops, this also has to correct some serious latent bugs in the
cost computation. Previously, we might add an instruction onto the
worklist once for every load which it used and was simplified. Then we
would visit it many times and accumulate "savings" each time.
I mean, fortunately this couldn't matter for things like calls with 100s
of operands, but even for binary operators this code seems like it must
be double counting the savings.
I just noticed this by inspection and due to the runtime problems it can
introduce, I don't have any test cases for cases where the cost produced
by this routine is unacceptable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229059
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:18:14 +0000 (04:18 +0000)]
[unroll] Replace a boolean, for loop, condition, and break with
std::all_of and a lambda. Much cleaner, no functionality
changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229058
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:14:05 +0000 (04:14 +0000)]
[unroll] Directly query for dead instructions.
In the unroll analyzer, it is checking each user to see if that user
will become dead. However, it first checked if that user was missing
from the simplified values map, and then if was also missing from the
dead instructions set. We add everything from the simplified values map
to the dead instructions set, so the first step is completely subsumed
by the second. Moreover, the first step requires *inserting* something
into the simplified value map which isn't what we want at all.
This also replaces a dyn_cast with a cast as an instruction cannot be
used by a non-instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229057
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 04:06:08 +0000 (04:06 +0000)]
[unroll] Replace a linear time check for no uses with a constant time
check.
Also hoist this into the enqueue process as it is faster even than
testing the worklist set, we should just directly filter these out much
like we filter out constants and such.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229056
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 03:57:40 +0000 (03:57 +0000)]
[unroll] Rather than an operand set, use a setvector for the worklist.
We don't just want to handle duplicate operands within an instruction,
but also duplicates across operands of different instructions. I should
have gone straight to this, but I had convinced myself that it wasn't
going to be necessary briefly. I've come to my senses after chatting
more with Nick, and am now happier here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229054
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 03:49:41 +0000 (03:49 +0000)]
[unroll] Extract the code to enqueue operansd for the worklist in the
unroll analysis into a lambda and call it. That's much simpler than
duplicating all the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229053
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 03:48:38 +0000 (03:48 +0000)]
[unroll] Use a small set to de-duplicate operands prior to putting them
into the worklist. This avoids allocating lots of worklist memory for
them when there are large numbers of repeated operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229052
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 03:40:58 +0000 (03:40 +0000)]
[unroll] Make the unroll cost analysis terminate deterministically and
reasonably quickly.
I don't have a reduced test case, but for a version of FFMPEG, this
makes the loop unroller start finishing at all (after over 15 minutes of
running, it hadn't terminated for me, no idea if it was a true infloop
or just exponential work).
The key thing here is to check the DeadInstructions set when pulling
things off the worklist. Without this, we would re-walk the user list of
already dead instructions again and again and again. Consider phi nodes
with many, many operands and other patterns.
The other important aspect of this is that because we would keep
re-visiting instructions that were already known dead, we kept adding
their cost savings to this! This would cause our cost savings to be
*insanely* inflated from this.
While I was here, I also rotated the operand walk out of the worklist
loop to make the code easier to read. There is still work to be done to
minimize worklist traffic because we don't de-duplicate operands. This
means we may add the same instruction onto the worklist 1000s of times
if it shows up in 1000s of operansd to a PHI node for example.
Still, with this patch, the ffmpeg testcase I have finishes quickly and
I can't measure the runtime impact of the unroll analysis any more. I'll
probably try to do a few more cleanups to this code, but not sure how
much cleanup I can justify right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229038
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 03:35:29 +0000 (03:35 +0000)]
IR: Drop never-used defaults for DIBuilder::createTemplate*(), NFC
No caller specifies anything different; these parameters are dead code
and probably always have been. The new hierarchy doesn't bother with
the fields at all (see r228607 and r228652).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229037
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 13 Feb 2015 02:47:22 +0000 (02:47 +0000)]
R600/SI: Remove unnecessary check for fpimm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229034
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 02:45:17 +0000 (02:45 +0000)]
[unroll] Make range based for loops a bit more explicit and more
readable.
The biggest thing that was causing me problems is recognizing the
references vs. poniters here. I also found that for maps naming the loop
variable as KeyValue helps make it obvious why you don't actually use it
directly. Finally, using 'auto' instead of 'User *' doesn't seem like
a good tradeoff. Much like with the other cases, I like to know its
a pointer, and 'User' is just as long and tells the reader a lot more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229033
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 02:43:38 +0000 (02:43 +0000)]
Bitcode: Remove confusing '?' from r229004, NFC
The name is always part of the record, it just might be empty. Remove
the `?` for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229032
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 02:41:36 +0000 (02:41 +0000)]
Bitcode: Add trailing comma to MetadataCodes, NFC
Suggested in the review of r229004, this should simplify diffs
in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229031
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 02:30:01 +0000 (02:30 +0000)]
[IC] Fix a bug with the instcombine canonicalizing of loads and
propagating of metadata.
We were propagating !nonnull metadata even when the newly formed load is
no longer of a pointer type. This is clearly broken and results in LLVM
failing the verifier and aborting. This patch just restricts the
propagation of !nonnull metadata to when we actually have a pointer
type.
This bug report and the initial version of this patch was provided by
Charles Davis! Many thanks for finding this!
We still need to add logic to round-trip the metadata correctly if we
combine from pointer types to integer types and then back by using range
metadata for the integer type loads. But this is the minimal and safe
version of the patch, which is important so we can backport it into 3.6.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229029
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 02:17:39 +0000 (02:17 +0000)]
[unroll] Avoid the "Insn" abbreviation of Instruction. This is quite
hard to type and read for me, and is inconsistent with the other
abbreviation in the base class "Inst". For most of these (where they are
used widely) I prefer just spelling it out as Instruction. I've changed
two of the short-lived variables to use "Inst" to match the base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229028
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Sallenave [Fri, 13 Feb 2015 02:13:57 +0000 (02:13 +0000)]
Check interleaving without relying on debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229027
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 02:10:56 +0000 (02:10 +0000)]
[unroll] Tidy up the integer we use to accumululate the number of
instructions optimized. NFC, just separating this out from the
functionality changing commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229026
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:46:02 +0000 (01:46 +0000)]
AsmWriter/Bitcode: MDImportedEntity
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229025
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:43:22 +0000 (01:43 +0000)]
AsmWriter/Bitcode: MDObjCProperty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229024
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:42:09 +0000 (01:42 +0000)]
AsmWriter/Bitcode: MDExpression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229023
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:39:44 +0000 (01:39 +0000)]
AsmWriter/Bitcode: MDLocalVariable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229022
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 01:39:22 +0000 (01:39 +0000)]
Fix the build, I forgot to check that UnitTests still built.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229021
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:35:40 +0000 (01:35 +0000)]
AsmWriter/Bitcode: MDGlobalVariable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229020
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:34:32 +0000 (01:34 +0000)]
AsmWriter/Bitcode: MDTemplate{Type,Value}Parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229019
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:32:09 +0000 (01:32 +0000)]
AsmWriter/Bitcode: MDNamespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229018
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:30:42 +0000 (01:30 +0000)]
AsmWriter/Bitcode: MDLexicalBlockFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229017
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:29:28 +0000 (01:29 +0000)]
AsmWriter/Bitcode: MDLexicalBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229016
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:28:16 +0000 (01:28 +0000)]
AsmWriter: MDSubprogram: Recognize DW_VIRTUALITY in 'virtuality'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229015
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:26:47 +0000 (01:26 +0000)]
AsmWriter/Bitcode: MDSubprogram
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229014
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:25:10 +0000 (01:25 +0000)]
AsmWriter/Bitcode: MDCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229013
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 13 Feb 2015 01:23:51 +0000 (01:23 +0000)]
Improve llvm-pdbdump output display.
This patch adds a number of improvements to llvm-pdbdump.
1) Dumping of the entire global scope, and not only those
symbols that live in individual compilands.
2) Prepend class name to member functions and data
3) Improved display of bitfields.
4) Support for dumping more kinds of data symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229012
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:22:59 +0000 (01:22 +0000)]
AsmWriter/Bitcode: MDSubroutineType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229011
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:21:25 +0000 (01:21 +0000)]
AsmWriter: MDCompositeType: Recognize DW_LANG in 'runtimeLang'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229010
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:20:38 +0000 (01:20 +0000)]
AsmWriter/Bitcode: MDDerivedType and MDCompositeType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229009
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:19:14 +0000 (01:19 +0000)]
AsmWriter/Bitcode: MDFile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229007
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:17:35 +0000 (01:17 +0000)]
AsmWriter: MDBasicType: Recognize DW_ATE in 'encoding'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229006
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:14:58 +0000 (01:14 +0000)]
AsmWriter/Bitcode: MDBasicType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229005
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:14:11 +0000 (01:14 +0000)]
AsmWriter/Bitcode: MDEnumerator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229004
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:10:38 +0000 (01:10 +0000)]
AsmWriter/Bitcode: MDSubrange
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229003
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:07:46 +0000 (01:07 +0000)]
IR: Add MDExpression::ExprOperand
Port `DIExpression::Operand` over to `MDExpression::ExprOperand`. The
logic is needed directly in `MDExpression` to support printing in
assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229002
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:05:00 +0000 (01:05 +0000)]
Support: Add dwarf::getOperationEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229001
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 13 Feb 2015 01:04:08 +0000 (01:04 +0000)]
Support: Rewrite LocationAtom and OperationEncodingString(), NFC
Use `Dwarf.def` more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229000
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 13 Feb 2015 00:40:41 +0000 (00:40 +0000)]
[LinkModules] Change the way ModuleLinker merges triples.
This commit makes the following changes:
- Stop issuing a warning when the triples' string representations do not match
exactly if the Triple objects generated from the strings compare equal.
- On Apple platforms, choose the triple that has the larger minimum version
number.
rdar://problem/
16743513
Differential Revision: http://reviews.llvm.org/D7591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228999
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:38 +0000 (00:39 +0000)]
PPCFrameLowering's FramePointerOffset can be computed at initialization
time. Do so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228998
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:36 +0000 (00:39 +0000)]
The TOC save offset can be computed at compile time, do so and
propagate changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228997
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 13 Feb 2015 00:39:27 +0000 (00:39 +0000)]
The return save offset can be computed at initialization time - do
so and save the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228996
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 13 Feb 2015 00:35:45 +0000 (00:35 +0000)]
Testcase for r228988.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228995
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 00:29:39 +0000 (00:29 +0000)]
[unroll] Don't use a map from pointer to bool. Use a set.
This is much more efficient. In particular, the query with the user
instruction has to insert a false for every missing instruction into the
set. This is just a cleanup a long the way to fixing the underlying
algorithm problems here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228994
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 13 Feb 2015 00:21:34 +0000 (00:21 +0000)]
llvm/test/Transforms/LoopVectorize/PowerPC/small-loop-rdx.ll REQUIRES +Asserts due to -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228989
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 13 Feb 2015 00:17:03 +0000 (00:17 +0000)]
Prevent division by 0.
When we try to estimate number of potentially removed instructions in
loop unroller, we analyze first N iterations and then scale the
computed number by TripCount/N. We should bail out early if N is 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228988
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 13 Feb 2015 00:00:24 +0000 (00:00 +0000)]
[unroll] Update the new analysis logic from r228265 to use modern coding
conventions for function names consistently. Some were already using
this but not all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228987
91177308-0d34-0410-b5e6-
96231b3b80d8