Commit Graph

117688 Commits

Author SHA1 Message Date
Matthias Braun
63e9bfa72b ARMLoadStoreOptimizer: Code cleanup; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238289 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:40 +00:00
Matthias Braun
f5b4273058 MachineBasicBlock: Cleanup computeRegisterLiveness()
- Clean documentation comment
- Change the API to accept an iterator so you can actually pass
  MachineBasicBlock::end() now.
- Add more "const".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238288 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:39 +00:00
Matthias Braun
299e50237a MCSymbol: Make print() robust against empty names
This shouldn't happen, but it's nice not to abort when printing broken machine
functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 05:12:37 +00:00
Rui Ueyama
e498b5094c Object/COFF: Add accessors for import header bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 02:55:04 +00:00
Chandler Carruth
34afa06cf2 [inliner] Fix the early-exit of the inline cost analysis to correctly
model the dense vector instruction bonuses.

Previously, this code really didn't effectively compute the density of
inlined vector instructions and apply the intended inliner bonus. It
would try to compute it repeatedly while analyzing the function and
didn't handle the case where future vector instructions would tip the
scales back towards the bonus.

Instead, speculatively apply all possible bonuses to the threshold
initially. Once we *know* that a certain bonus can not be applied,
subtract it. This should delay early bailout enough to get much more
consistent results without actually causing us to analyze huge swaths of
code. I expect some (hopefully mild) compile time hit here, and some
swings in performance, but this was definitely the intended behavior of
these bonuses.

This also dramatically simplifies the computation of the bonuses to not
interact with each other in confusing ways. The previous code didn't do
a good job of this and the values for bonuses may be surprising but are
at least now clearly written in the code.

Finally, fix code to be in line with comments and use zero as the
bailout condition.

Patch by Easwaran Raman, with some comment tweaks by me to try and
further clarify what is going on with this code.

http://reviews.llvm.org/D8267

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 02:49:05 +00:00
Rui Ueyama
7306f3b6f5 Object/COFF: Add coff_import_header.
This type is described in the PE/COFF spec section 7.1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 02:40:20 +00:00
Filipe Cabecinhas
1c0b496636 [BitcodeReader] Change assert to report_fatal_error
It can be triggered by user input.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:05:40 +00:00
Filipe Cabecinhas
316f9e05ce [BitstreamReader] Make sure the Array operand type is an encoding
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:48:43 +00:00
Filipe Cabecinhas
ba7ccd4201 clang-format a couple of lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:48:37 +00:00
Filipe Cabecinhas
c756772b8d [BitcodeReader] Make sure abbrev records have at least one operand (record code)
Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238265 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:52:21 +00:00
Owen Anderson
13146c7e3b Add initial support for the convergent attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238264 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:48:40 +00:00
Filipe Cabecinhas
1c74d4768a [BitcodeReader] Sanity check on Comdat ID
Shouldn't be an assert, since user input can trigger it.

Bug found with AFL fuzz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238261 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 23:00:56 +00:00
Rafael Espindola
116e31ffbe clang-format TargetRegistry.h. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238255 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 21:18:29 +00:00
Philip Reames
90b5eb2319 [PlaceSafepoints] Entry safepoint location doesn't need to be a terminator
Long ago, the poll insertion code assumed that the insertion site was a terminator.  As a result, the entry selection code would split a basic block to ensure it could pass a terminator.  The insertion code was updated quite a while ago - possibly before it ever landed upstream - but the now redundant work was never removed.  

While I'm at it, remove a comment which doesn't apply to the upstreamed code.  

NFC intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238254 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 21:16:42 +00:00
Philip Reames
d59f970668 [PlaceSafepoints] Cleanup InsertSafepointPoll function
While working on another change, I noticed that the naming in this function was mildly deceptive.  While fixing that, I took the oppurtunity to modernize some of the code.  NFC intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238252 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 21:03:23 +00:00
Kostya Serebryany
ea8a3963b4 [lib/Fuzzer] make the fuzzing timeout 1200 seconds by default (was: infinity)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:57:47 +00:00
Rafael Espindola
8a7b4ea2ad Simplify boolean conditional return statements.
Patch by Richard <legalize@xmission.com>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238250 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:37:36 +00:00
Rui Ueyama
30244cec4f Object/COFF: Add COFFSymbolRef::isAbsolute().
COFFSymbolRef has many predicates, like isCommon() or
isExternal(), but this predicate was missing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238247 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:25:30 +00:00
Akira Hatanaka
6f49135066 Remove NoFramePointerElim and NoFramePointerElimOverride from TargetOptions and
remove ExecutionEngine's dependence on CodeGen. NFC.

This is a follow-up to r238080.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238244 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:17:20 +00:00
Adrian Prantl
2cc3e0a5ec Use "auto &" in range-based for-loop and remove the extra braces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238243 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:06:51 +00:00
Adrian Prantl
74f44b6c69 Fix a use-after-free in a DEBUG output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238242 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 20:06:48 +00:00
Kostya Serebryany
e4af3b4160 [lib/Fuzzer] fix docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238236 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:32:52 +00:00
Kostya Serebryany
f580f3683c [lib/Fuzzer] fix build with assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238235 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:29:33 +00:00
Rafael Espindola
890a876e0e Print "lock \t foo" instead of "lock \n foo".
This gets gas and llc -filetype=obj to agree on the order of prefixes.

For llvm-mc we need to fix the asm parser to know that it makes a difference
on which line the "lock" is in.

Part of pr23594.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238232 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:35:10 +00:00
Jan Vesely
176d1faf6a R600: Use SIGN_EXTEND_INREG for SEXT loads
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238229 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:07:22 +00:00
Jan Vesely
0704171907 R600: Add comments to subword private address load lowering code
v2: Use C++ comments and end with periods

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238228 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 18:07:21 +00:00
Diego Novillo
9c24c958f1 Revert "Re-commit changes in r237579 with fix for bug breaking windows builds."
This reverts commit r238201 to fix linking problems in x86 Linux
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150525/278413.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238223 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 17:45:38 +00:00
Matt Arsenault
69dd37580c Make EmitFunctionHeader virtual
This is to fix problems introduced by r232481. For HSAIL,
this function does essentially nothing desirable, and
injects unwanted / incorrect stuff before the function.
The only thing it really needs to do is call EmitFunctionEntryLabel
in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238222 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 17:33:15 +00:00
Matt Arsenault
c068b91ae1 Forgot to add lit.local.cfg for new R600 directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 17:01:16 +00:00
Matt Arsenault
a0dd2b4df8 CodeGenPrepare: Don't match addressing modes through addrspacecast
This was resulting in the addrspacecast being removed and incorrectly
replaced with a ptrtoint when sinking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 16:59:43 +00:00
Rui Ueyama
013041ad5c Object/COFF: Define .idata import directory table entry.
This data type is described in the Microsoft PE/COFF spec rev. 8.3 5.4.1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 16:24:42 +00:00
Rui Ueyama
5a22e848da Object: Add Archive::getNumberOfSymbols().
Add a function that returns number of symbols in archive headers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 16:20:40 +00:00
Tom Stellard
8352b74577 R600/SI: Add assembler support for all CI and VI VOP2 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:55:52 +00:00
Tom Stellard
75775939fa AsmMatcherEmitter: Add an option to override custom converters for InstAlias
If there is an InstAlias defined for an instruction that had a custom
converter (AsmMatchConverter), then when the alias is matched,
the custom converter will be used rather than the converter generated
by the InstAlias.

This patch adds the UseInstAsmMatchConverter field to the InstAlias
class, which allows you to override this behavior and force the
converter generated by the InstAlias to be used.

This is required for some future improvemnts to the R600 assembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:55:50 +00:00
Rafael Espindola
b14ebd6a1d Replace getOrCreateSectionData with registerSection.
There is now no SectionData to be created.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238208 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 15:07:25 +00:00
Rafael Espindola
9ec47b85c7 Remove dead forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238205 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:51:03 +00:00
Rafael Espindola
7ff8c5c348 Have getCurrentSectionData return a MCSection.
I will fix the name shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238204 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:48:11 +00:00
Rafael Espindola
da68b18db5 Pass a MCSection to getCurrentSectionData.
A step towards merging MCSection and MCSectionData.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238203 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 14:42:52 +00:00
Luke Cheeseman
262e24f7af Re-commit changes in r237579 with fix for bug breaking windows builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 13:40:31 +00:00
Luke Cheeseman
617dbfc31e Test Commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238199 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 13:10:35 +00:00
Elena Demikhovsky
001a2ba63f AVX-512: fixed a bug in arithmetic operations lowering for i1 type
https://llvm.org/bugs/show_bug.cgi?id=23630



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 12:37:17 +00:00
Daniel Sanders
9ed9b04cea Fix warning introduced in r238190 about lack of virtual destructor in MCObjectFileInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 12:25:36 +00:00
Elena Demikhovsky
55fd78065f AVX-512: fixed a bug in lowering VSELECT for 512-bit vector
https://llvm.org/bugs/show_bug.cgi?id=23634



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 11:32:39 +00:00
Michael Kuperstein
d714fcf5c8 Use std::bitset for SubtargetFeatures.
Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first several times this was committed (e.g. r229831, r233055), it caused several buildbot failures.
Apparently the reason for most failures was both clang and gcc's inability to deal with large numbers (> 10K) of bitset constructor calls in tablegen-generated initializers of instruction info tables. 
This should now be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:47:10 +00:00
Daniel Sanders
bda72d8098 [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
Summary:
Following on from r209907 which made personality encodings indirect, do the
same for TType encodings. This fixes the case where a try/catch block needs
to generate references to, for example, std::exception in the
.gcc_except_table.

This commit uses DW_EH_PE_sdata8 for N64 as far as is possible at the moment.
However, it is possible to end up with DW_EH_PE_sdata4 when a TargetMachine is
not available. There's no risk of issues with inconsistency here since the
tables are self describing but it does mean there is a small chance of the
PC-relative offset being out of range for particularly large programs.

Reviewers: petarj

Reviewed By: petarj

Subscribers: srhines, joerg, tberghammer, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 10:19:18 +00:00
Simon Atanasyan
eda9f8aa74 [mips] Move some structures represent MIPS specific ELF sections from LLD to LLVM
That allows to reuse the code in other tools like llvm-readobj etc.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238188 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:48:14 +00:00
Craig Topper
7b0f8fc600 [TableGen] Fix line wrapping logic for the autogenerated header to use math that makes more sense (at least to me).
The old code had a bug if the description was between 75 and 85 characters or so as it substracted PSLen from Desc.size() instead of MAX_LINE_LEN in the compare. It also calculated odd values for PosE on the last split and just let StringRef::slice take care of it being larger than the description string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:56 +00:00
Craig Topper
c9739ec212 [TableGen] Rewrite an assert to not do a bunch unsigned math and then try to ensure the result is a positive number.
I think the fact that it was explicitly excluding 0 kept this from being a tautology. The exclusion of 0 for the old math was also a bug that's easily hit if the description gets split into multiple lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:49 +00:00
Craig Topper
88008cb710 [TableGen] Put a space between '*' and description in the autogenerated tablegen header. Minor cleanup in surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 08:07:45 +00:00
Craig Topper
d0185f83c6 [TableGen] Fix indentation. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 06:48:47 +00:00