OSDN Git Service
Rafael Espindola [Fri, 29 May 2015 20:41:47 +0000 (20:41 +0000)]
Remove the MCSymbolData typedef.
The getData member function is next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238611
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 20:31:23 +0000 (20:31 +0000)]
Merge MCSymbol and MCSymbolData.
As a transition hack leave MCSymbolData as a typedef of MCSymbol. I will be
removing that in a second.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238609
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 29 May 2015 20:31:17 +0000 (20:31 +0000)]
[lib/Fuzzer] relax an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238608
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 20:21:02 +0000 (20:21 +0000)]
Rename getOrCreateSymbolData to registerSymbol and return void.
Another step in merging MCSymbol and MCSymbolData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238607
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 29 May 2015 19:43:39 +0000 (19:43 +0000)]
Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types
If the type isn't trivially moveable emplace can skip a potentially
expensive move. It also saves a couple of characters.
Call sites were found with the ASTMatcher + some semi-automated cleanup.
memberCallExpr(
argumentCountIs(1), callee(methodDecl(hasName("push_back"))),
on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))),
hasArgument(0, bindTemporaryExpr(
hasType(recordDecl(hasNonTrivialDestructor())),
has(constructExpr()))),
unless(isInTemplateInstantiation()))
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238602
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 19:07:51 +0000 (19:07 +0000)]
Move Flags from MCSymbolData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238598
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 19:04:38 +0000 (19:04 +0000)]
Fix build without asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238597
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:47:23 +0000 (18:47 +0000)]
Pass MCSymbols to the helper functions in MCELF.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238596
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 29 May 2015 18:34:41 +0000 (18:34 +0000)]
[CMake] Bug 23468 - LLVM_OPTIMIZED_TABLEGEN does not work with Visual Studio
Summary: Multi-configuration builds put their binaries into ${CMAKE_BINARY_DIR}/Release/bin/. The table-gen cross-compilation support needs to take that into account.
Reviewers: yaron.keren
Reviewed By: yaron.keren
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10102
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238592
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:31:17 +0000 (18:31 +0000)]
Use an explicitly defaulted constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238591
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 18:26:09 +0000 (18:26 +0000)]
Pass a MCSymbol to needsRelocateWithSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238589
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 29 May 2015 18:19:25 +0000 (18:19 +0000)]
MachineCopyPropagation: Remove the copies instead of using KILL instructions.
For some history here see the commit messages of r199797 and r169060.
The original intent was to fix cases like:
%EAX<def> = COPY %ECX<kill>, %RAX<imp-def>
%RCX<def> = COPY %RAX<kill>
where simply removing the copies would have RCX undefined as in terms of
machine operands only the ECX part of it is defined. The machine
verifier would complain about this so 169060 changed such COPY
instructions into KILL instructions so some super-register imp-defs
would be preserved. In r199797 it was finally decided to always do this
regardless of super-register defs.
But this is wrong, consider:
R1 = COPY R0
...
R0 = COPY R1
getting changed to:
R1 = KILL R0
...
R0 = KILL R1
It now looks like R0 dies at the first KILL and won't be alive until the
second KILL, while in reality R0 is alive and must not change in this
part of the program.
As this only happens after register allocation there is not much code
still performing liveness queries so the issue was not noticed. In fact
I didn't manage to create a testcase for this, without unrelated changes
I am working on at the moment.
The fix is simple: As of r223896 the MachineVerifier allows reads from
partially defined registers, so the whole transforming COPY->KILL thing
is not necessary anymore. This patch also changes a similar (but more
benign case as the def and src are the same register) case in the
VirtRegRewriter.
Differential Revision: http://reviews.llvm.org/D10117
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238588
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 May 2015 18:14:55 +0000 (18:14 +0000)]
YAML traits need to be in the llvm::yaml namespace.
Hope this fixes the bits, eg:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/27147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238586
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 29 May 2015 17:56:28 +0000 (17:56 +0000)]
[YAMLIO] Make line-wrapping configurable and test it.
Summary:
We would wrap flow mappings and sequences when they go over a hardcoded 70
characters limit. Make the wrapping column configurable (and default to 70
co the change should be NFC for current users). Passing 0 allows to completely
suppress the wrapping which makes it easier to handle in tools like FileCheck.
Reviewers: bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10109
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238584
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:48:04 +0000 (17:48 +0000)]
Move common symbol related information from MCSectionData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238583
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:41:59 +0000 (17:41 +0000)]
Store MCSymbols in PendingLabels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238582
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 17:24:52 +0000 (17:24 +0000)]
Move SymbolSize from MCSymbolData to MCSymbol.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238580
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 29 May 2015 17:19:11 +0000 (17:19 +0000)]
Fix crash in MCExpr::print.
Symbols are no longer required to be named, but this leads to a crash here if an
unnamed symbol checks that its first character is '$'.
Change the code to first check for a name, then check its first character.
No test case i'm afraid as this is debugging code, but any test case with temp labels
and 'llc --debug --filetype=obj' would have crashed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238579
91177308-0d34-0410-b5e6-
96231b3b80d8
Nemanja Ivanovic [Fri, 29 May 2015 17:13:25 +0000 (17:13 +0000)]
Add support for VSX FMA single-precision instructions to the PPC back end
This patch corresponds to review:
http://reviews.llvm.org/D9941
It adds the various FMA instructions introduced in the version 2.07 of
the ISA along with the testing for them. These are operations on single
precision scalar values in VSX registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238578
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 29 May 2015 17:05:41 +0000 (17:05 +0000)]
MIR Serialization: use correct line and column numbers for LLVM IR errors.
This commit translates the line and column numbers for LLVM IR
errors from the numbers in the YAML block scalar to the numbers
in the MIR file so that the MIRParser users can report LLVM IR
errors with the correct line and column numbers.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10108
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238576
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 29 May 2015 17:00:57 +0000 (17:00 +0000)]
[WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86
Small (really small!) C++ exception handling examples work on 32-bit x86
now.
This change disables the use of .seh_* directives in WinException when
CFI is not in use. It also uses absolute symbol references in the tables
instead of imagerel32 relocations.
Also fixes a cache invalidation bug in MMI personality classification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238575
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 May 2015 17:00:27 +0000 (17:00 +0000)]
[NVPTXFavorNonGenericAddrSpaces] recursively trace into GEP and BitCast
Summary:
This patch allows NVPTXFavorNonGenericAddrSpaces to remove addrspacecast
from longer chains consisting of GEPs and BitCasts. For example, it can
now optimize
%0 = addrspacecast [10 x float] addrspace(3)* @a to [10 x float]*
%1 = gep [10 x float]* %0, i64 0, i64 %i
%2 = bitcast float* %1 to i32*
%3 = load i32* %2 ; emits ld.u32
to
%0 = gep [10 x float] addrspace(3)* @a, i64 0, i64 %i
%1 = bitcast float addrspace(3)* %0 to i32 addrspace(3)*
%3 = load i32 addrspace(3)* %1 ; emits ld.shared.f32
Test Plan: @ld_int_from_global_float in access-non-generic.ll
Reviewers: broune, eliben, jholewinski, meheff
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D10074
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238574
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 29 May 2015 16:58:08 +0000 (16:58 +0000)]
[DependenceAnalysis] Extend unifySubscriptType for handling coupled subscript groups.
Summary:
In continuation to an earlier commit to DependenceAnalysis.cpp by jingyue (r222100), the type for all subscripts in a coupled group need to be the same since constraints from one subscript may be propagated to another during testing. During testing, new SCEVs may be created and the operands for these need to be the same.
This patch extends unifySubscriptType() to work on lists of subscript pairs, ensuring a common extended type for all of them.
Test Plan:
Added a test case to NonCanonicalizedSubscript.ll which causes dependence analysis to crash without this fix.
All regression tests pass.
Reviewers: spop, sebpop, jingyue
Reviewed By: jingyue
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9698
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238573
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 15:07:27 +0000 (15:07 +0000)]
Simplify now that symbols contain the correct section.
The complexity in here was because before r233995 variable symbols would report
the incorrect section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238559
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 29 May 2015 14:48:25 +0000 (14:48 +0000)]
[Objdump] Removing unused parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238557
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 29 May 2015 14:44:13 +0000 (14:44 +0000)]
[Hexagon] Disassembling, printing, and emitting instructions a whole-bundle at a time which is the semantic unit for Hexagon. Fixing tests to use the new format. Disabling tests in the direct object emission path for a followup patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238556
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 29 May 2015 14:20:40 +0000 (14:20 +0000)]
Fix ELFObjectWriter::isLocal for signature symbols.
And with that simplify the logic for inserting them in ExternalSymbolData or
LocalSymbolData.
No functionality change overall since the old code avoided the isLocal bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238555
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Fri, 29 May 2015 13:52:56 +0000 (13:52 +0000)]
[mips] Remove 2 unused variables in MipsTargetStreamer.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238554
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 29 May 2015 13:00:07 +0000 (13:00 +0000)]
Removing a switch statement that only contains a default; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238552
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 29 May 2015 05:51:32 +0000 (05:51 +0000)]
[TableGen] Remove convertValue functions for UnOpInit, BinOpInit, and TernOpInit as they weren't able to be called.
I don't think converting the inputs to the Ops was the right behavior anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238543
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 29 May 2015 02:59:59 +0000 (02:59 +0000)]
This should have been a reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238540
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 29 May 2015 02:56:46 +0000 (02:56 +0000)]
CodeGen: Use mop_iterator instead of MIOperands/ConstMIOperands
MIOperands/ConstMIOperands are classes iterating over the MachineOperand
of a MachineInstr, however MachineInstr::mop_iterator does the same
thing.
I assume these two iterators exist to have a uniform interface to
iterate over the operands of a machine instruction bundle and a single
machine instruction. However in practice I find it more confusing to have 2
different iterator classes, so this patch transforms (nearly all) the
code to use mop_iterators.
The only exception being MIOperands::anlayzePhysReg() and
MIOperands::analyzeVirtReg() still needing an equivalent, I leave that
as an exercise for the next patch.
Differential Revision: http://reviews.llvm.org/D9932
This version is slightly modified from the proposed revision in that it
introduces MachineInstr::getOperandNo to avoid the extra counting
variable in the few loops that previously used MIOperands::getOperandNo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238539
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 29 May 2015 01:40:00 +0000 (01:40 +0000)]
Add a test for the MachineCopyPropagation change landed in r238518.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238537
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 29 May 2015 01:03:37 +0000 (01:03 +0000)]
[TableGen][AsmMatcherEmitter] Only parse isolated tokens as registers.
Fixes PR23455, where, when TableGen generates the matcher from the
AsmString, it splits "cmp${cc}ss" into tokens, and the "ss" suffix
is recognized as the SS register.
I can't think of a situation where that's a feature, not a bug, hence:
when a token is "isolated", i.e., it is followed and preceded by
separators, it shouldn't be parsed as a register.
Differential Revision: http://reviews.llvm.org/D9844
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238536
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 29 May 2015 00:55:55 +0000 (00:55 +0000)]
[TableGen][AsmMatcherEmitter] Factor out AsmOperand creation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238534
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 29 May 2015 00:04:30 +0000 (00:04 +0000)]
[IR] fptrunc-of-fptrunc isn't an EliminableCastPair.
Double and single rounding can produce different results.
This is the IR counterpart to r228911.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238531
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 28 May 2015 23:20:35 +0000 (23:20 +0000)]
MachineFrameInfo: Simplify pristine register calculation.
About pristine regsiters:
Pristine registers "hold a value that is useless to the current
function, but that must be preserved - they are callee saved registers
that have not been saved." This concept saves compile time as it frees
the prologue/epilogue inserter from adding every such register to every
basic blocks live-in list.
However the current code in getPristineRegs is formulated in a
complicated way: Inside the function prologue and epilogue all callee
saves are considered pristine, while in the rest of the code only the
non-saved ones are considered pristine. This requires logic to
differentiate between prologue/epilogue and the rest and in the presence
of shrink-wrapping this even becomes complicated/expensive. It's also
unnecessary because the prologue epilogue inserters already mark
callee-save registers that are saved/restores properly in the respective
blocks in the prologue/epilogue (see updateLiveness() in
PrologueEpilogueInserter.cpp). So only declaring non-saved/restored
callee saved registers as pristine just works.
Differential Revision: http://reviews.llvm.org/D10101
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238524
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 28 May 2015 23:07:39 +0000 (23:07 +0000)]
Fix typos in variable/grammar names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238523
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 22:47:01 +0000 (22:47 +0000)]
Rename Win64Exception.(cpp|h) to WinException.(cpp|h)
This is in preparation for reusing this for 32-bit x86 EH table
emission. Also updates the type name for consistency. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238521
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 28 May 2015 22:46:48 +0000 (22:46 +0000)]
[x86] Move the vector popcount tests into non-ISA files, and instead
organize them by the width of vector.
This makes it a lot easier to see that we're covering all of the vector
types but not doing so excessively. This also adds tests across the
spectrum of SSE versions in addition to the AVX versions.
If you're really tired of seeing the *massive* sprawl of scalarized code
for this, don't worry, I'm just about to land Bruno's patch that
dramatically improve the situation for SSSE3 and newer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238520
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 28 May 2015 22:41:12 +0000 (22:41 +0000)]
MIR Serialization: print and parse machine function names.
This commit introduces a serializable structure called
'llvm::yaml::MachineFunction' that stores the machine
function's name. This structure will mirror the machine
function's state in the future.
This commit prints machine functions as YAML documents
containing a YAML mapping that stores the state of a machine
function. This commit also parses the YAML documents
that contain the machine functions.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D9841
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238519
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 28 May 2015 22:38:40 +0000 (22:38 +0000)]
[MachineCopyPropagation] Fix a bug with undef handling when the value is actualy alive.
Test case will follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238518
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 22:18:34 +0000 (22:18 +0000)]
Fixing broken bots after r238505.
Need non-const iterator inserts too. These failures seem to be due to differences in the versions of libstdc++ on various operating systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238516
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 22:12:27 +0000 (22:12 +0000)]
Add testcase for r238503.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238515
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 22:00:24 +0000 (22:00 +0000)]
[WinEH] Start inserting state number stores for C++ EH
This moves all the state numbering code for C++ EH to WinEHPrepare so
that we can call it from the X86 state numbering IR pass that runs
before isel.
Now we just call the same state numbering machinery and insert a bunch
of stores. It also populates MachineModuleInfo with information about
the current function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238514
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 21:59:34 +0000 (21:59 +0000)]
Don't special case undefined symbol when deciding the symbol order.
ELF has no restrictions on where undefined symbols go relative to other defined
symbols. In fact, gas just sorts them together. Do the same.
This was there since r111174 probably just because the MachO writer has it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238513
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 28 May 2015 21:57:17 +0000 (21:57 +0000)]
Update documentation for llvm-profdata.
These options have been present for a while, but I had never updated the
documentation. Fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238511
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 21:51:52 +0000 (21:51 +0000)]
Fixing the polly build.
I broke the polly build in r238505. This fixes the failure by adding non-const iterator erase methods to cl::list_storage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238509
91177308-0d34-0410-b5e6-
96231b3b80d8
Andy Ayers [Thu, 28 May 2015 21:49:50 +0000 (21:49 +0000)]
Revise test to run llc and llvm-mc separately.
Differential Revision: http://reviews.llvm.org/D10066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238508
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Thu, 28 May 2015 21:49:07 +0000 (21:49 +0000)]
Enable exitValue rewrite only when the cost of expansion is low.
The patch evaluates the expansion cost of exitValue in indVarSimplify pass, and only does the rewriting when the expansion cost is low or loop can be deleted with the rewriting. It provides an option "-replexitval=" to control the default aggressiveness of the exitvalue rewriting. It also fixes some missing cases in SCEVExpander::isHighCostExpansionHelper to enhance the evaluation of SCEV expansion cost.
Differential Revision: http://reviews.llvm.org/D9800
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238507
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 21:36:02 +0000 (21:36 +0000)]
Remove a trivial forwarding function. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238506
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 21:31:22 +0000 (21:31 +0000)]
Re-landing "Refactoring cl::list_storage from "is a" to "has a" std::vector."
Originally landed r238485
MSVC resolves identifiers differently from Clang and GCC, this resulted in build bot failures. This pach re-lands r238485 and fixes the build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238505
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 21:29:59 +0000 (21:29 +0000)]
[SelectionDAG] Scalar shift amounts may require legalization
The shift amount may be too small to cope with promoted left hand side,
make sure to promote it as well.
This fixes PR23664.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238503
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 21:23:53 +0000 (21:23 +0000)]
Remove debug prints from r238487
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238501
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 20:59:08 +0000 (20:59 +0000)]
[llvm] Adding vdtor to fix warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238494
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:53:09 +0000 (20:53 +0000)]
Inline trivial method. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238492
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 20:47:02 +0000 (20:47 +0000)]
Revert "Refactoring cl::list_storage from "is a" to "has a" std::vector."
This reverts commit
117715ca0613d3db144241499401f2ec5398f1d5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238491
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 20:44:28 +0000 (20:44 +0000)]
Disable x86 tail call optimizations that jump through GOT
For x86 targets, do not do sibling call optimization when materializing
the callee's address would require a GOT relocation. We can still do
tail calls to internal functions, hidden functions, and protected
functions, because they do not require this kind of relocation. It is
still possible to get GOT relocations when the user explicitly asks for
it with musttail or -tailcallopt, both of which are supposed to
guarantee TCO.
Based on a patch by Chih-hung Hsieh.
Reviewers: srhines, timmurray, danalbert, enh, void, nadav, rnk
Subscribers: joerg, davidxl, llvm-commits
Differential Revision: http://reviews.llvm.org/D9799
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238487
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Thu, 28 May 2015 20:38:12 +0000 (20:38 +0000)]
Refactoring cl::list_storage from "is a" to "has a" std::vector.
Summary: This isn't necessarily an ideal change, and I want to at least reduce the API surface area, but for the new API we really shouldn't be relying on cl::list being a std::vector.
Reviewers: chandlerc
Reviewed By: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10093
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238485
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 28 May 2015 20:30:32 +0000 (20:30 +0000)]
Revert r238427 - [mips] Make TTypeEncoding indirect to allow .eh_frame to be read-only.
It caused a smaller number of failures than the previous attempt at committing but still caused a couple on the llvm-linux-mips builder. Reverting while I investigate the remainder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238483
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 28 May 2015 20:25:42 +0000 (20:25 +0000)]
Object, ELF: Use error code instead of calling report_fatal_error()
Make createELFObjectFile() return object_error::parse_failed on
encountering invalid ELF file, instead of crashing the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238481
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:25:29 +0000 (20:25 +0000)]
Remove structure field that can be computed just before use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238480
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:19:31 +0000 (20:19 +0000)]
Avoid warnings when building without asserts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238479
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:11:34 +0000 (20:11 +0000)]
Move these vectors to the only function where they are used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238477
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 28 May 2015 20:02:45 +0000 (20:02 +0000)]
Thumb2: Modify codegen for memcpy intrinsic to prefer LDM/STM.
We were previously codegen'ing these as regular load/store operations and
hoping that the register allocator would allocate registers in ascending order
so that we could apply an LDM/STM combine after register allocation. According
to the commit that first introduced this code (r37179), we planned to teach
the register allocator to allocate the registers in ascending order. This
never got implemented, and up to now we've been stuck with very poor codegen.
A much simpler approach for achiveing better codegen is to create LDM/STM
instructions with identical sets of virtual registers, let the register
allocator pick arbitrary registers and order register lists when printing an
MCInst. This approach also avoids the need to repeatedly calculate offsets
which ultimately ought to be eliminated pre-RA in order to decrease register
pressure.
This is implemented by lowering the memcpy intrinsic to a series of SD-only
MCOPY pseudo-instructions which performs a memory copy using a given number
of registers. During SD->MI lowering, we lower MCOPY to LDM/STM. This is a
little unusual, but it avoids the need to encode register lists in the SD,
and we can take advantage of SD use lists to decide whether to use the _UPD
variant of the instructions.
Fixes PR9199.
Differential Revision: http://reviews.llvm.org/D9508
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238473
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 28 May 2015 20:02:05 +0000 (20:02 +0000)]
[WinEH] Remove debugging dump() call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238472
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 20:00:13 +0000 (20:00 +0000)]
Merge redundant loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238471
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 19:56:34 +0000 (19:56 +0000)]
AsmPrinter: Stop exposing underlying DIE children list, NFC
Update `DIE` API to hide the implementation of `DIE::Children` so we can
swap it out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238468
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:46:36 +0000 (19:46 +0000)]
Simplify LastLocalSymbolIndex computation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238465
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:43:20 +0000 (19:43 +0000)]
Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238463
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 28 May 2015 19:43:06 +0000 (19:43 +0000)]
Add BranchProbabilityInfo::releaseMemory to clear the Weights field.
BranchProbabilityInfo was leaking 3MB of memory when running 'opt -O2 verify-uselistorder.lto.bc'. This was due to the Weights member not being cleared once the pass is no longer needed.
This adds the releaseMemory override to clear that field. The other fields are cleared at the end of runOnFunction so can stay there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238462
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 19:29:15 +0000 (19:29 +0000)]
Remove temporary FileSymbolData. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238461
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 19:07:14 +0000 (19:07 +0000)]
[Objdump] Allow instruction pretty printing to be specialized by the target triple.
Differential Revision: http://reviews.llvm.org/D8427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238457
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 18:55:38 +0000 (18:55 +0000)]
AsmPrinter: Rename begin_values() => values_begin(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238456
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Thu, 28 May 2015 18:39:50 +0000 (18:39 +0000)]
[llvm] Parameterizing the output stream for dumpbytes and outputting directly to stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238453
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 18:39:17 +0000 (18:39 +0000)]
[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
Currently we only fold a BitCast into a Load when the BitCast is its
only user.
Do the same for any no-op cast.
Differential Revision: http://reviews.llvm.org/D9152
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238452
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 28 May 2015 18:35:18 +0000 (18:35 +0000)]
Add llvm-dwarfdump-fuzzer that uses LibFuzzer to fuzz llvm-dwarfdump tool.
The fuzzer is very simple, but not quite useful at the moment: it's unable
to discover "interesting" examples, as LLVMObject library is terrible at
error recovery, calling "report_fatal_error()" far too often.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238451
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 28 May 2015 18:33:39 +0000 (18:33 +0000)]
Add support for the convergent flag at the MC and MachineInstr levels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238450
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 28 May 2015 18:18:21 +0000 (18:18 +0000)]
Reuse Loc variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238448
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 28 May 2015 18:09:13 +0000 (18:09 +0000)]
AsmPrinter: Suppress warnings on GCC from r238362, NFC
GCC seems to have some overzealous warnings about strict aliasing.
Rafael reports that this patch suppresses them on GCC 4.9, and I'm
hoping this will work for GCC 4.7 as well. I'll watch [1] and iterate
if necessary.
[1]: http://bb.pgr.jp/builders/clang-3stage-x86_64-linux/builds/8597
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238447
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 18:03:20 +0000 (18:03 +0000)]
Use range loops for accessing file names. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238446
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 28 May 2015 18:03:07 +0000 (18:03 +0000)]
Expand the Flags field of MCInstrDesc to 64 bits, while simultaneously
shrinking the Size and NumDefs fields to offset the size growth, and
reordering the fields to preserve a good packing.
This is necessary in the short term for adding a convergent flag, and
simultaneously future-proofs us against more flags being added in the
future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238445
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 17:54:01 +0000 (17:54 +0000)]
Merge computeSymbolTable and writeSymbolTable.
For now this just saves a few loops, but it will allow more simplifications
in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238444
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Nacke [Thu, 28 May 2015 16:23:16 +0000 (16:23 +0000)]
[mips] Add new format for dmtc2/dmfc2 for Octeon CPUs.
Octeon CPUs use dmtc2 rt,imm16 and dmfcp2 rt,imm16 for the crypto coprocessor.
E.g. dmtc2 rt,0x4057 starts calculation of sha-1.
I had to introduce a new deconding namespace to avoid a decoding conflict.
Reviewed By: dsanders
Differential Revision: http://reviews.llvm.org/D10083
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238439
91177308-0d34-0410-b5e6-
96231b3b80d8
Ed Maste [Thu, 28 May 2015 15:38:17 +0000 (15:38 +0000)]
DebugInfo: .debug_line DWARF64 support
This adds support for the 64-bit DWARF format, but is still limited to
less than 4GB of debug data by the DataExtractor class. Some versions
of the GNU MIPS toolchain generate 64-Bit DWARF even though it isn't
actually necessary.
Differential Revision: http://reviews.llvm.org/D1988
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238434
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 28 May 2015 15:20:00 +0000 (15:20 +0000)]
Don't create an unused _GLOBAL_OFFSET_TABLE_.
This was a bug for bug compatibility with gas that is completely unnecessary.
If a _GLOBAL_OFFSET_TABLE_ symbol is used, it will already be created by
the time we get to the ELF writer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238432
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 15:05:18 +0000 (15:05 +0000)]
[ARMTargetParser] Adding sub-arch information for Clang. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238429
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 28 May 2015 14:52:15 +0000 (14:52 +0000)]
[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.
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@238427
91177308-0d34-0410-b5e6-
96231b3b80d8
Petar Jovanovic [Thu, 28 May 2015 13:48:41 +0000 (13:48 +0000)]
[Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6
Add support for resolving MIPS64r2 and MIPS64r6 relocations in MCJIT.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D9667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238424
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 28 May 2015 12:55:59 +0000 (12:55 +0000)]
Silencing two signed/unsigned mismatch warnings; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238419
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 12:55:43 +0000 (12:55 +0000)]
[AsmPrinter] Destroy allocated DIEAbbrevs on teardown.
DIEAbbrev contains a SmallVector that can leak for overly large abbrevs. They
used to be owned by the DIE, but after the recent refactoring DWARFFile
allocates its own abbrevs.
Leak found by asan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238418
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 12:10:37 +0000 (12:10 +0000)]
[ARMTargetParser] Adding a few more CPUs for Clang CPU detection. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238415
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 11:45:32 +0000 (11:45 +0000)]
[MC] Replace custom string join function with the one from StringExtras.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238414
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 28 May 2015 11:24:24 +0000 (11:24 +0000)]
Don't call utostr in Twine/raw_ostream contexts.
Creating temporary std::strings there is unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238412
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 28 May 2015 08:59:03 +0000 (08:59 +0000)]
Fix comments in ARMTargetParser. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238404
91177308-0d34-0410-b5e6-
96231b3b80d8
Yury Gribov [Thu, 28 May 2015 08:03:28 +0000 (08:03 +0000)]
[ASan] Fix previous commit. Patch by Max Ostapenko!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238403
91177308-0d34-0410-b5e6-
96231b3b80d8
Yury Gribov [Thu, 28 May 2015 07:51:49 +0000 (07:51 +0000)]
[ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238402
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 May 2015 06:38:32 +0000 (06:38 +0000)]
[TableGen] Use DefInit::getAsString instead of getDef()->getName(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238399
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 28 May 2015 06:38:28 +0000 (06:38 +0000)]
[TableGen] Don't convert types to strings to query what they are. Just use 'isa'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238398
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 28 May 2015 06:16:39 +0000 (06:16 +0000)]
[Reassociate] Canonicalizing 'x [+-] (-Constant * y)' isn't always a win
Canonicalizing 'x [+-] (-Constant * y)' is not a win if we don't *know*
we will open up CSE opportunities.
If the multiply was 'nsw', then negating 'y' requires us to clear the
'nsw' flag. If this is actually worth pursuing, it is probably more
appropriate to do so in GVN or EarlyCSE.
This fixes PR23675.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238397
91177308-0d34-0410-b5e6-
96231b3b80d8