James Y Knight [Fri, 15 Jan 2016 05:57:41 +0000 (05:57 +0000)]
Fix a -Wparentheses warning in ASTDiagnostic.cpp.
llvm-svn: 257871
Richard Trieu [Fri, 15 Jan 2016 05:48:38 +0000 (05:48 +0000)]
Fixing more issues with template type diffing
1) Print qualifiers for templates with zero arguments
2) Add a few more tests for the template type diffing refactoring.
Specifically, PR24587 has been fixed and has a test case from
http://reviews.llvm.org/D15384
3) Adds asserts to check the DiffTree is in correct state when moving nodes
4) Rename the field FromType and ToType since it is heavily used within
member functions.
llvm-svn: 257870
Richard Trieu [Fri, 15 Jan 2016 05:01:53 +0000 (05:01 +0000)]
Add new diff modes to template type diffing.
Remove an old assertion that does not hold. It is possible for a template
argument to be a declaration in one instantiation and an integer in another.
Create two new diff kinds for these (decl vs int and int vs decl).
llvm-svn: 257869
Alexey Bataev [Fri, 15 Jan 2016 04:36:32 +0000 (04:36 +0000)]
PR26111: segmentation fault with __attribute__((mode(QI))) on function declaration, by Denis Zobnin
Allow "mode" attribute to be applied to VarDecl, not ValueDecl (which includes FunctionDecl and EnumConstantDecl), emit an error if this attribute is used with function declarations and enum constants.
Differential Revision: http://reviews.llvm.org/D16112
llvm-svn: 257868
Alexey Bataev [Fri, 15 Jan 2016 04:06:31 +0000 (04:06 +0000)]
[X86] Support 'interrupt' attribute for x86
This attribute may be attached to a function definition and instructs the backend to generate appropriate function entry/exit code so that
it can be used directly as an interrupt handler.
The IRET instruction, instead of the RET instruction, is used to return from interrupt or exception handlers. All registers, except for the EFLAGS register which is restored by the IRET instruction, are preserved by the compiler.
Any interruptible-without-stack-switch code must be compiled with -mno-red-zone since interrupt handlers can and will, because of the hardware design, touch
the red zone.
interrupt handler must be declared with a mandatory pointer argument:
struct interrupt_frame;
__attribute__ ((interrupt))
void f (struct interrupt_frame *frame) {
...
}
and user must properly define the structure the pointer pointing to.
exception handler:
The exception handler is very similar to the interrupt handler with a different mandatory function signature:
#ifdef __x86_64__
typedef unsigned long long int uword_t;
#else
typedef unsigned int uword_t;
#endif
struct interrupt_frame;
__attribute__ ((interrupt))
void f (struct interrupt_frame *frame, uword_t error_code) {
...
}
and compiler pops the error code off stack before the IRET instruction.
The exception handler should only be used for exceptions which push an error code and all other exceptions must use the interrupt handler.
The system will crash if the wrong handler is used.
Differential Revision: http://reviews.llvm.org/D15709
llvm-svn: 257867
Yabin Cui [Fri, 15 Jan 2016 03:39:04 +0000 (03:39 +0000)]
[tsan] Store the pointer to ThreadState in TLS slot on Android.
Summary:
1. Android doesn't support __thread keyword. So allocate ThreadState
dynamically and store its pointer in one TLS slot provided by Android.
2. On Android, intercepted functions can be called before ThreadState
is initialized. So add test of thr_->is_inited in some places.
3. On Android, intercepted functions can be called after ThreadState
is destroyed. So add a fake dead_thread_state to represent all
destroyed ThreadStates. And that is also why we don't store the pointer
to ThreadState in shadow memory of pthread_self().
Reviewers: kcc, eugenis, dvyukov
Subscribers: kubabrecka, llvm-commits, tberghammer, danalbert, srhines
Differential Revision: http://reviews.llvm.org/D15301
llvm-svn: 257866
Akira Hatanaka [Fri, 15 Jan 2016 03:34:06 +0000 (03:34 +0000)]
[CodeGen] Attach attributes to thread local wrapper function.
This commit is a follow-up to r251734, r251476, and r249735, which fixes
a bug where function attributes were not attached to thread local
wrapper functions.
rdar://problem/
20828324
llvm-svn: 257865
Andrew Wilkins [Fri, 15 Jan 2016 03:33:35 +0000 (03:33 +0000)]
[docs] Document LLVM_{BUILD,LINK}_LLVM_DYLIB
Summary:
Document the LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB
CMake options, move BUILD_SHARED_LIBS out of frequently-used,
and add a note/warning to BUILD_SHARED_LIBS.
Reviewers: beanz, delcypher, mjacob
Subscribers: mjacob, llvm-commits
Differential Revision: http://reviews.llvm.org/D16208
llvm-svn: 257864
Richard Smith [Fri, 15 Jan 2016 03:24:18 +0000 (03:24 +0000)]
When copying whitespace flags from the token naming a macro argument onto the
first token of the expansion, don't forget to copy the "is at the start of a
line" token (which is always false, as newlines cannot appear within a macro
body); otherwise, stringizing the result can insert spurious whitespace.
llvm-svn: 257863
Yabin Cui [Fri, 15 Jan 2016 02:59:23 +0000 (02:59 +0000)]
[tsan] Use internal_sigfillset to replace REAL(sigfillset).
Summary:
Android doesn't intercept sigfillset, so REAL(sigfillset) is null.
And we can use internal_sigfillset() for all cases.
Reviewers: kcc, eugenis, kubabrecka, dvyukov
Subscribers: llvm-commits, tberghammer, danalbert
Differential Revision: http://reviews.llvm.org/D15296
llvm-svn: 257862
Richard Trieu [Fri, 15 Jan 2016 02:55:17 +0000 (02:55 +0000)]
Save the integer type for integral template arguments.
Save the integer type when diffing integers in template type diffing. When
integers are different sizes, print out the type along with the integer value.
Also with the type information, print true and false instead of 1 and 0 for
boolean values.
llvm-svn: 257861
Peter Collingbourne [Fri, 15 Jan 2016 02:51:26 +0000 (02:51 +0000)]
Unbreak Windows build.
llvm-svn: 257860
Pete Cooper [Fri, 15 Jan 2016 02:24:12 +0000 (02:24 +0000)]
Delete MCRelocationInfo::createExprForRelocation.
This method has no callers.
Also remove X86ELFRelocationInfo.cpp and X86MachORelocationInfo.cpp
which only existed to provide an implementation of that method.
Ok'd by Rafael and Jim.
llvm-svn: 257859
Peter Collingbourne [Fri, 15 Jan 2016 02:19:20 +0000 (02:19 +0000)]
sanitizer_common: C++ify the IntrusiveList iterator interface.
llvm-svn: 257858
NAKAMURA Takumi [Fri, 15 Jan 2016 02:14:46 +0000 (02:14 +0000)]
lli: use llvm::utostr() instead of std::to_string().
llvm-svn: 257857
NAKAMURA Takumi [Fri, 15 Jan 2016 02:13:04 +0000 (02:13 +0000)]
[autoconf] Install VersionFromVCS.cmake, too. clang/CMakeLists.txt requires it.
llvm-svn: 257856
Keno Fischer [Fri, 15 Jan 2016 02:12:38 +0000 (02:12 +0000)]
Once again revert debug info verifier changes
Yet another wave of buildbot failures (though fewer this time).
I'm only reverting the Verifier changes, as the test cases
will be fine without them as well, and touching them as often
just introduces unnecessary churn.
llvm-svn: 257855
Davide Italiano [Fri, 15 Jan 2016 01:49:51 +0000 (01:49 +0000)]
[ELF/AArch64] Add support for R_AARCH64_LDST16_ABS_LO12_NC relocation.
Found while trying to self-host the toolchain that libLTO needs it.
llvm-svn: 257854
Richard Trieu [Fri, 15 Jan 2016 01:08:56 +0000 (01:08 +0000)]
Make template type diffing use the new desguared iterator.
If available, use the canonical template argument to fill in information for
template type diffing instead of attempting to special case and evaluate Expr's
for the value. Since those are the values used in template instantiation,
we don't have to worry about difference between our evaluator and theirs. Also
move the nullptr template arguments from DiffKind::Expression to
DiffKind::Declaration and allow DiffKind::Declaration to set an Expr. The only
effect that should result is that a named nullptr will show up as
'ptr aka nullptr' in diagnostics.
llvm-svn: 257853
Jim Ingham [Fri, 15 Jan 2016 01:03:50 +0000 (01:03 +0000)]
The ASAN report fetching code had two latent bugs:
1) It was forward declaring functions without 'extern "C"'. That used to work
but only because of another bug in how we passes symbol only function names to the
compiler and stopped working recently.
2) These forward declarations were in the body of the User Expression, and they actually
need to go in the prefix file.
<rdar://problem/
24177689>
llvm-svn: 257852
Michael Kruse [Fri, 15 Jan 2016 00:48:42 +0000 (00:48 +0000)]
Prepare unit tests for update to ISL 0.16
ISL 0.16 will change how sets are printed which breaks 117 unit tests
that text-compare printed sets. This patch re-formats most of these unit
tests using a script and small manual editing on top of that. When
actually updating ISL, most work is done by just re-running the script
to adapt to the changed output.
Some tests that compare IR and tests with single CHECK-lines that can be
easily updated manually are not included here.
The re-format script will also be committed afterwards. The per-test
formatter invocation command lines options will not be added in the near
future because it is ad hoc and would overwrite the manual edits.
Ideally it also shouldn't be required anymore because ISL's set printing
has become more stable in 0.16.
Differential Revision: http://reviews.llvm.org/D16095
llvm-svn: 257851
Keno Fischer [Fri, 15 Jan 2016 00:46:17 +0000 (00:46 +0000)]
Reapply r257105 "[Verifier] Check that debug values have proper size"
I originally reapplied this in 257550, but had to revert again due to bot
breakage. The only change in this version is to allow either the TypeSize
or the TypeAllocSize of the variable to be the one represented in debug info
(hopefully in the future we can figure out how to encode the difference).
Additionally, several bot failures following r257550, were due to
optimizer bugs now fixed in r257787 and r257795.
r257550 commit message was:
```
The follow extra changes were made to test cases:
Manually making the variable be the actual type instead of a pointer
to avoid pointer-size differences in generic code:
LLVM :: DebugInfo/Generic/2010-03-24-MemberFn.ll
LLVM :: DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
LLVM :: DebugInfo/Generic/2010-05-03-DisableFramePtr.ll
LLVM :: DebugInfo/Generic/varargs.ll
Delete sizing information from debug info for the same reason
(but the presence of the pointer was important to the test case):
LLVM :: DebugInfo/Generic/restrict.ll
LLVM :: DebugInfo/Generic/tu-composite.ll
LLVM :: Linker/type-unique-type-array-a.ll
LLVM :: Linker/type-unique-simple2.ll
Fixing an incorrect DW_OP_deref
LLVM :: DebugInfo/Generic/2010-05-03-OriginDIE.ll
Fixing a missing DW_OP_deref
LLVM :: DebugInfo/Generic/incorrect-variable-debugloc.ll
Additionally, clang should no longer complain during bootstrap should no
longer happen after r257534.
The original commit message was:
``
Summary:
Teach the Verifier to make sure that the storage size given to llvm.dbg.declare
or the value size given to llvm.dbg.value agree with what is declared in
DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA).
Additionally this catches a number of common mistakes, such as passing a
pointer when a value was intended or vice versa.
One complication comes from stack coloring which modifies the original IR when
it merges allocas in order to make sure that if AA falls back to the IR it gets
the correct result. However, given this new invariant, indiscriminately
replacing one alloca by a different (differently sized one) is no longer valid.
Fix this by just undefing out any use of the alloca in a dbg.declare in this
case.
Additionally, I had to fix a number of test cases. Of particular note:
- I regenerated dbg-changes-codegen-branch-folding.ll from the given source as
it was affected by the bug fixed in r256077
- two-cus-from-same-file.ll was changed to avoid having a variable-typed debug
variable as that would depend on the target, even though this test is
supposed to be generic
- I had to manually declared size/align for reference type. See also the
discussion for D14275/r253186.
- fpstack-debuginstr-kill.ll required changing `double` to `long double`
- most others were just a question of adding OP_deref
``
```
llvm-svn: 257850
Amaury Sechet [Fri, 15 Jan 2016 00:23:34 +0000 (00:23 +0000)]
LLVMRunStaticConstructors can be called before object is finalized, #24028
Summary: Since you cannot call finalizeObject manually through the C-API and other functions from the C-API automatically call it, LLVMRunStaticConstructors should also call it or otherwise you cannot call it without first calling a workaround function (or call any other function from the C-API which implicitly finalizes the object).
Reviewers: dnovillo, spatel, bkramer, deadalnix, joker.eph, echristo, lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16188
llvm-svn: 257849
Kostya Serebryany [Fri, 15 Jan 2016 00:17:37 +0000 (00:17 +0000)]
[libFuzzer] use custom stol; also introduce __libfuzzer_is_present so that users can check for its presence.
llvm-svn: 257848
Philip Reames [Fri, 15 Jan 2016 00:13:39 +0000 (00:13 +0000)]
[docs] Restructure description of records created by Statepoints
The previous text was hard to understand even for me and I wrote it. Hopefully the new structure makes it a bit more clear what's going on. If anyone has word smithing suggestion or clarification questions, please let me know.
llvm-svn: 257847
Reid Kleckner [Fri, 15 Jan 2016 00:11:21 +0000 (00:11 +0000)]
[codeview] Translate file table offsets to filenames and print them
llvm-svn: 257846
Sanjay Patel [Fri, 15 Jan 2016 00:08:10 +0000 (00:08 +0000)]
rangify; NFCI
llvm-svn: 257845
Weiming Zhao [Fri, 15 Jan 2016 00:06:58 +0000 (00:06 +0000)]
Fix AArch64ConditionOptimizer
Summary:
This pass may modify the Cmp operands. However, the flag reg may be used by both the branch and CSEL.
Modifying CMP will have side effect on CSEL.
Reviewers: t.p.northover
Subscribers: llvm-commits, aemerson, rengolin
Differential Revision: http://reviews.llvm.org/D16147
llvm-svn: 257844
Philip Reames [Thu, 14 Jan 2016 23:58:18 +0000 (23:58 +0000)]
[docs] Update Statepoint docs to clarify format for recent changes
llvm-svn: 257843
Pete Cooper [Thu, 14 Jan 2016 23:44:00 +0000 (23:44 +0000)]
Don't use explicit paths in my own test check lines
llvm-svn: 257842
Pete Cooper [Thu, 14 Jan 2016 23:35:05 +0000 (23:35 +0000)]
Error check the size of the __objc_imageinfo section
llvm-svn: 257841
David Blaikie [Thu, 14 Jan 2016 23:33:43 +0000 (23:33 +0000)]
Orc: Simplify some things with NSDMIs and some braced init.
llvm-svn: 257840
Justin Lebar [Thu, 14 Jan 2016 23:31:30 +0000 (23:31 +0000)]
[CUDA] Warn undeclared identifiers in CUDA kernel calls
Value, type, and instantiation dependence were not being handled
correctly for CUDAKernelCallExpr AST nodes. As a result, if an
undeclared identifier was used in the triple-angle-bracket kernel call
configuration, there would be no error during parsing, and there would
be a crash during code gen. This patch makes sure that an error will be
issued during parsing in this case, just as there would be for any other
use of an undeclared identifier in C++.
Patch by Jason Henline.
Reviewers: jlebar, rsmith
Differential Revision: http://reviews.llvm.org/D15858
llvm-svn: 257839
Richard Trieu [Thu, 14 Jan 2016 23:30:12 +0000 (23:30 +0000)]
Change the TSTiterator in Template Type Diffing.
Modify the TSTiterator to have two internal iterators, which will walk
the provided sugared type and the desugared type. This will provide better
access to the template argument information. No functional changes.
llvm-svn: 257838
Pete Cooper [Thu, 14 Jan 2016 23:25:06 +0000 (23:25 +0000)]
Check for mismatched arch and OS when linking MachO files.
This patch makes use of the handleLoadedFile hook added in r257814.
That method is used to check the arch and the OS of the files we are linking
against the arch and OS on the context.
The first test to use this ensures that we do not try to combine i386 Mac OS code
with i386 simulator code.
llvm-svn: 257837
Sanjay Patel [Thu, 14 Jan 2016 23:23:04 +0000 (23:23 +0000)]
remove duplicate documentation comments (already in the header file) ; NFC
llvm-svn: 257835
Hans Wennborg [Thu, 14 Jan 2016 23:18:20 +0000 (23:18 +0000)]
Don't use __DATE__ or __TIME__; it breaks release builds (PR26145)
The release builds are configured to be reproducible, so that the
binaries compare equal between bootstrap iterations. The OpenMP
run-time build was failing like this:
runtime/src/kmp_version.c:108:79: error: expansion of date or time macro is not reproducible [-Werror,-Wdate-time]
char const __kmp_version_build_time[] = KMP_VERSION_PREFIX "build time: " __DATE__ " " __TIME__;
Figuring as the build currently doesn't set LIBOMP_DATE, it's probably
OK to skip setting the build time here too.
llvm-svn: 257833
Easwaran Raman [Thu, 14 Jan 2016 23:16:29 +0000 (23:16 +0000)]
Refactor threshold computation for inline cost analysis
Differential Revision: http://reviews.llvm.org/D15401
llvm-svn: 257832
Richard Trieu [Thu, 14 Jan 2016 22:56:39 +0000 (22:56 +0000)]
Refactor template type diffing
1) Instead of using pairs of From/To* fields, combine fields into a struct
TemplateArgInfo and have two in each DiffNode.
2) Use default initialization in DiffNode so that the constructor shows the
only field that is initialized differently on construction.
3) Use Set and Get functions per each DiffKind to make sure all fields for the
diff is set. In one case, the Expr fields were not set.
4) Don't print boolean literals for boolean template arguments. This prevents
printing 'false aka 0'
Only #3 has a functional change, which is reflected in the test change.
llvm-svn: 257831
Pete Cooper [Thu, 14 Jan 2016 22:55:38 +0000 (22:55 +0000)]
Add File::kind's for all subclasses of File.
This is to enable isa<> support for any files which need it.
It will be used in an upcoming patch to differentiate MachOFile from other implicitly generated files.
Reviewed by Lang Hames.
Differential Revision: http://reviews.llvm.org/D16103
llvm-svn: 257830
Adrian McCarthy [Thu, 14 Jan 2016 22:52:16 +0000 (22:52 +0000)]
Fix detection of teardown hooks that are already bound.
llvm-svn: 257829
Chris Bieneman [Thu, 14 Jan 2016 22:48:45 +0000 (22:48 +0000)]
[CMake] Move the install logic for libclang's headers into the libclang CMakelists
This makes it so if you disable building libclang you won't install the headers as part of the 'install' target.
llvm-svn: 257828
Chris Bieneman [Thu, 14 Jan 2016 22:45:12 +0000 (22:45 +0000)]
[CMake] Set SVN_REVISION if CLANG_APPEND_VC_REV=On
This matches autoconf's ability to put clang revisions in the clang --version spew.
llvm-svn: 257827
Chris Bieneman [Thu, 14 Jan 2016 22:44:29 +0000 (22:44 +0000)]
[CMake] Add support for populating LLVM_REPOSITORY from CMake.
Autoconf does this in the GetRepositoryPath script, CMake's VersionFromVCS does grab the SVN_REVISION, but doesn't populate the repository URL.
llvm-svn: 257826
Keno Fischer [Thu, 14 Jan 2016 22:42:02 +0000 (22:42 +0000)]
[Verifier] Check parentage of GVs in dbg metadata
Summary:
Before this the Verifier didn't complain if the GlobalVariable
referenced from a DIGlobalVariable was not in fact in the correct
module (it would crash while writing bitcode though). Fix this by
always checking parantage of GlobalValues while walking constant
expressions and changing the DIGlobalVariable visitor to also
visit the constant it contains.
Reviewers: rafael
Differential Revision: http://reviews.llvm.org/D16059
llvm-svn: 257825
Mike Aizatsky [Thu, 14 Jan 2016 22:34:11 +0000 (22:34 +0000)]
[sancov] html report
Differential Revision: http://reviews.llvm.org/D16161
llvm-svn: 257824
Keno Fischer [Thu, 14 Jan 2016 22:20:56 +0000 (22:20 +0000)]
[Verifier] Verify that a GlobalValue is only used in this Module
Summary:
We already have the inverse verification that we only use globals
that are defined in this module. This essentially catches the
same mistake, but when verifying the module that contains the
definition.
Reviewers: rafael
Differential Revision: http://reviews.llvm.org/D15272
llvm-svn: 257823
Xinliang David Li [Thu, 14 Jan 2016 22:10:49 +0000 (22:10 +0000)]
[PGO] Move profile summary interface/impl into InstrProf.[*] /NFC
llvm-svn: 257819
Sean Callanan [Thu, 14 Jan 2016 22:05:26 +0000 (22:05 +0000)]
Removed a redundant function call after review.
llvm-svn: 257818
Rui Ueyama [Thu, 14 Jan 2016 22:04:35 +0000 (22:04 +0000)]
Remove XFAIL:win32 from a test which does not fail on win32.
This test uses a regexp so that it matches both Unix output and
Windows output.
llvm-svn: 257817
Lang Hames [Thu, 14 Jan 2016 22:02:03 +0000 (22:02 +0000)]
[Orc] Add support for EH-frame registration to the Orc Remote Target utility
classes.
OrcRemoteTargetClient::RCMemoryManager will now register EH frames with the
server automatically. This allows remote-execution of code that uses exceptions.
llvm-svn: 257816
Krzysztof Parzyszek [Thu, 14 Jan 2016 21:59:22 +0000 (21:59 +0000)]
[Hexagon] Use S2_lsr_i_r instead of S2_extractu to obtain upper halfword
llvm-svn: 257815
Pete Cooper [Thu, 14 Jan 2016 21:53:13 +0000 (21:53 +0000)]
Add handleLoadedFile hook to the context.
This is called from the resolver on each file we decide we actually want to use.
Future commits will make use of this to extract useful information from the files and do
error checking against the context. For example, ensure that files are the same arch as
each other.
Reviewed by Lang Hames.
Differential Revision: http://reviews.llvm.org/D16093
llvm-svn: 257814
Reid Kleckner [Thu, 14 Jan 2016 21:50:05 +0000 (21:50 +0000)]
[codeview] Dump function callees and add more labels to inlinee info
I kept forgetting which number is the line delta and which is the code
delta.
llvm-svn: 257813
Sean Callanan [Thu, 14 Jan 2016 21:46:09 +0000 (21:46 +0000)]
Enable the use of modules in the expression parser by default.
If your program refers to modules (as indicated in DWARF) we will now try to
load these modules and give you access to their types in expressions. This used
to be gated by a setting ("settings set target.auto-import-clang-modules true")
but that setting defaulted to false. Now it defaults to true -- but you can
disable it by toggling the setting to false.
llvm-svn: 257812
Krzysztof Parzyszek [Thu, 14 Jan 2016 21:45:43 +0000 (21:45 +0000)]
[Hexagon] Handle HVX registers in bit simplification
llvm-svn: 257811
Justin Lebar [Thu, 14 Jan 2016 21:41:31 +0000 (21:41 +0000)]
[CUDA] Add test for compiling CUDA code with -S.
Reviewers: tra
Subscribers: cfe-commits, jhen
Differential Revision: http://reviews.llvm.org/D16081
llvm-svn: 257810
Justin Lebar [Thu, 14 Jan 2016 21:41:27 +0000 (21:41 +0000)]
[CUDA] Invoke ptxas and fatbinary during compilation.
Summary:
Previously we compiled CUDA device code to PTX assembly and embedded
that asm as text in our host binary. Now we compile to PTX assembly and
then invoke ptxas to assemble the PTX into a cubin file. We gather the
ptx and cubin files for each of our --cuda-gpu-archs and combine them
using fatbinary, and then embed that into the host binary.
Adds two new command-line flags, -Xcuda_ptxas and -Xcuda_fatbinary,
which pass args down to the external tools.
Reviewers: tra, echristo
Subscribers: cfe-commits, jhen
Differential Revision: http://reviews.llvm.org/D16082
llvm-svn: 257809
Justin Lebar [Thu, 14 Jan 2016 21:41:21 +0000 (21:41 +0000)]
Don't build jobs for the same Action + ToolChain twice.
Summary:
Right now if the Action graph is a DAG and we encounter an action twice,
we will run it twice.
This patch is difficult to test as-is, but I have testcases for this as
used within CUDA compilation.
Reviewers:
Subscribers:
llvm-svn: 257808
Justin Lebar [Thu, 14 Jan 2016 21:41:18 +0000 (21:41 +0000)]
[CUDA] Add tests for compiling CUDA files with -E.
Reviewers: tra
Subscribers: cfe-commits, jhen
Differential Revision: http://reviews.llvm.org/D16080
llvm-svn: 257807
Simon Atanasyan [Thu, 14 Jan 2016 21:34:50 +0000 (21:34 +0000)]
[ELF][MIPS] Create dynamic relocations for R_MIPS_32/64 relocations
llvm-svn: 257806
Krzysztof Parzyszek [Thu, 14 Jan 2016 21:17:04 +0000 (21:17 +0000)]
[Packetizer] Code cleanup, NFC
llvm-svn: 257805
Rui Ueyama [Thu, 14 Jan 2016 21:06:47 +0000 (21:06 +0000)]
Update to use new name alignTo().
llvm-svn: 257804
Rafael Espindola [Thu, 14 Jan 2016 21:03:06 +0000 (21:03 +0000)]
Handle offsets larger than 32 bits.
David Majnemer noticed that it was not obvious what the behavior would
be if B.Offset - A.Offset could not fit in an int.
llvm-svn: 257803
Rui Ueyama [Thu, 14 Jan 2016 21:00:27 +0000 (21:00 +0000)]
Update for LLVM function name change.
llvm-svn: 257802
Rui Ueyama [Thu, 14 Jan 2016 20:53:50 +0000 (20:53 +0000)]
Update for LLVM function name change.
llvm-svn: 257801
Matthew Simpson [Thu, 14 Jan 2016 20:46:27 +0000 (20:46 +0000)]
[SLP] Vectorize the index computations of getelementptr instructions.
This patch seeds the SLP vectorizer with getelementptr indices. The primary
motivation in doing so is to vectorize gather-like idioms beginning with
consecutive loads (e.g., g[a[0] - b[0]] + g[a[1] - b[1]] + ...). While these
cases could be vectorized with a top-down phase, seeding the existing bottom-up
phase with the index computations avoids the complexity, compile-time, and
phase ordering issues associated with a full top-down pass. Only bundles of
single-index getelementptrs with non-constant differences are considered for
vectorization.
Differential Revision: http://reviews.llvm.org/D14829
llvm-svn: 257800
Rui Ueyama [Thu, 14 Jan 2016 20:43:11 +0000 (20:43 +0000)]
[Support] Rename RoundUpToAlignment -> alignTo.
Rounding up an integer m to a nearest multiple of n where n is a power
of 2 is used very often if you are writing code to emit binary files.
RoundUpToAlignment is a small function to do that. But we found that the
function has a small but annoying issue; the name is a bit too long.
Because it is used quite often, that hurts readability.
This patch is to rename the function. The original name is kept as a
forwarder, so that submitting this patch won't immediately break Clang
and other LLVM projects. Once I update all occurrences of RoundUpToAlignment,
I'll remove the old name entirely.
http://reviews.llvm.org/D16162
llvm-svn: 257799
Simon Atanasyan [Thu, 14 Jan 2016 20:42:09 +0000 (20:42 +0000)]
[ELF][MIPS] Ignore 'hint' relocations like R_MIPS_JALR in the `scanRelocs` method
MIPS ABI has relocations like R_MIPS_JALR which is just a hint for
linker to make some code optimization. Such relocations should not be
handled as a regular ones and lead to say dynamic relocation creation.
The patch introduces new virtual `Target::isHintReloc` method, overrides
it in the `MipsTargetInfo` class and calls it in the `Writer<ELFT>::scanRelocs`
method.
Differential Revision: http://reviews.llvm.org/D16193
llvm-svn: 257798
Rui Ueyama [Thu, 14 Jan 2016 20:32:19 +0000 (20:32 +0000)]
Revert r257753: "[ELF] - implemented --eh-frame-hdr command line option."
This reverts commit r257753 because we cannot link Clang with this patch.
llvm-svn: 257797
Rafael Espindola [Thu, 14 Jan 2016 20:28:25 +0000 (20:28 +0000)]
Assert that a cmp function defines a total order.
Thanks to David Blaikie for noticing it.
llvm-svn: 257796
Keno Fischer [Thu, 14 Jan 2016 20:06:34 +0000 (20:06 +0000)]
[SROA] Also insert a bit piece expression if only one piece is needed
Summary: If SROA creates only one piece (e.g. because the other is not needed),
it still needs to create a bit_piece expression if that bit piece is smaller
than the original size of the alloca.
Reviewers: aprantl
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16187
llvm-svn: 257795
Ahmed Bougacha [Thu, 14 Jan 2016 19:45:36 +0000 (19:45 +0000)]
[CodeGen] Don't assume fp_to_fp16 produces i16 when legalizing it.
Since r230276, we support an improved legalization for f64->f16,
which goes through a temporary f32, improving codegen when
f32->f16 is legal but not f64->f16. This requires unsafe-fp-math.
However, that legalization assumed that the second step, producing
a pseudo-softened f16, had type i16. That's not true on targets
with illegal i16, such as ARM.
Use the initial f64->f16 result type instead.
llvm-svn: 257794
Reid Kleckner [Thu, 14 Jan 2016 19:40:27 +0000 (19:40 +0000)]
Include TypeIndex. Again, the "check" target is not enough to catch this currently
llvm-svn: 257793
Reid Kleckner [Thu, 14 Jan 2016 19:25:04 +0000 (19:25 +0000)]
Rename WinCodeViewLineTables to CodeViewDebug, similar to DwarfDebug
Soon it will be responsible for more than line tables.
Reviewers: majnemer
Differential Revision: http://reviews.llvm.org/D16199
llvm-svn: 257792
Hans Wennborg [Thu, 14 Jan 2016 19:21:14 +0000 (19:21 +0000)]
Exclude test-suite from CMake builds in test-release.sh
It's broken. In 3.7 there wasn't a CMake build for test-suite at all,
so we're not losing something we had before.
llvm-svn: 257791
Reid Kleckner [Thu, 14 Jan 2016 19:20:17 +0000 (19:20 +0000)]
[codeview] Dump CodeView inlinee lines subsection
llvm-svn: 257790
Alexey Samsonov [Thu, 14 Jan 2016 19:16:05 +0000 (19:16 +0000)]
[LSan] Add "use_ld_allocations" flag to disable old way of DTLS handling.
This flag allows to disable old way of determining dynamic TLS by
filtering out allocations from dynamic linker. This will be eventually
superseded by __tls_get_addr interceptor (see r257785), after we:
1) Test it in several supported environments
2) Deal with existing problems (currently we can't find a pointer to
DTV which is calloc()-ed in pthread_create).
llvm-svn: 257789
Zachary Turner [Thu, 14 Jan 2016 19:14:02 +0000 (19:14 +0000)]
Resubmit the fixes for TestProcessLaunch.py.
I was calling the base class tearDown() function the wrong way
which for some reason is ok on Python 3 but not on Python 2.
llvm-svn: 257788
Keno Fischer [Thu, 14 Jan 2016 19:12:27 +0000 (19:12 +0000)]
[Utils] Fix incorrect dbg.declare store conversion
Summary: The dbg.declare -> dbg.value conversion did not check which operand of
the store instruction the alloca was passed to. As a result code that stored the
address of an alloca, rather than storing to the alloca, would still trigger
the conversion routine, leading to the insertion of an incorrect dbg.value
intrinsic.
Reviewers: aprantl
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16169
llvm-svn: 257787
Sean Callanan [Thu, 14 Jan 2016 18:59:49 +0000 (18:59 +0000)]
Fixed a crasher when dealing with table entries that have blank names.
This can happen with -gmodules tables when an anonymous struct is referred to.
llvm-svn: 257786
Alexey Samsonov [Thu, 14 Jan 2016 18:50:09 +0000 (18:50 +0000)]
[LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.
Summary:
We have a way to keep track of allocated DTLS segments: let's use it
in LSan. Although this code is fragile and relies on glibc
implementation details, in some cases it proves to be better than
existing way of tracking DTLS in LSan: marking as "reachable" all
memory chunks allocated directly by "ld".
The plan is to eventually get rid of the latter, once we are sure
it's safe to remove.
Reviewers: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16164
llvm-svn: 257785
Adrian Prantl [Thu, 14 Jan 2016 18:31:07 +0000 (18:31 +0000)]
dsymutil: Provide better warnings when clang modules cannot be found.
rdar://problem/
22823264
llvm-svn: 257784
Sumanth Gundapaneni [Thu, 14 Jan 2016 18:18:49 +0000 (18:18 +0000)]
Fix the cross compilation of unit tests. NFC (second attempt)
With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling
environment, the unit tests fail to link. This patch does the following changes
>Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the
way it's used.
>Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so
that cross-compiler would be able to build/compile the unit tests
>Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so
that cross-compiler would be able to link the unit tests (if needed)
Differential Revision: http://reviews.llvm.org/D16165
llvm-svn: 257783
Xinliang David Li [Thu, 14 Jan 2016 18:15:54 +0000 (18:15 +0000)]
[Coverage] add test cases for coverage testing
1. One test covering coverage-mapping interfaction with linker GC
2. one test covering coverage-mapping with shared libaries
llvm-svn: 257782
Xinliang David Li [Thu, 14 Jan 2016 18:09:45 +0000 (18:09 +0000)]
[PGO] [Coverage] put covmap into note section with no 'alloc flag' (Linux)
Coverage mapping data is not referenced by runtime, and they won't be dumped
into profile data. There is no need to allocate memory for covmap sections.
A good side effect of this change is that the coverage map data won't be mistakenly
garbage collected by the linker (for Gold linker only, BFD linker has an issue where the a bug is filed).
Tested with clang build with instrumentation and -fcoverage-mapping and linker GC. The size of
covmap section is ~17.6M so the text segment size will be reduced by this amount with this change.
llvm-svn: 257781
Reid Kleckner [Thu, 14 Jan 2016 18:03:29 +0000 (18:03 +0000)]
Use std::map::insert instead of emplace for libstdc++ 4.7
llvm-svn: 257780
Reid Kleckner [Thu, 14 Jan 2016 17:52:01 +0000 (17:52 +0000)]
Print function names when they are referenced via TypeIndex
llvm-svn: 257778
Reid Kleckner [Thu, 14 Jan 2016 17:51:57 +0000 (17:51 +0000)]
[readobj] Add functionality to dump relocations inside of binary blobs
llvm-svn: 257777
Reid Kleckner [Thu, 14 Jan 2016 17:51:54 +0000 (17:51 +0000)]
[codeview] Print relocations against code and data offset fields
These fields are almost always zero. However, there are relocations
against them, and we should print the relocation symbol with it as
SYM+0xNN.
llvm-svn: 257776
James Y Knight [Thu, 14 Jan 2016 16:33:21 +0000 (16:33 +0000)]
Revert "Stop increasing alignment of externally-visible globals on ELF platforms."
This reverts commit r257719, due to PR26144.
llvm-svn: 257775
Dan Gohman [Thu, 14 Jan 2016 16:00:13 +0000 (16:00 +0000)]
[WebAssembly] Configure some simple include paths and runtime library settings.
llvm-svn: 257774
James Molloy [Thu, 14 Jan 2016 15:49:32 +0000 (15:49 +0000)]
Revert "[ValueTracking] Understand more select patterns in ComputeKnownBits"
This reverts commit r257769. Backing this out because of stage2 failures.
llvm-svn: 257773
Aidan Dodds [Thu, 14 Jan 2016 15:39:28 +0000 (15:39 +0000)]
[RenderScript] Hook kernel invocation.
This patch adds a hook to track kernel invocations and to track all script and allocation objects used.
llvm-svn: 257772
Krzysztof Parzyszek [Thu, 14 Jan 2016 15:37:16 +0000 (15:37 +0000)]
[Hexagon] Expand pseudo instruction Insert4
llvm-svn: 257771
Krzysztof Parzyszek [Thu, 14 Jan 2016 15:24:15 +0000 (15:24 +0000)]
Unxfail passing testcase on Hexagon
llvm-svn: 257770
James Molloy [Thu, 14 Jan 2016 15:23:19 +0000 (15:23 +0000)]
[ValueTracking] Understand more select patterns in ComputeKnownBits
Some patterns of select+compare allow us to know exactly the value of the uppermost bits in the select result. For example:
%b = icmp ugt i32 %a, 5
%c = select i1 %b, i32 2, i32 %a
Here we know that %c is bounded by 5, and therefore KnownZero = ~APInt(5).getActiveBits() = ~7.
There are several such patterns, and this patch attempts to understand a reasonable subset of them - namely when the base values are the same (as above), and when they are related by a simple (add nsw), for example (add nsw %a, 4) and %a.
llvm-svn: 257769
Krzysztof Parzyszek [Thu, 14 Jan 2016 15:05:27 +0000 (15:05 +0000)]
[Hexagon] Handle branches with non-mbb operands
llvm-svn: 257768
James Molloy [Thu, 14 Jan 2016 15:00:09 +0000 (15:00 +0000)]
[LTO] Add a run of LoopUnroll
Loop trip counts can often be resolved during LTO. We should obviously be unrolling small loops once those trip counts have been resolved, but we weren't.
llvm-svn: 257767
Benjamin Kramer [Thu, 14 Jan 2016 14:33:04 +0000 (14:33 +0000)]
[ARM] Use the efficient version of BitVector::set and a static_assert.
No functional change intended.
llvm-svn: 257766