Ed Maste [Tue, 14 Apr 2015 20:52:58 +0000 (20:52 +0000)]
Correct 'teh' and other typos / repeated words.
Patch by Eitan Adler.
Differential Revision: http://reviews.llvm.org/D8514
llvm-svn: 234939
Rui Ueyama [Tue, 14 Apr 2015 20:39:06 +0000 (20:39 +0000)]
ELF: Remove redundant namespace qualifiers.
llvm-svn: 234938
Reid Kleckner [Tue, 14 Apr 2015 20:38:14 +0000 (20:38 +0000)]
[Inliner] Don't inline functions with frameescape calls
Inlining such intrinsics is very difficult, since you need to
simultaneously transform many calls to llvm.framerecover and potentially
duplicate the functions containing them. Normally this intrinsic isn't
added until EH preparation, which is part of the backend pass pipeline
after inlining. However, if it were to get fed through the inliner,
this change will ensure that it doesn't break the code.
llvm-svn: 234937
Rui Ueyama [Tue, 14 Apr 2015 20:31:56 +0000 (20:31 +0000)]
ELF: Simplify ELFDefinedAtom::contentType().
llvm-svn: 234936
Rui Ueyama [Tue, 14 Apr 2015 20:21:53 +0000 (20:21 +0000)]
ELF: Split Atoms.h to Atoms.{h,cpp}.
llvm-svn: 234935
Rui Ueyama [Tue, 14 Apr 2015 20:12:50 +0000 (20:12 +0000)]
ELF: Split SegmentChunks.h to SegmentChunks.{h,cpp}.
llvm-svn: 234934
Daniel Berlin [Tue, 14 Apr 2015 19:49:26 +0000 (19:49 +0000)]
Only recalculate DFS Numbers if invalid. Invalidate DFS numbers on reset. Add unit test to verify recalculation
llvm-svn: 234933
Rui Ueyama [Tue, 14 Apr 2015 19:48:57 +0000 (19:48 +0000)]
ELF: Split HeaderChunks.h to HeaderChunks.{h,cpp}.
llvm-svn: 234932
Rui Ueyama [Tue, 14 Apr 2015 19:31:42 +0000 (19:31 +0000)]
ELF: Split SectionChunks.h to SectionChunks.{h,cpp}.
The size of AArch64TargetHander.cpp.o is now 4.1MB.
llvm-svn: 234931
Daniel Berlin [Tue, 14 Apr 2015 19:09:16 +0000 (19:09 +0000)]
Make updateDFSNumbers API public
Summary:
There are a number of passes that could be sped up by using dominator tree DFS numbers to order or compare things across multiple bbs
(MemorySSA, MergedLoadStoreMotion, EarlyCSE, Sinking, GVN, NewGVN, for starters :P).
For example, GVN/CSE elimination can be done with a simple stack/etc (instead of full-on scoped hash table or repeated leader set walks)
if the DFS pair is stored next to leaders.
The dominator tree keeps them, and the DOM tree nodes expose them as public, but you have no guarantee they are up to date (and in fact,
if you split blocks or whatever during your pass, they definitely won't be)
This means passes either have to compute their own versions[1], or make 32 queries, or ....
Rather than try to hide this, i just made the API public, and make it do nothing if the numbers are already valid.
[1] Which we want as a non-recursive walk, which is not pretty, sadly,
because it cannot use the depth first iterators since you don't get called on the way back up. So you either have to do one walk with po_iterator
and one with df_iterator, or write your own non-recursive walk that looks identical to the one in updateDFSNumbers.
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8946
llvm-svn: 234930
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 19:04:03 +0000 (19:04 +0000)]
verify-uselistorder: More outs() and errs(), less dbgs()
Change all the normally relevant output in `verify-uselistorder` from
using `dbgs()` to using `outs()` and `errs()`. Now you don't need
`-debug=uselistorder` to figure out what's going on (or at what stage
verification failed, or to get the paths of the left-behind temporary
files). This is a debugging tool, so I put the logging messages on
`outs()` and the error messages on `errs()`.
I also adjusted the output to be less ***loud***. Not sure why I was so
`*`-happy when I first wrote this.
llvm-svn: 234929
Simon Atanasyan [Tue, 14 Apr 2015 18:53:21 +0000 (18:53 +0000)]
[ELF] Use type helper Elf_Word instead of plain uint32_t data type
That helps to correctly write content of hash table if target and host
endianness are not the same. Right now that commit does not affect
any supported targets.
llvm-svn: 234928
Simon Atanasyan [Tue, 14 Apr 2015 18:53:14 +0000 (18:53 +0000)]
[ELF] Write whole std::vector using a single `memcpy` call
We do not need to iterate over `_buckets` and `_chains` vectors and
write all elements one by one.
No functional changes.
llvm-svn: 234927
Simon Atanasyan [Tue, 14 Apr 2015 18:53:09 +0000 (18:53 +0000)]
[ELF] Remove redundant type cast to `char*` before passing array to memcpy
No functional changes.
llvm-svn: 234926
Simon Atanasyan [Tue, 14 Apr 2015 18:53:03 +0000 (18:53 +0000)]
[Mips] Write _DYNAMIC symbol on MIPS targets
llvm-svn: 234925
Simon Atanasyan [Tue, 14 Apr 2015 18:52:55 +0000 (18:52 +0000)]
[Mips] Make tests more tolerant to the program and section headers offsets
No functional changes.
llvm-svn: 234924
Sean Callanan [Tue, 14 Apr 2015 18:50:05 +0000 (18:50 +0000)]
Added some documentation for ForEachMacro.
llvm-svn: 234923
Sean Callanan [Tue, 14 Apr 2015 18:36:17 +0000 (18:36 +0000)]
Added support to ClangUserExpression for importing
all the macros from the modules the user has loaded.
These macros are currently imported textually into
the expression's source code, which turns out not to
impose the horrific string processing overhead that
I thought it would, but I still plan to look into
performance improvements.
Also modified TestCModules to test that this works.
llvm-svn: 234922
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 18:33:00 +0000 (18:33 +0000)]
IR: Set -preserve-bc-uselistorder=false by default
But keep it on by default in `llvm-as`, `opt`, `bugpoint`, `llvm-link`,
`llvm-extract`, and `LTOCodeGenerator`. Part of PR5680.
llvm-svn: 234921
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 18:30:13 +0000 (18:30 +0000)]
IR: Change clang to set -preserve-bc-uselistorder
Change `clang` to set `-preserve-bc-uselistorder` for the driver options
`-emit-llvm` and `-save-temps`. The former is useful for reproducing
results from `clang` in `opt` or `llc`, while the latter prevents
`-save-temps` from affecting the output. This is part of PR5680.
`-preserve-bc-uselistorder=true` is currently on by default, but a
follow-up commit in LLVM will reverse it.
llvm-svn: 234920
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 18:19:27 +0000 (18:19 +0000)]
IR: Rename 'use-list-order' options to 'uselistorder'
Rename options to be consistent with the name of `verify-uselistorder`,
and update `DEBUG_TYPE` (etc.) to be consistent.
llvm-svn: 234919
Sean Callanan [Tue, 14 Apr 2015 18:17:35 +0000 (18:17 +0000)]
Updated IRForTarget to change the way we generate
relocations. We used to do GEP on a pointer to
the result type, which is wrong. We should be doing
GEP on a pointer to char, which allows us to offset
correctly.
This fixes the C modules testcase, so it's no longer
ExpectFail.
llvm-svn: 234918
Daniel Berlin [Tue, 14 Apr 2015 18:14:38 +0000 (18:14 +0000)]
Add ladder graph utility
llvm-svn: 234917
Rui Ueyama [Tue, 14 Apr 2015 18:14:07 +0000 (18:14 +0000)]
ELF: Split OutputELFWriter.h to OutputELFWriter.{h,cpp}.
The size of AArch64TargetHandler.cpp.o is now 4.5MB.
llvm-svn: 234916
David Blaikie [Tue, 14 Apr 2015 18:08:25 +0000 (18:08 +0000)]
DebugInfo: Pubnames: Do not include variable declarations in pubnames
This causes badness for GDB which expects to find a definition in any
compile_unit that has an entry for the variable in its pubnames.
llvm-svn: 234915
Rui Ueyama [Tue, 14 Apr 2015 18:04:57 +0000 (18:04 +0000)]
ELF: Split TargetLayout.h into TargetLayout.{h,cpp}.
This patch makes AArch64TargetHandler.cpp.o from 8.5MB to 6.8MB.
llvm-svn: 234914
Rui Ueyama [Tue, 14 Apr 2015 17:32:13 +0000 (17:32 +0000)]
ELF: Remove ELFT template argument when referring the base class.
We don't need to repeat the template argument. They are not
ambiguous. MIPS is parameterized for ELFT, so we can't do this
for MIPS, though.
llvm-svn: 234913
Fariborz Jahanian [Tue, 14 Apr 2015 17:21:58 +0000 (17:21 +0000)]
[SemaCXX patch] Patch to fix a crash when a 'delete' constructor
is being accessed. Reviewed by Richard Smith.
rdar://
20281011
llvm-svn: 234912
David Blaikie [Tue, 14 Apr 2015 17:17:04 +0000 (17:17 +0000)]
Update test case to include the original source code & account for some changes in clang's order of emission
I'd added some stuff to this test case without adding the original
source, which makes updating/adding further stuff rather difficult. So
update it first (& it seems in the interim Clang's changed its output
order a bit, so adjust the CHECK lines to account for that - rather than
hand hacking the IR order which just makes it harder to maintain/change
next time)
llvm-svn: 234911
Lang Hames [Tue, 14 Apr 2015 17:13:10 +0000 (17:13 +0000)]
[RuntimeDyld] Make SectionEntry's Name field a std::string.
StringRef is unsafe here, since SectionEntry instances can outlive the
ObjectFile instances they are created from.
llvm-svn: 234910
Rui Ueyama [Tue, 14 Apr 2015 17:12:32 +0000 (17:12 +0000)]
Attempt to fix MSVC warning.
This patch tries to fix the following MSVC warning.
warning C4661: 'bool
lld::elf::ELFFile<lld::elf::ELF32LE>::isCompatible(unsigned
char,unsigned char)' : no suitable definition provided for explicit
template instantiation request
llvm-svn: 234909
Lang Hames [Tue, 14 Apr 2015 16:58:05 +0000 (16:58 +0000)]
[Orc] Reapply r234815, outputting via stdout instead.
llvm-svn: 234908
Zachary Turner [Tue, 14 Apr 2015 16:57:54 +0000 (16:57 +0000)]
[msvc] Strip /W[0-4] before appending /W4
Certain versions of CMake specify /W3 as part of CMAKE_CXX_FLAGS
by default, before you do anything. Appending /W4 to the end of
this and using the Ninja generator results in
cl : Command line warning D9025 : overriding '/W3' with '/W4'.
It is not possible to suppress this since it is a command line
warning and not a compiler warning, so we must fix the command
line to contain only one value for /Wn.
llvm-svn: 234907
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 16:19:44 +0000 (16:19 +0000)]
DebugInfo: Add implicit conversion from DISubprogram to DIScope
As a follow-up to r234850, add an implicit conversion from
`DISubprogram` to `DIScope` to support Kaleidoscope Ch. 8. This also
reverts that band-aid from r234890.
(/me learns *again* to build Kaleidoscope before commit...)
llvm-svn: 234904
Rafael Espindola [Tue, 14 Apr 2015 15:56:33 +0000 (15:56 +0000)]
Revert "The code that originally made me discover this is:"
This reverts commit r234898.
CodeGen/ARM/2013-10-11-select-stalls.ll was faling.
llvm-svn: 234903
Chad Rosier [Tue, 14 Apr 2015 15:52:57 +0000 (15:52 +0000)]
Improve RefreshCallGraph to remove invalid call graph edge.
With commit r219944, InstCombine can now turn a sqrtl into a llvm.fabs.f64.
The call graph edge originally representing the call to sqrtl becomes invalid.
This patch modifies CGPassManager::RefreshCallGraph() to remove the invalid
call graph edge, which can triggers an assert in
CallGraphNode::addCalledFunction().
Phabricator Review: http://reviews.llvm.org/D7705
Patch by Lawrence Hu <lawrence@codeaurora.org>.
llvm-svn: 234902
Alexander Kornienko [Tue, 14 Apr 2015 15:32:58 +0000 (15:32 +0000)]
Refactor: Simplify boolean expressions in ARM target
Simplify boolean expressions using `true` and `false` with `clang-tidy`
http://reviews.llvm.org/D8524
Patch by Richard Thomson!
llvm-svn: 234901
Krzysztof Parzyszek [Tue, 14 Apr 2015 15:28:42 +0000 (15:28 +0000)]
Change the testcase mtriple to x86_64-unknown-unknown
llvm-svn: 234900
Rafael Espindola [Tue, 14 Apr 2015 15:25:14 +0000 (15:25 +0000)]
Fix MSVC build.
llvm-svn: 234899
Daniel Jasper [Tue, 14 Apr 2015 15:20:37 +0000 (15:20 +0000)]
The code that originally made me discover this is:
if ((a & 0x1) == 0x1) {
..
}
In this case we don't actually have any branch probability information and
should not assume to have any. LLVM transforms this into:
%and = and i32 %a, 1
%tobool = icmp eq i32 %and, 0
So, in this case, the result of a bitwise and is compared against 0,
but nevertheless, we should not assume to have probability
information.
llvm-svn: 234898
Rafael Espindola [Tue, 14 Apr 2015 15:15:49 +0000 (15:15 +0000)]
Use raw_pwrite_stream in clang.
This is a small improvement to -emit-pth and allows llvm to start requiring it.
llvm-svn: 234897
Bradley Smith [Tue, 14 Apr 2015 15:07:26 +0000 (15:07 +0000)]
[AArch64] Allow non-standard INS/DUP encodings
The ARMv8 ARMARM states that for these instructions in A64 state:
"Unspecified bits in "imm5" are ignored but should be set to zero by an assembler.", (imm4 for INS).
Make the disassembler accept any encoding with these ignored bits set to 1.
llvm-svn: 234896
Rafael Espindola [Tue, 14 Apr 2015 15:00:34 +0000 (15:00 +0000)]
Add raw_pwrite_stream type.
This is a raw_ostream that also supports pwrite.
I will be used in a sec.
llvm-svn: 234895
Tom Stellard [Tue, 14 Apr 2015 14:36:56 +0000 (14:36 +0000)]
R600: Add GCC reg names
llvm-svn: 234892
Tom Stellard [Tue, 14 Apr 2015 14:36:45 +0000 (14:36 +0000)]
R600/SI: Fix verifier error caused by SIAnnotateControlFlow
This pass will always try to insert llvm.SI.ifbreak intrinsics
in the same block that its conditional value is computed in. This is
a problem when conditions for breaks or continue are computed outside
of the loop, because the llvm.SI.ifbreak intrinsic ends up being inserted
outside of the loop.
This patch fixes this problem by inserting the llvm.SI.ifbreak
intrinsics in the loop header when the condition is computed outside
the loop.
llvm-svn: 234891
Aaron Ballman [Tue, 14 Apr 2015 14:19:09 +0000 (14:19 +0000)]
Fixing a compile error with MSVC 2013 where there is no conversion from DISubprogram to DIScope directly.
llvm-svn: 234890
Anton Yartsev [Tue, 14 Apr 2015 14:18:04 +0000 (14:18 +0000)]
[analyzer] This implements potential undefbehavior.ZeroAllocDereference checker.
TODO: support realloc(). Currently it is not possible due to the present realloc() handling. Currently RegionState is not being attached to realloc() in case of a zero Size argument.
llvm-svn: 234889
Ilia K [Tue, 14 Apr 2015 14:12:22 +0000 (14:12 +0000)]
Fix handling of the executable arg which contains spaces (MI)
* Don't use the CMICmdArgValFile::GetFileNamePath for the CMIDriver::m_strCmdLineArgExecuteableFileNamePath
because it wraps path with spaces into quotes what is already being done in CMIDriver::LocalDebugSessionStartupExecuteCommands
* Improve the MiSyntaxTestCase.test_lldbmi_specialchars test to catch this error
```
$ bin/lldb-mi "~/p/ hello"
(gdb)
-file-exec-and-symbols "\"~/p/ hello\""
^error,msg="Command 'file-exec-and-symbols'. Target binary '\"~/p/ hello\"' is invalid. error: unable to find executable for '/"~/p/ hello/"'"
```
llvm-svn: 234888
Filipe Cabecinhas [Tue, 14 Apr 2015 14:07:15 +0000 (14:07 +0000)]
Error out of ParseBitcodeInto(Module*) if we haven't read a Module
Summary:
Without this check the following case failed:
Skip a SubBlock which is not a MODULE_BLOCK_ID nor a BLOCKINFO_BLOCK_ID
Got to end of file
TheModule would still be == nullptr, and we would subsequentially fail
when materializing the Module (assert at the start of
BitcodeReader::MaterializeModule).
Bug found with AFL.
Reviewers: dexonsmith, rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9014
llvm-svn: 234887
Marshall Clow [Tue, 14 Apr 2015 13:53:53 +0000 (13:53 +0000)]
Qualify an internal call in is_assignable to prevent ADL lookup, which would 'complete' an type definition unnecessarily. Thanks to Richard Smith for the report.
llvm-svn: 234886
Ilia K [Tue, 14 Apr 2015 13:48:49 +0000 (13:48 +0000)]
Simplify some lldb-mi tests by using the Base.addTearDownHook()
llvm-svn: 234885
Aaron Ballman [Tue, 14 Apr 2015 13:26:11 +0000 (13:26 +0000)]
Silencing a -Wreturn-type warning, as the switch is fully-covered; NFC.
llvm-svn: 234884
Petar Jovanovic [Tue, 14 Apr 2015 13:23:34 +0000 (13:23 +0000)]
Re-enable target-specific relocation table sorting and use it for Mips
Some targets (ie. Mips) have additional rules for ordering the relocation
table entries. Allow them to override generic sortRelocs(), which sorts
entries by Offset.
Then override this function for Mips, to emit HI16 and GOT16 relocations
against the local symbol in pair with the corresponding LO16 relocation.
Patch by Vladimir Stefanovic.
Differential Revision: http://reviews.llvm.org/D7414
llvm-svn: 234883
Petar Jovanovic [Tue, 14 Apr 2015 12:49:08 +0000 (12:49 +0000)]
[Mips] Generate warning for invalid '-mnan' and '-march' combinations
This patch generates a warning for invalid combination of '-mnan' and
'-march' options, it properly sets NaN encoding for a given '-march',
and it passes a proper NaN encoding to the assembler.
Patch by Vladimir Radosavljevic.
Differential Revision: http://reviews.llvm.org/D8170
llvm-svn: 234882
Nikola Smiljanic [Tue, 14 Apr 2015 12:33:33 +0000 (12:33 +0000)]
Remove useless statement.
llvm-svn: 234881
Daniel Jasper [Tue, 14 Apr 2015 11:56:25 +0000 (11:56 +0000)]
[MachineLICM] Use newer model of register pressure sets.
TargetRegisterInfo::getRegPressureLimit has a note that it is an old
model that relies on manually entered classes. Using the newer model of
register pressure sets seems more appropriate. We might eventually even
switch to lib/CodeGen/RegisterPressure.cpp, but we should probably do
incremental changes here.
Using the newer model also makes it easier to take regmasks into account
which is necessary to fix llvm.org/PR23143. I am currently also
preparing a patch for that, but would like to do this switch
independently.
Review: http://reviews.llvm.org/D8986
llvm-svn: 234880
NAKAMURA Takumi [Tue, 14 Apr 2015 10:54:14 +0000 (10:54 +0000)]
Roll back llvm/test/ExecutionEngine/MCJIT/cross-module-sm-pic-a.ll, possibly wrong commit.
It reverts part of r234839, "[RuntimeDyldELF] Improve GOT support".
llvm-svn: 234879
Dmitry Vyukov [Tue, 14 Apr 2015 10:32:33 +0000 (10:32 +0000)]
tsan: fix parsing of second_deadlock_stack flag
It was broken during flag parsing refactoring.
Enable test for the flag.
llvm-svn: 234878
Oleksiy Vyalov [Tue, 14 Apr 2015 10:20:43 +0000 (10:20 +0000)]
Fix XCode build after r234870.
llvm-svn: 234877
Denis Protivensky [Tue, 14 Apr 2015 09:33:04 +0000 (09:33 +0000)]
[ARM] Implement mapping symbols for PLT0 entry
llvm-svn: 234876
Anders Waldenborg [Tue, 14 Apr 2015 09:18:17 +0000 (09:18 +0000)]
Fix crash in DebugInfoFinder when adding a module with forward declared composite type
The testcase that is included in the patch caused a crash when doing DebugInfoFinder::processModule
on the module due to DCT->getElements() returning nullptr in DebugInfoFinder::processType.
By doing "DCT->getElements()" instead of "DCT->getElements()->operands()" one gets a DIArray
instead of a raw MDTuple. The former has code to handle null as a 0-element array and
therefore avoids the crash.
Differential Revision: http://reviews.llvm.org/D9008
llvm-svn: 234875
Denis Protivensky [Tue, 14 Apr 2015 09:11:05 +0000 (09:11 +0000)]
[ARM] Move out mapping atom functionality to a separate class
llvm-svn: 234874
Denis Protivensky [Tue, 14 Apr 2015 08:44:55 +0000 (08:44 +0000)]
[ARM] Rename IFUNC-related tests
llvm-svn: 234873
Denis Protivensky [Tue, 14 Apr 2015 08:40:02 +0000 (08:40 +0000)]
[ARM] Improve IFUNC PLT test
llvm-svn: 234872
Colin Riley [Tue, 14 Apr 2015 07:39:24 +0000 (07:39 +0000)]
Additions to RenderScriptRuntime in prep for detection of RenderScript modules and moving of the command interpreter manipulation to after construction.
Differential Revision: http://reviews.llvm.org/D9001
llvm-svn: 234871
Omair Javaid [Tue, 14 Apr 2015 07:30:20 +0000 (07:30 +0000)]
Adds Register Context Linux/POSIX for ARM Architecture
This patch is major step towards supporting lldb on ARM.
This adds all the required bits to support register manipulation on Linux Arm.
Also adds utility enumerations, definitions and register context classes for arm.
llvm-svn: 234870
Rui Ueyama [Tue, 14 Apr 2015 07:19:29 +0000 (07:19 +0000)]
Simplify short switch-cases.
llvm-svn: 234869
Rui Ueyama [Tue, 14 Apr 2015 07:09:05 +0000 (07:09 +0000)]
Remove excessive parentheses.
llvm-svn: 234868
Rui Ueyama [Tue, 14 Apr 2015 07:09:03 +0000 (07:09 +0000)]
ELF: Remove a header which is used only by one .cpp file.
The data and the inline function defined in the header is used only
by HexagonRelocationHandler.cpp.
llvm-svn: 234867
Rui Ueyama [Tue, 14 Apr 2015 06:58:48 +0000 (06:58 +0000)]
Fix indentation.
llvm-svn: 234866
Rui Ueyama [Tue, 14 Apr 2015 06:58:47 +0000 (06:58 +0000)]
ELF: Fix odd initialization code.
llvm-svn: 234865
Rui Ueyama [Tue, 14 Apr 2015 06:58:45 +0000 (06:58 +0000)]
temporary
llvm-svn: 234864
Rui Ueyama [Tue, 14 Apr 2015 06:47:06 +0000 (06:47 +0000)]
ELF: Move function definitions from .h to .cpp.
llvm-svn: 234863
Rui Ueyama [Tue, 14 Apr 2015 06:22:53 +0000 (06:22 +0000)]
ELF: Inline ELFReader typedefs which are used only once.
llvm-svn: 234862
Rui Ueyama [Tue, 14 Apr 2015 06:08:07 +0000 (06:08 +0000)]
ELF: Make common strings file-scoped constants.
llvm-svn: 234861
Rui Ueyama [Tue, 14 Apr 2015 05:21:26 +0000 (05:21 +0000)]
ELF: Make ARMELFMappingAtom a non-template class.
llvm-svn: 234860
Rui Ueyama [Tue, 14 Apr 2015 05:14:49 +0000 (05:14 +0000)]
ELF: Remove this-> as much as we can.
These this-> are there because their classes were templated.
They are no longer templated.
llvm-svn: 234859
Rui Ueyama [Tue, 14 Apr 2015 05:14:46 +0000 (05:14 +0000)]
ELF: Remove ELFT parameter from ARMELFFile.
llvm-svn: 234858
Rui Ueyama [Tue, 14 Apr 2015 05:14:44 +0000 (05:14 +0000)]
ELF: Make HexagonFile a non-template class.
llvm-svn: 234857
Alexey Bataev [Tue, 14 Apr 2015 05:11:24 +0000 (05:11 +0000)]
[OPENMP] Fixed codegen for arrays in 'copyprivate' clause.
Fixed a bug with codegen of variables with array types specified in 'copyprivate' clause of 'single' directive.
Differential Revision: http://reviews.llvm.org/D8914
llvm-svn: 234856
Jingyue Wu [Tue, 14 Apr 2015 04:59:22 +0000 (04:59 +0000)]
Simplify n-ary adds by reassociation
Summary:
This transformation reassociates a n-ary add so that the add can partially reuse
existing instructions. For example, this pass can simplify
void foo(int a, int b) {
bar(a + b);
bar((a + 2) + b);
}
to
void foo(int a, int b) {
int t = a + b;
bar(t);
bar(t + 2);
}
saving one add instruction.
Fixes PR22357 (https://llvm.org/bugs/show_bug.cgi?id=22357).
Test Plan: nary-add.ll
Reviewers: broune, dberlin, hfinkel, meheff, sanjoy, atrick
Reviewed By: sanjoy, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8950
llvm-svn: 234855
Rui Ueyama [Tue, 14 Apr 2015 04:54:01 +0000 (04:54 +0000)]
Remove dead code.
llvm-svn: 234854
Rui Ueyama [Tue, 14 Apr 2015 04:53:57 +0000 (04:53 +0000)]
ELF: Remove ELFT and LinkingContext template parameters from ELFReader.
Previously, ELFReader takes three template arguments: EFLT,
LinkingContextT and FileT. FileT is itself templated.
So it was a bit complicated. Maybe too much.
Most architectures don't actually need to be parameterized for ELFT.
For example, x86 is always ELF32LE and x86-64 is ELF64LE.
However, because ELFReader requires a ELFT argument, we needed
to parameterize a class even if not needed.
This patch removes the parameter from the class. So now we can
de-templatize such classes (I didn't do that in this patch, though).
This patch also removes ContextT parameter since it didn't have to be
passed as a template argument.
llvm-svn: 234853
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:51:36 +0000 (03:51 +0000)]
DebugInfo: Update signature of DICompileUnit::replace*()
Change `DICompileUnit::replaceSubprograms()` and
`DICompileUnit::replaceGlobalVariables()` to match the `MDCompileUnit`
equivalents that they're wrapping.
llvm-svn: 234852
Dmitri Gribenko [Tue, 14 Apr 2015 03:49:53 +0000 (03:49 +0000)]
LinkAllPasses.h: also link in parts of libLLVMSupport
When a loadable (.so or .dylib) pass is built with assertions enabled and
loaded into the 'opt' tool, we need to ensure that the extra symbols that such
passes depend on are linked into the tool.
llvm-svn: 234851
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:40:37 +0000 (03:40 +0000)]
DebugInfo: Gut DISubprogram and DILexicalBlock*
Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note
that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`.
llvm-svn: 234850
Alexey Bataev [Tue, 14 Apr 2015 03:29:22 +0000 (03:29 +0000)]
[OPENMP] Initial codegen for 'parallel sections' directive.
Emits code for outlined 'parallel' directive with the implicitly inlined 'sections' directive:
...
call __kmpc_fork_call(..., outlined_function, ...);
...
define internal void outlined_function(...) {
<code for implicit sections directive>;
}
Differential Revision: http://reviews.llvm.org/D8997
llvm-svn: 234849
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:24:14 +0000 (03:24 +0000)]
DebugInfo: Prepare for DISubprogram/DILexicalBlock* to be gutted
An upcoming LLVM commit will remove this API, so stop using it. Just
access the raw pointers using `operator->()`.
llvm-svn: 234848
Sanjoy Das [Tue, 14 Apr 2015 03:20:40 +0000 (03:20 +0000)]
[SCEVExpander] Fix comments for functions. NFC.
Bring function documentation for ScalarEvolutionExpander up to code by
not repeating the function name in the comment documenting
functionality. Reflow the edited comments where needed.
llvm-svn: 234847
Sanjoy Das [Tue, 14 Apr 2015 03:20:38 +0000 (03:20 +0000)]
[LoopUnrollRuntime] Avoid high-cost trip count computation.
Summary:
Runtime unrolling of loops needs to emit an expression to compute the
loop's runtime trip-count. Avoid runtime unrolling if this computation
will be expensive.
Depends on D8993.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8994
llvm-svn: 234846
Sanjoy Das [Tue, 14 Apr 2015 03:20:32 +0000 (03:20 +0000)]
[SCEV] Strengthen SCEVExpander::isHighCostExpansion.
Summary:
Teach `isHighCostExpansion` to consider divisions by power-of-two
constants as cheap and add a test case. This change is needed for a new
user of `isHighCostExpansion` that will be added in a subsequent change.
Depends on D8995.
Reviewers: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8993
llvm-svn: 234845
Sanjoy Das [Tue, 14 Apr 2015 03:20:28 +0000 (03:20 +0000)]
[SCEV] Refactor out isHighCostExpansion. NFCI.
Summary:
Move isHighCostExpansion from IndVarSimplify to SCEVExpander. This
exposed function will be used in a subsequent change.
Reviewers: bogner, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8995
llvm-svn: 234844
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 03:01:27 +0000 (03:01 +0000)]
DebugInfo: Gut DINamespace and DITemplate*Parameter
Continue gutting `DIDescriptor` subclasses, turning them into
as-bare-as-possible pointer wrappers.
llvm-svn: 234843
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:50:07 +0000 (02:50 +0000)]
DebugInfo: Add MDLexicalBlockBase::getLine(), etc.
Add a few functions from `DILexicalBlock` to `MDLexicalBlockBase`,
leaving `DILexicalBlock` a simple wrapper.
IMO, the new functions (`getLine()` and `getColumn()`) don't really
belong in the base class, but to simplify transitioning old code it
seems like the right incremental step. I've explicitly deleted them in
`MDLexicalBlockFile`, and eventually the callers should be updated to
downcast to `MDLexicalBlock` directly and the forwarding functions
removed.
llvm-svn: 234842
Rui Ueyama [Tue, 14 Apr 2015 02:34:09 +0000 (02:34 +0000)]
Define make_dynamic_error_code(const char *).
The function took either StringRef or Twine. Since string literals are
ambiguous when resolving the overloading, many code calls used this
function with explicit type conversion. That led awkward code like
make_dynamic_error_code(Twine("Error occurred")).
This patch adds a function definition for string literals, so that
you can directly call the function with literals.
llvm-svn: 234841
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:22:36 +0000 (02:22 +0000)]
DebugInfo: Gut DIVariable and DIGlobalVariable
Gut all the non-pointer API from the variable wrappers, except an
implicit conversion from `DIGlobalVariable` to `DIDescriptor`. Note
that if you're updating out-of-tree code, `DIVariable` wraps
`MDLocalVariable` (`MDVariable` is a common base class shared with
`MDGlobalVariable`).
llvm-svn: 234840
Keno Fischer [Tue, 14 Apr 2015 02:10:35 +0000 (02:10 +0000)]
[RuntimeDyldELF] Improve GOT support
Summary:
This is the first in a series of patches to eventually add support for TLS relocations to RuntimeDyld. This patch resolves an issue in the current GOT handling, where GOT entries would be reused between object files, which leads to the same situation that necessitates the GOT in the first place, i.e. that the 32-bit offset can not cover all of the address space. Thus this patch makes the GOT object-file-local.
Unfortunately, this still isn't quite enough, because the MemoryManager does not yet guarantee that sections are allocated sufficiently close to each other, even if they belong to the same object file. To address this concern, this patch also adds a small API abstraction on top of the GOT allocation mechanism that will allow (temporarily, until the MemoryManager is improved) using the stub mechanism instead of allocating a different section. The actual switch from separate section to stub mechanism will be part of a follow-on commit, so that it can be easily reverted independently at the appropriate time.
Test Plan: Includes a test case where the GOT of two object files is artificially forced to be apart by several GB.
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8813
llvm-svn: 234839
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 02:09:32 +0000 (02:09 +0000)]
DebugInfo: Move DIVariable::printExtendedName() to its only caller
Move the local function `printDebugLoc()` along with it.
llvm-svn: 234838
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:59:58 +0000 (01:59 +0000)]
DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callers
I don't think this API is helping much. Change the callers to call
`MDType::isBlockByrefStruct()` directly.
llvm-svn: 234837
Duncan P. N. Exon Smith [Tue, 14 Apr 2015 01:46:44 +0000 (01:46 +0000)]
DebugInfo: Gut DIObjCProperty and DIImportedEntity
Gut a couple more classes in the DIDescriptor hierarchy. Leave behind
an implicit conversion to `DIDescriptor`, the old base class.
llvm-svn: 234836