Jingyue Wu [Tue, 9 Jun 2015 00:05:56 +0000 (00:05 +0000)]
[NVPTX] run SROA after NVPTXFavorNonGenericAddrSpaces
Summary:
This cleans up most allocas NVPTXLowerKernelArgs emits for byval
parameters.
Test Plan: makes bug21465.ll more stronger to verify no redundant local load/store.
Reviewers: eliben, jholewinski
Reviewed By: eliben, jholewinski
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10322
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239368
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Tue, 9 Jun 2015 00:03:29 +0000 (00:03 +0000)]
MergeFunctions: Impose a total order on the replacement of functions
We don't want to replace function A by Function B in one module and Function B
by Function A in another module.
If these functions are marked with linkonce_odr we would end up with a function
stub calling B in one module and a function stub calling A in another module. If
the linker decides to pick these two we will have two stubs calling each other.
rdar://
21265586
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239367
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jun 2015 22:43:32 +0000 (22:43 +0000)]
[WinEH] Cache declarations of frame intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239361
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jun 2015 22:12:44 +0000 (22:12 +0000)]
[MC] Use unsigned for the Kind bitfield in MCSymbol
Fixes most of the test suite on Windows with clang-cl.
I'm not sure why the test suite was passing with MSVC 2013. Maybe they
changed their behavior and we are emulating their old sign extension
behavior. I think this deserves more investigation, but I want to green
the bot first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239357
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 8 Jun 2015 21:57:57 +0000 (21:57 +0000)]
Fix clang-cl self-host -Wc++11-narrowing bug
Use unsigned as the underlying storage type of the AMDGPU address space
enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239355
91177308-0d34-0410-b5e6-
96231b3b80d8
Ranjeet Singh [Mon, 8 Jun 2015 21:32:16 +0000 (21:32 +0000)]
[AArch64] AsmParser should be case insensitive about accepting vector register names.
Differential Revision: http://reviews.llvm.org/D10320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239353
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Mon, 8 Jun 2015 20:09:58 +0000 (20:09 +0000)]
[InstrInfo] Refactor foldOperandImpl to thread through InsertPt. NFC
Summary:
This was a longstanding FIXME and is a necessary precursor to cases
where foldOperandImpl may have to create more than one instruction
(e.g. to constrain a register class). This is the split out NFC changes from
D6262.
Reviewers: pete, ributzka, uweigand, mcrosier
Reviewed By: mcrosier
Subscribers: mcrosier, ted, llvm-commits
Differential Revision: http://reviews.llvm.org/D10174
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239336
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 8 Jun 2015 20:08:55 +0000 (20:08 +0000)]
Fix a regression in .pop_section.
It was calling ChangeSection with the wrong current section, eventually leading
to a crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239335
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 8 Jun 2015 19:58:43 +0000 (19:58 +0000)]
[X86][SSE] Added lzcnt vector tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239333
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 8 Jun 2015 19:03:32 +0000 (19:03 +0000)]
Include header file <functional>.
This is a follow-up to r239325.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239329
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 8 Jun 2015 18:58:57 +0000 (18:58 +0000)]
Prefer copy init over direct init. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239327
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Mon, 8 Jun 2015 18:50:43 +0000 (18:50 +0000)]
[ARM] Pass a callback to FunctionPass constructors to enable skipping execution
on a per-function basis.
Previously some of the passes were conditionally added to ARM's pass pipeline
based on the target machine's subtarget. This patch makes changes to add those
passes unconditionally and execute them conditonally based on the predicate
functor passed to the pass constructors. This enables running different sets of
passes for different functions in the module.
rdar://problem/
20542263
Differential Revision: http://reviews.llvm.org/D8717
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239325
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 18:41:57 +0000 (18:41 +0000)]
Use a PointerUnion in MCSymbol for Section and Fragment. NFC.
The Fragment and Section, and a bool for HasFragment were all used to create
a PointerUnion. Just use a pointer union instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239324
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:25:57 +0000 (17:25 +0000)]
Remove includes of MCMachOSymbolFlags.h after it was deleted
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239318
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:30 +0000 (17:17 +0000)]
Make flags get/set method protected so that all flags have to be managed by subclasses.
All of ELF, COFF and MachO now manipulate the flags in helpers so we don't need
anyone to read the flags directly, but instead via those helpers.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239317
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:28 +0000 (17:17 +0000)]
Move all flags logic to MCSymbolMachO.
Also delete the now unused MCMachOSymbolFlags.h header as the only enum in there was moved to MCSymbolMachO.
Similarly to ELF and COFF, manipulating the flags is now done via helpers instead of spread
throughout the codebase.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239316
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:23 +0000 (17:17 +0000)]
Add MCSymbolMachO which will be used to hide the MCSymbolMachO flags.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239315
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:19 +0000 (17:17 +0000)]
Move all of the MCSymbol COFF flags logic in to MCSymbolCOFF.
All flags setting/getting is now done in the class with helper methods instead
of users having to get the bits in the correct order.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239314
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:16 +0000 (17:17 +0000)]
Move COFF Type in to the MCSymbolCOFF class.
The flags field in MCSymbol only needs to be 16-bits on ELF and MachO.
This moves the 16-bit Type out of there so that it can be reduced in size in a future commit.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239313
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:12 +0000 (17:17 +0000)]
Add MCSymbolCOFF class and use it to get and set the COFF type field.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239312
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Mon, 8 Jun 2015 17:17:09 +0000 (17:17 +0000)]
Change MCSymbol IsELF to an enum to support future MCSymbolCOFF and MCSymbolMachO.
Reviewed by Rafael Espíndola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239311
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Mon, 8 Jun 2015 16:56:23 +0000 (16:56 +0000)]
X86: Reject register operands with obvious type mismatches.
While we have some code to transform specification like {ax} into
{eax}/{rax} if the operand type isn't 16bit, we should reject cases
where there is no sane way to do this, like the i128 type in the
example.
Related to rdar://
21042280
Differential Revision: http://reviews.llvm.org/D10260
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239309
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Mon, 8 Jun 2015 16:55:31 +0000 (16:55 +0000)]
Fix assertion failure in global-merge with unused ConstantExpr
The global-merge pass was crashing because it assumes that all ConstantExprs
(reached via the global variables that they use) have at least one user.
I haven't worked out a way to test this, as an unused ConstantExpr cannot be
represented by serialised IR, and global-merge can only be run in llc, which
does not run any passes which can make a ConstantExpr dead.
This (reduced to the point of silliness) C code triggers this bug when compiled
for arm-none-eabi at -O1:
static a = 7;
static volatile b[10] = {&a};
c;
main() {
c = 0;
for (; c < 10;)
printf(b[c]);
}
Differential Revision: http://reviews.llvm.org/D10314
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239308
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 8 Jun 2015 16:34:47 +0000 (16:34 +0000)]
[Hexagon] Adding functionality for searching for compound instruction pairs. Compound instructions reduce slot resource requirements freeing those packet slots up for more instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239307
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 8 Jun 2015 16:19:00 +0000 (16:19 +0000)]
[DAGCombiner] Added CTLZ vector constant folding support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239305
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 8 Jun 2015 15:21:38 +0000 (15:21 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239303
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Mon, 8 Jun 2015 15:01:11 +0000 (15:01 +0000)]
ARM]: Add support for MMFR4_EL1 in assembler
This patch adds support for system register MMFR4_EL1 (memory model feature register) in the assembler.
This register provides information about the implemented memory model and memory management support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239302
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Mon, 8 Jun 2015 14:10:23 +0000 (14:10 +0000)]
[Mips64][mcjit] Add R_MIPS_PC32 relocation
This patch adds R_MIPS_PC32 relocation for Mips64.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D10235
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239301
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 8 Jun 2015 14:03:17 +0000 (14:03 +0000)]
AVX-512: Implemented 256/128bit VALIGND/Q instructions for SKX and KNL
Implemented DAG lowering for all these forms.
Added tests for DAG lowering and encoding.
Differential Revision: http://reviews.llvm.org/D10310
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239300
91177308-0d34-0410-b5e6-
96231b3b80d8
Artur Pilipenko [Mon, 8 Jun 2015 11:58:13 +0000 (11:58 +0000)]
Minor refactoring of GEP handling in isDereferenceablePointer
For GEP instructions isDereferenceablePointer checks that all indices are constant and within bounds. Replace this index calculation logic to a call to accumulateConstantOffset. Separated from the http://reviews.llvm.org/D9791
Reviewed By: sanjoy
Differential Revision: http://reviews.llvm.org/D9874
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239299
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Mon, 8 Jun 2015 10:27:06 +0000 (10:27 +0000)]
[LAA] Fix estimation of number of memchecks
Summary:
We need to add a runtime memcheck for pair of accesses (x,y) where at least one of x and y
are writes.
Assuming we have w writes and r reads, currently this number is estimated as being
w* (w+r-1). This estimation will count (write,write) pairs twice and will overestimate
the number of checks required.
This change adds a getNumberOfChecks method to RuntimePointerCheck, which
will count the number of runtime checks needed (similar in implementation to
needsAnyChecking) and uses it to produce the correct number of runtime checks.
Test Plan:
llvm test suite
spec2k
spec2k6
Performance results: no changes observed (not surprising since the formula for 1 writer is basically the same, which would covers most cases - at least with the current check limit).
Reviewers: anemet
Reviewed By: anemet
Subscribers: mzolotukhin, llvm-commits
Differential Revision: http://reviews.llvm.org/D10217
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239295
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 8 Jun 2015 09:57:09 +0000 (09:57 +0000)]
[DAGCombiner] Added CTTZ vector constant folding support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239293
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 8 Jun 2015 06:39:56 +0000 (06:39 +0000)]
[LoopVectorize] Teach Loop Vectorizor about interleaved memory accesses.
Interleaved memory accesses are grouped and vectorized into vector load/store and shufflevector.
E.g. for (i = 0; i < N; i+=2) {
a = A[i]; // load of even element
b = A[i+1]; // load of odd element
... // operations on a, b, c, d
A[i] = c; // store of even element
A[i+1] = d; // store of odd element
}
The loads of even and odd elements are identified as an interleave load group, which will be transfered into vectorized IRs like:
%wide.vec = load <8 x i32>, <8 x i32>* %ptr
%vec.even = shufflevector <8 x i32> %wide.vec, <8 x i32> undef, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%vec.odd = shufflevector <8 x i32> %wide.vec, <8 x i32> undef, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
The stores of even and odd elements are identified as an interleave store group, which will be transfered into vectorized IRs like:
%interleaved.vec = shufflevector <4 x i32> %vec.even, %vec.odd, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7>
store <8 x i32> %interleaved.vec, <8 x i32>* %ptr
This optimization is currently disabled by defaut. To try it by adding '-enable-interleaved-mem-accesses=true'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239291
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 8 Jun 2015 04:55:29 +0000 (04:55 +0000)]
[llvm-readobj] Use the new symbol API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239286
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 8 Jun 2015 04:48:37 +0000 (04:48 +0000)]
[LoopAccessAnalysis] Teach LAA to check the memory dependence between strided accesses.
Differential Revision: http://reviews.llvm.org/D9368
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239285
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 8 Jun 2015 04:04:13 +0000 (04:04 +0000)]
Do not build LLD from tools/Makefile, as LLD no longer has a Makefile build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239283
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Mon, 8 Jun 2015 03:28:06 +0000 (03:28 +0000)]
Remove SCEVCache and FindConstantPointers from complete loop unrolling heuristic.
Summary:
Using some SCEV functionality helped to entirely remove SCEVCache class and FindConstantPointers SCEV visitor.
Also, this makes the code more universal - I'll take advandate of it in next patches where I start handling additional types of instructions.
Test Plan: Tests would be submitted in subsequent patches.
Reviewers: atrick, chandlerc
Reviewed By: atrick, chandlerc
Subscribers: atrick, llvm-commits
Differential Revision: http://reviews.llvm.org/D10205
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239282
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 8 Jun 2015 02:43:32 +0000 (02:43 +0000)]
Fix Windows build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239279
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 8 Jun 2015 02:32:01 +0000 (02:32 +0000)]
llvm-ar: Move archive writer to Object.
No functional change intended, other than some minor changes to certain
diagnostics.
Differential Revision: http://reviews.llvm.org/D10296
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239278
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jun 2015 01:35:45 +0000 (01:35 +0000)]
[TableGen] Remove unnecessary default constructed SMLoc that just existed to return. Instead just call the default constructor in the return.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239277
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jun 2015 01:35:43 +0000 (01:35 +0000)]
[TableGen] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239276
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jun 2015 01:35:42 +0000 (01:35 +0000)]
[TableGen] Remove unnecessary extern declaration that's already in an included header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239275
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 8 Jun 2015 01:35:40 +0000 (01:35 +0000)]
[TableGen] Use the SMLoc header file instead of SourceMgr header file in a couple places. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239274
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 7 Jun 2015 21:07:17 +0000 (21:07 +0000)]
[objdump] Moving PrintImmHex out of MachODump and in to llvm-objdump and setting instprinter appropriately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239265
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 7 Jun 2015 21:01:34 +0000 (21:01 +0000)]
[X86] Added tzcnt vector tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239264
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 7 Jun 2015 20:29:37 +0000 (20:29 +0000)]
[MC] Function naming NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239263
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 7 Jun 2015 20:17:44 +0000 (20:17 +0000)]
SeparateConstOffsetFromGEP: Pass address space to isLegalAddressingMode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239262
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 7 Jun 2015 20:17:42 +0000 (20:17 +0000)]
Make NaryReassociate pass the address space to isLegalAddressingMode
No test since the kinds of transforms this prevents seem to not really
be relevant for SI's different addressing modes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239261
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 7 Jun 2015 20:12:03 +0000 (20:12 +0000)]
Add isLegalAddressingMode address space argument to TTI
Update to match the TLI version, and remove the TLI version's
default argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239260
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Sun, 7 Jun 2015 19:22:22 +0000 (19:22 +0000)]
[cmake] [OCaml] Make ocamldoc targets depend on output files
OCaml doc builds fail without .cmi files, and .cmi files are collected
in ocaml_outputs. Therefore, make doc targets depend on ocaml_outputs as
well.
Fixes: https://llvm.org/bugs/show_bug.cgi?id=23777
Patch by Michał Górny <mgorny@gentoo.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239259
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 7 Jun 2015 18:34:25 +0000 (18:34 +0000)]
[X86] Added BitScanForward/BitScanReverse memory folding + tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239257
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 7 Jun 2015 16:36:28 +0000 (16:36 +0000)]
Remove global std::string. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239254
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 7 Jun 2015 16:09:48 +0000 (16:09 +0000)]
Fixed line endings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239253
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 7 Jun 2015 15:37:14 +0000 (15:37 +0000)]
[DAGCombiner] Added CTPOP vector constant folding support.
Added tests to the existing SSE/AVX test files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239252
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 7 Jun 2015 13:59:33 +0000 (13:59 +0000)]
[AsmWriter] Rewrite module asm printing using StringRef::split.
No change in output intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239251
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Sun, 7 Jun 2015 06:40:24 +0000 (06:40 +0000)]
Fix doxygen comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239250
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 7 Jun 2015 06:01:22 +0000 (06:01 +0000)]
[TableGen] Remove unnecessary include. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239249
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 7 Jun 2015 06:01:19 +0000 (06:01 +0000)]
[TableGen] Remove unnecessary forward declaration. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239248
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 7 Jun 2015 06:01:17 +0000 (06:01 +0000)]
[TableGen] Write one of the Record constructors in terms of the other constructor to reduce code duplication. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239247
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 7 Jun 2015 06:01:15 +0000 (06:01 +0000)]
[TableGen] Remove unused function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239246
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 7 Jun 2015 06:01:13 +0000 (06:01 +0000)]
[TableGen] Use 'isa' to check if something is an UnsetInit rather than getting the UnsetInit singleton and comparing pointers. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239245
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 7 Jun 2015 02:45:19 +0000 (02:45 +0000)]
[Object/ELF] Don't confuse isDefined() and isCommon.
Reported by Rafael Espindola. Pointy-hat to me.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239241
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sun, 7 Jun 2015 01:46:24 +0000 (01:46 +0000)]
Teaching llvm-mc how to understand the defsym command line option. This allows integer-constant symbols to be defined on the command line and used during assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239240
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 6 Jun 2015 22:54:09 +0000 (22:54 +0000)]
[Object/ELF] Provide helpers for symbol types.
These were, originally, in a different form in lld.
They can be reused for other tools, e.g. llvm-readobj.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239231
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jun 2015 22:40:21 +0000 (22:40 +0000)]
[InstCombine, InstSimplify] Move xforms from Combine to Simplify
There were several SelectInst combines that always returned an existing
instruction instead of modifying an old one or creating a new one.
These are prime candidates for moving to InstSimplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239229
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Sat, 6 Jun 2015 20:44:53 +0000 (20:44 +0000)]
Use early return idiom. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239228
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sat, 6 Jun 2015 20:12:40 +0000 (20:12 +0000)]
[MC] Common symbols weren't being checked for redeclaration which allowed an assembly file to generate an assertion in setCommon(): !isCommon(). This change allows redeclaration as long as the size and alignment match exactly, otherwise report a fatal error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239227
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 6 Jun 2015 05:24:10 +0000 (05:24 +0000)]
[LoopUnroll] Fix truncation bug in canUnrollCompletely.
Summary:
canUnrollCompletely takes `unsigned` values for `UnrolledCost` and
`RolledDynamicCost` but is passed in `uint64_t`s that are silently
truncated. Because of this, when `UnrolledSize` is a large integer
that has a small remainder with UINT32_MAX, LLVM tries to completely
unroll loops with high trip counts.
Reviewers: mzolotukhin, chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10293
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239218
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jun 2015 04:56:51 +0000 (04:56 +0000)]
[CVP] Don't assume Constants of type i1 can be known to be true or false
CVP wants to analyze the condition operand of a select along an edge.
It succeeds in getting back a Constant but not a ConstantInt. Instead,
it gets a ConstantExpr. It then assumes that the Constant must be equal
to false because it isn't equal to true.
Instead, perform an additional comparison.
This fixes PR23752.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239217
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 6 Jun 2015 02:30:43 +0000 (02:30 +0000)]
[InstCombine] Don't miscompile select to poison
If we have (select a, b, c), it is sometimes valid to simplify this to a
single select operand. However, doing so is only valid if the
computation doesn't inject poison into the computation.
It might be helpful to consider the following example:
(select (icmp ne %i, INT_MAX), (add nsw %i, 1), INT_MIN)
The select is equivalent to (add %i, 1) but not (add nsw %i, 1).
Self hosting on x86_64 revealed that this occurs very, very rarely so
bailing out is hopefully pretty reasonable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239215
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 6 Jun 2015 02:29:56 +0000 (02:29 +0000)]
Handle 16 bit PC relative relocations.
Fixes pr23771.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239214
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 6 Jun 2015 01:41:35 +0000 (01:41 +0000)]
TargetParser: Fix comments in enum(s) introduced in r239150. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239211
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 01:34:04 +0000 (01:34 +0000)]
[TableGen] Change OpInit::getNumOperands and getOperand to use unsigned integers. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239210
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 01:34:01 +0000 (01:34 +0000)]
[TableGen] Remove trailing whitespace, add space between 'if' and paren, other formatting fixes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239209
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 01:34:00 +0000 (01:34 +0000)]
[TableGen] Remove unnecessary temporary. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239208
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 01:33:58 +0000 (01:33 +0000)]
[TableGen] Fold variable declaration/initialization into if condition for a couple short lived variables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239207
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 01:33:55 +0000 (01:33 +0000)]
[TableGen] Remove unnecessary outer 'if' and merge it's conditions into the inner 'if's. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239206
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 00:44:45 +0000 (00:44 +0000)]
[TableGen] Fold variable declarations with their assignments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239205
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 6 Jun 2015 00:44:42 +0000 (00:44 +0000)]
[TableGen] Correct the documentation for 'foreach' in the Language Intro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239204
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 23:46:18 +0000 (23:46 +0000)]
[dsymutil] Fix misspelled CHECK line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239200
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 23:06:11 +0000 (23:06 +0000)]
[dsymutil] Add support for linking the debug_frame section.
Linking the debug frame section is actually very easy as we just have to
patch the start address in the FDE header and then copy the rest of the
FDE without even looking at it. The only small complexity comes from the
handling of the CIEs that we should unique across object file. This is
also really easy by using a StringMap keyed on the raw contents of the
CIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239198
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Fri, 5 Jun 2015 21:58:14 +0000 (21:58 +0000)]
Move the code in TargetPassConfig::addPass that inserts machine printer pass to
the overloaded version of addPass which takes Pass*.
This change enables inserting the machine printer pass when the overloaded
version of addPass that takes Pass* is called to add a pass, instead of the
one which takes AnalysisID. I need this to prevent make-check tests from
failing when I commit another patch later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239192
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 21:21:57 +0000 (21:21 +0000)]
[dsymutil] Rename a variable to appease some bots.
Anyway having the type and the name of the member being the same
thing wasn't the wisest of the choices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239190
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 21:12:07 +0000 (21:12 +0000)]
[dsymutil] Have the YAML deserialization rewrite the object address of symbols.
The main use of the YAML debug map format is for testing inside LLVM. If we have IR
files in the tests used to generate object files, then we obviously don't know the
addresses of the symbols inside the object files beforehand.
This change lets the YAML import lookup the addresses in the object files and rewrite
them. This will allow to have test that really don't need any binary input.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239189
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 20:27:07 +0000 (20:27 +0000)]
[dsymutil] Apply clang-format. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239186
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 20:27:04 +0000 (20:27 +0000)]
[dsymutil] Out-line the YAML serialization code. NFC
It will get a bit bigger in an upcoming commit. No need to have all
of that in the header.
Also move parseYAMLDebugMap() to the same place as the serialization
code. This way it will be able to share a private Context object with
it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239185
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Fri, 5 Jun 2015 18:24:12 +0000 (18:24 +0000)]
Revert "[InstCombine] Rephrase fix to SimplifyWithOpReplaced"
This reverts commit r239141. This commit was an attempt to reintroduce
a previous patch that broke many self-hosting bots with clang timeouts,
but it still has slowdown issues, at least on ARM, increasing the
compilation time (stage 2, clang's) by 5x.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239175
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jun 2015 18:21:00 +0000 (18:21 +0000)]
Refactor padding writing into a helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239174
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 5 Jun 2015 18:04:46 +0000 (18:04 +0000)]
[InstCombine][NFC] Add a ``break;`` statement.
This change is NFC because both the ``break;`` and the fall through end
up returning immediately. However, this helps clarify intent and also
ensures correctness in case more ``case`` blocks are added later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239172
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 5 Jun 2015 18:04:42 +0000 (18:04 +0000)]
[InstCombine] Fix PR23751.
PR23751 was caused by a missing ``break;`` in r234388.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239171
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 5 Jun 2015 18:01:28 +0000 (18:01 +0000)]
Revert r238473, "Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM."
as it caused miscompilations and assertion failures (PR23768,
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20150601/280380.html).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239169
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 5 Jun 2015 17:54:25 +0000 (17:54 +0000)]
Save a map lookup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239168
91177308-0d34-0410-b5e6-
96231b3b80d8
Fiona Glaser [Fri, 5 Jun 2015 17:52:34 +0000 (17:52 +0000)]
DAGCombiner: don't duplicate (fmul x, c) in visitFNEG if fneg is free
For targets with a free fneg, this fold is always a net loss if it
ends up duplicating the multiply, so definitely avoid it.
This might be true for some targets without a free fneg too, but
I'll leave that for future investigation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239167
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 5 Jun 2015 17:48:47 +0000 (17:48 +0000)]
Rangify more for loops in LegacyPassManager.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239166
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 5 Jun 2015 17:22:00 +0000 (17:22 +0000)]
Remove stray semi-colon, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239165
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 5 Jun 2015 17:01:43 +0000 (17:01 +0000)]
[Unroll] Rework the naming and structure of the new unroll heuristics.
The new naming is (to me) much easier to understand. Here is a summary
of the new state of the world:
- '*Threshold' is the threshold for full unrolling. It is measured
against the estimated unrolled cost as computed by getUserCost in TTI
(or CodeMetrics, etc). We will exceed this threshold when unrolling
loops where unrolling exposes a significant degree of simplification
of the logic within the loop.
- '*PercentDynamicCostSavedThreshold' is the percentage of the loop's
estimated dynamic execution cost which needs to be saved by unrolling
to apply a discount to the estimated unrolled cost.
- '*DynamicCostSavingsDiscount' is the discount applied to the estimated
unrolling cost when the dynamic savings are expected to be high.
When actually analyzing the loop, we now produce both an estimated
unrolled cost, and an estimated rolled cost. The rolled cost is notably
a dynamic estimate based on our analysis of the expected execution of
each iteration.
While we're still working to build up the infrastructure for making
these estimates, to me it is much more clear *how* to make them better
when they have reasonably descriptive names. For example, we may want to
apply estimated (from heuristics or profiles) dynamic execution weights
to the *dynamic* cost estimates. If we start doing that, we would also
need to track the static unrolled cost and the dynamic unrolled cost, as
only the latter could reasonably be weighted by profile information.
This patch is sadly not without functionality change for the new unroll
analysis logic. Buried in the heuristic management were several things
that surprised me. For example, we never subtracted the optimized
instruction count off when comparing against the unroll heursistics!
I don't know if this just got lost somewhere along the way or what, but
with the new accounting of things, this is much easier to keep track of
and we use the post-simplification cost estimate to compare to the
thresholds, and use the dynamic cost reduction ratio to select whether
we can exceed the baseline threshold.
The old values of these flags also don't necessarily make sense. My
impression is that none of these thresholds or discounts have been tuned
yet, and so they're just arbitrary placehold numbers. As such, I've not
bothered to adjust for the fact that this is now a discount and not
a tow-tier threshold model. We need to tune all these values once the
logic is ready to be enabled.
Differential Revision: http://reviews.llvm.org/D9966
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239164
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 5 Jun 2015 16:35:44 +0000 (16:35 +0000)]
[dsymutil] Handle the -oso-prepend-path option when the input is a YAML debug map
All the tests using a YAML debug map will need this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239163
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Fri, 5 Jun 2015 16:11:14 +0000 (16:11 +0000)]
[bpf] rename triple names bpf_be -> bpfeb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239162
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 5 Jun 2015 16:00:11 +0000 (16:00 +0000)]
[Hexagon] Reapply r239097 with tests corrected for shuffling and duplexing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239161
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Fri, 5 Jun 2015 15:32:38 +0000 (15:32 +0000)]
Revert "Include BPF target in CMake builds."
This reverts commit r239035
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239159
91177308-0d34-0410-b5e6-
96231b3b80d8