Matthias Braun [Thu, 28 Jul 2016 18:40:00 +0000 (18:40 +0000)]
MachineFunction: Return reference for getFrameInfo(); NFC
getFrameInfo() never returns nullptr so we should use a reference
instead of a pointer.
llvm-svn: 277017
Luke Drummond [Thu, 28 Jul 2016 18:19:33 +0000 (18:19 +0000)]
Cleanup some format string warnings
Clean up format string warnings in ValueObjectSyntheticFilter.cpp to explictly cast "%p" params to void *`
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D22923
llvm-svn: 277016
Reid Kleckner [Thu, 28 Jul 2016 18:17:01 +0000 (18:17 +0000)]
Fix dangling reference to temporary in use of ArrayRef
Fixes tests locally for me with MSVC 2015.
llvm-svn: 277015
Rafael Espindola [Thu, 28 Jul 2016 18:16:24 +0000 (18:16 +0000)]
Add support for SEGMENT_START.
This is a bit of an odd feature. It is normally used in
. = SEGMENT_START(seg, val);
In bfd it evaluates to val or to the value of the corresponding
-T<seg>-segment. Note that the -T<seg>-segment in bfd doesn't actually
change the segment address, just the value this evaluates too,
including in the default linker script.
In gold the -T<seg>-segment options do change the segment address and
seeing this expressions in linker scripts disables the options.
For new this just always evaluates the expression to val.
llvm-svn: 277014
Saleem Abdulrasool [Thu, 28 Jul 2016 18:16:07 +0000 (18:16 +0000)]
Host: correct use of std::condition_variable::wait_for
std::condition::wait_for takes a std::unique_lock<T>. The previous commit
accidentally left a reference to `m_mutex` instead of `lock`. Update that.
Should restore the android lldb builder to green.
llvm-svn: 277013
Todd Fiala [Thu, 28 Jul 2016 17:56:26 +0000 (17:56 +0000)]
Fixed up Xcode build for r276976 and r277011.
Also, fixed up typos in RenderScript code that could
not possibly compile.
llvm-svn: 277012
Saleem Abdulrasool [Thu, 28 Jul 2016 17:32:20 +0000 (17:32 +0000)]
Clean up vestigial remnants of locking primitives
This finally removes the use of the Mutex and Condition classes. This is an
intricate patch as the Mutex and Condition classes were tied together.
Furthermore, many places had slightly differing uses of time values. Convert
timeout values to relative everywhere to permit the use of
std::chrono::duration, which is required for the use of
std::condition_variable's timeout. Adjust all Condition and related Mutex
classes over to std::{,recursive_}mutex and std::condition_variable.
This change primarily comes at the cost of breaking the TracingMutex which was
based around the Mutex class. It would be possible to write a wrapper to
provide similar functionality, but that is beyond the scope of this change.
llvm-svn: 277011
Devin Coughlin [Thu, 28 Jul 2016 17:18:33 +0000 (17:18 +0000)]
[analyzer] Fix misleading indentation in ObjCDeallocChecker. NFC.
llvm-svn: 277009
John Brawn [Thu, 28 Jul 2016 17:17:22 +0000 (17:17 +0000)]
Revert r276973 "Adjust Registry interface to not require plugins to export a registry"
Buildbot failures when building with clang -Werror. Reverting while I try to
figure this out.
llvm-svn: 277008
Ahmed Bougacha [Thu, 28 Jul 2016 17:15:15 +0000 (17:15 +0000)]
[AArch64][GlobalISel] Select G_BR.
This is the first unsized instruction we support; move down the
'sized' check to binops.
llvm-svn: 277007
Ahmed Bougacha [Thu, 28 Jul 2016 17:15:12 +0000 (17:15 +0000)]
[MIRParser] Accept unsized generic instructions.
Since r276158, we require generic instructions to have a sized type.
G_BR doesn't; relax the restriction.
llvm-svn: 277006
Zachary Turner [Thu, 28 Jul 2016 17:13:32 +0000 (17:13 +0000)]
[Driver] Fix Windows SDK Detection
This fixes a couple of bugs in Windows SDK Detection.
1. `readFullStringValue` returns a bool, but was being compared
with ERROR_SUCCESS.
2. `RegQueryValueExW` might return the null terminator in the
queried value which will result in incorrect values being
returned from `getSystemRegistryString`.
Patch By: comicfans44@gmail.com
Reviewed By: zturner
Differential Revision: http://reviews.llvm.org/D21946
llvm-svn: 277005
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:35 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Select GPR G_SUB.
llvm-svn: 277003
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:31 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Select GPR G_AND.
llvm-svn: 277002
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:27 +0000 (16:58 +0000)]
[GlobalISel] Remove types on selected insts instead of using LLT().
LLT() has a particular meaning: it's one invalid type. But we really
want selected instructions to have no type whatsoever.
Also verify that types don't linger after ISel, and enable the verifier
on the AArch64 select test.
llvm-svn: 277001
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:21 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.
llvm-svn: 277000
Lang Hames [Thu, 28 Jul 2016 16:56:26 +0000 (16:56 +0000)]
[lld][MachO] Fix bugs in the debug-syms test case.
The previous run line depended on libSystem.dylib being present, which it's not
on non-darwin platforms. The new run line uses libSystem.yaml instead.
llvm-svn: 276999
Wei Ding [Thu, 28 Jul 2016 16:42:13 +0000 (16:42 +0000)]
AMDGPU : Add intrinsics for compare with the full wavefront result
Differential Revision: http://reviews.llvm.org/D22482
llvm-svn: 276998
Sjoerd Meijer [Thu, 28 Jul 2016 16:32:22 +0000 (16:32 +0000)]
TargetInstrInfo: rename GetInstSizeInBytes to getInstSizeInBytes. NFC
Differential Revision: https://reviews.llvm.org/D22925
llvm-svn: 276997
Samuel Antao [Thu, 28 Jul 2016 16:18:31 +0000 (16:18 +0000)]
[CUDA] Remove duplicated test that should have been removed in r276995.
llvm-svn: 276996
Samuel Antao [Thu, 28 Jul 2016 16:12:30 +0000 (16:12 +0000)]
[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other tests.
llvm-svn: 276995
Daniel Sanders [Thu, 28 Jul 2016 15:59:06 +0000 (15:59 +0000)]
[mips] Fix a warning that occurs on some gcc 4.9.2's but not all of them.
llvm-svn: 276993
Daniel Sanders [Thu, 28 Jul 2016 15:37:42 +0000 (15:37 +0000)]
Revert r276982 and r276984: [mips][fastisel] Handle 0-4 arguments without SelectionDAG
It seems that the stack offset in callabi.ll varies between machines. I'll look
into it.
llvm-svn: 276989
Samuel Antao [Thu, 28 Jul 2016 15:31:29 +0000 (15:31 +0000)]
[OpenMP] Change name of variable in mappble expression.
This attempts to fix a failure in Windows bots pottentially related with a reserved keyword.
llvm-svn: 276988
Craig Topper [Thu, 28 Jul 2016 15:28:56 +0000 (15:28 +0000)]
[X86] Remove CustomInserter for FMA3 instructions. Looks like since we got full commuting support for FMAs after this was added, the coalescer can now get this right on its own.
Differential Revision: https://reviews.llvm.org/D22799
llvm-svn: 276987
Daniel Sanders [Thu, 28 Jul 2016 15:13:23 +0000 (15:13 +0000)]
[mips] Reword debug message as should have been done before committing r276982
llvm-svn: 276984
Samuel Antao [Thu, 28 Jul 2016 14:56:19 +0000 (14:56 +0000)]
[OpenMP] Fix link command pattern in offloading interoperability test.
It was causing a few bots to fail.
llvm-svn: 276983
Daniel Sanders [Thu, 28 Jul 2016 14:55:28 +0000 (14:55 +0000)]
[mips][fastisel] Handle 0-4 arguments without SelectionDAG.
Summary:
Implements fastLowerArguments() to avoid the need to fall back on
SelectionDAG for 0-4 argument functions that don't do tricky things like
passing double in a pair of i32's.
This allows us to move all except one test to -fast-isel-abort=3. The
remaining one has function prototypes of the form 'i32 (i32, double, double)'
which requires floats to be passed in GPR's.
Reviewers: sdardis
Subscribers: dsanders, llvm-commits, sdardis
Differential Revision: https://reviews.llvm.org/D22680
llvm-svn: 276982
Samuel Antao [Thu, 28 Jul 2016 14:47:35 +0000 (14:47 +0000)]
[OpenMP] Do not use default argument in lambda from mappable expressions handlers.
Windows bots were complaining about that.
llvm-svn: 276981
Tom Stellard [Thu, 28 Jul 2016 14:30:43 +0000 (14:30 +0000)]
AMDGPU/SI: Don't use reserved VGPRs for SGPR spilling
Summary:
We were using reserved VGPRs for SGPR spilling and this was causing
some programs with a workgroup size of 1024 to use more than 64
registers, which is illegal.
Reviewers: arsenm, mareko, nhaehnle
Subscribers: nhaehnle, arsenm, llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D22032
llvm-svn: 276980
Samuel Antao [Thu, 28 Jul 2016 14:29:18 +0000 (14:29 +0000)]
[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.
Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.
This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, tra, ABataev
Subscribers: caomhin, cfe-commits
Differential Revision: https://reviews.llvm.org/D22895
llvm-svn: 276979
Samuel Antao [Thu, 28 Jul 2016 14:25:09 +0000 (14:25 +0000)]
[OpenMP] Code generation for the is_device_ptr clause
Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev
Subscribers: caomhin, cfe-commits
Differential Revision: https://reviews.llvm.org/D22788
llvm-svn: 276978
Samuel Antao [Thu, 28 Jul 2016 14:23:26 +0000 (14:23 +0000)]
[OpenMP] Codegen for use_device_ptr clause.
Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev
Subscribers: caomhin, cfe-commits
Differential Revision: https://reviews.llvm.org/D22691
llvm-svn: 276977
Luke Drummond [Thu, 28 Jul 2016 14:21:07 +0000 (14:21 +0000)]
Add IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 backend
Expression evaluation for function calls to certain public RenderScript
API functions in libRSCPURef can segfault.
`slang`,
the compiler frontend for RenderScript embeds an ARM specific triple in
IR that is shipped in the app, after generating IR that has some
assumptions that an ARM device is the target.
As the IR is then compiled on a device of unknown (at time the IR was
generated at least) architecture, when calling RenderScript API function
as part of debugger expressions, we have to perform a fixup pass that
removes those assumptions right before the module is sent to be
generated by the llvm backend.
This issue is caused by multiple problems with the ARMv7-specific
assumptions encoded in the LLVM IR. x86 large value returns use a hidden
first argument (mapping to llvm::Attribute::StructRet), which can't be
picked up by the JIT due to the mismatch between IR generated by the
slang frontend and llvm backend. This means that code generated by bcc
did not necessarily match the default SysV Linux/Android ABI used by the
LLDB JIT
- Original Authors: Luke Drummond (@ldrumm), Function declarations fixed by Aidan Dodds (@ADodds)
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D18059
llvm-svn: 276976
Simon Pilgrim [Thu, 28 Jul 2016 13:42:57 +0000 (13:42 +0000)]
Removed unused variables
llvm-svn: 276975
Simon Pilgrim [Thu, 28 Jul 2016 13:29:56 +0000 (13:29 +0000)]
Fix signed/unsigned warning.
llvm-svn: 276974
John Brawn [Thu, 28 Jul 2016 12:48:17 +0000 (12:48 +0000)]
Reapply r276856 "Adjust Registry interface to not require plugins to export a registry"
This version has two fixes compared to the original:
* In Registry.h the template static members are instantiated before they are
used, as clang gives an error if you do it the other way around.
* The use of the Registry template in clang-tidy is updated in the same way as
has been done everywhere else.
Original commit message:
Currently the Registry class contains the vestiges of a previous attempt to
allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a
plugin would have its own copy of a registry and export it to be imported by
the tool that's loading the plugin. This only works if the plugin is entirely
self-contained with the only interface between the plugin and tool being the
registry, and in particular this conflicts with how IR pass plugins work.
This patch changes things so that instead the add_node function of the registry
is exported by the tool and then imported by the plugin, which solves this
problem and also means that instead of every plugin having to export every
registry they use instead LLVM only has to export the add_node functions. This
allows plugins that use a registry to work on Windows if
LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used.
llvm-svn: 276973
Nicolai Haehnle [Thu, 28 Jul 2016 11:39:24 +0000 (11:39 +0000)]
AMDGPU: add execfix flag to SI_ELSE
Summary:
SI_ELSE is lowered into two parts:
s_or_saveexec_b64 dst, src (at the start of the basic block)
s_xor_b64 exec, exec, dst (at the end of the basic block)
The idea is that dst contains the exec mask of the preceding IF block. It can
happen that SIWholeQuadMode decides to switch from WQM to Exact mode inside
the basic block that contains SI_ELSE, in which case it introduces an instruction
s_and_b64 exec, exec, s[...]
which masks out bits that can correspond to both the IF and the ELSE paths.
So the resulting sequence must be:
s_or_savexec_b64 dst, src
s_and_b64 exec, exec, s[...] <-- added by SIWholeQuadMode
s_and_b64 dst, dst, exec <-- added by SILowerControlFlow
s_xor_b64 exec, exec, dst
Whether to add the additional s_and_b64 dst, dst, exec is currently determined
via the ExecModified tracking. With this change, it is instead determined by
an additional flag on SI_ELSE which is set by SIWholeQuadMode.
Finally: It also occured to me that an alternative approach for the long run
is for SILowerControlFlow to unconditionally emit
s_or_saveexec_b64 dst, src
...
s_and_b64 dst, dst, exec
s_xor_b64 exec, exec, dst
and have a pass that detects and cleans up the "redundant AND with exec"
pattern where possible. This could be useful anyway, because we also add
instructions
s_and_b64 vcc, exec, vcc
before s_cbranch_scc (in moveToALU), and those are often redundant. I have
some pending changes to how KILL is lowered that could also benefit from
such a cleanup pass.
In any case, this current patch could help in the short term with the whole
ExecModified business.
Reviewers: tstellarAMD, arsenm
Subscribers: arsenm, llvm-commits, kzhuravl
Differential Revision: https://reviews.llvm.org/D22846
llvm-svn: 276972
Kirill Bobyrev [Thu, 28 Jul 2016 10:31:16 +0000 (10:31 +0000)]
[clang-rename] remove redundant *_cast<> traversal
llvm-svn: 276971
Vassil Vassilev [Thu, 28 Jul 2016 10:26:33 +0000 (10:26 +0000)]
[modules] Add missing includes.
llvm-svn: 276970
Daniel Jasper [Thu, 28 Jul 2016 09:54:35 +0000 (09:54 +0000)]
Remove two tests added in r276957.
These loop from 0 to AEK_XSCALE, which is currently defined as 0x80000000, and
thus the tests loop over the entire int range, which is unreasonable
and also too slow in debug builds.
llvm-svn: 276969
Sylvestre Ledru [Thu, 28 Jul 2016 09:28:58 +0000 (09:28 +0000)]
fix some typos in the doc
llvm-svn: 276968
Kirill Bobyrev [Thu, 28 Jul 2016 09:05:06 +0000 (09:05 +0000)]
[clang-rename] USRFinder.cpp cleanup
llvm-svn: 276967
Zijiao Ma [Thu, 28 Jul 2016 07:29:45 +0000 (07:29 +0000)]
R276957 broke bot clang-ppc64be-linux-multistage,try to fix it.
llvm-svn: 276966
George Rimar [Thu, 28 Jul 2016 07:18:23 +0000 (07:18 +0000)]
[ELF] - Linkerscript: ignore SORT(CONSTRUCTORS)
Some scripts can contain SORT(CONSTRUCTORS) expression:
https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l152
for ELF it just a nop:
"When linking object file formats which do not support arbitrary sections, such as ECOFF and XCOFF, the linker will automatically recognize C++ global constructors and destructors by name. For these object file formats, the CONSTRUCTORS command tells the linker to place constructor information in the output section where the CONSTRUCTORS command appears. The CONSTRUCTORS command is ignored for other object file formats."
(http://www.sourceware.org/binutils/docs-2.10/ld_3.html)
So patch implements ignoring.
Differential revision: https://reviews.llvm.org/D22848
llvm-svn: 276965
Tobias Grosser [Thu, 28 Jul 2016 07:08:34 +0000 (07:08 +0000)]
Add missing REQUIRES line
llvm-svn: 276964
Tobias Grosser [Thu, 28 Jul 2016 06:47:59 +0000 (06:47 +0000)]
GPGPU: Pass context parameters to GPU kernel
llvm-svn: 276963
Tobias Grosser [Thu, 28 Jul 2016 06:47:56 +0000 (06:47 +0000)]
GPGPU: Pass host iterators to kernel
llvm-svn: 276962
Tobias Grosser [Thu, 28 Jul 2016 06:47:53 +0000 (06:47 +0000)]
GPGPU: use current 'Index' to find slot in parameter array
Before this change we used the array index, which would result in us accessing
the parameter array out-of-bounds. This bug was visible for test cases where not
all arrays in a scop are passed to a given kernel.
llvm-svn: 276961
Tobias Grosser [Thu, 28 Jul 2016 06:47:50 +0000 (06:47 +0000)]
GPGPU: Generate kernel parameter allocation with right size
Before this change we miscounted the number of function parameters.
llvm-svn: 276960
David Majnemer [Thu, 28 Jul 2016 06:39:48 +0000 (06:39 +0000)]
[ConstantFolding] Don't bail on folding if ConstantFoldConstantExpression fails
When folding an expression, we run ConstantFoldConstantExpression on
each operand of that expression.
However, ConstantFoldConstantExpression can fail and retur nullptr.
Previously, we would bail on further refining the expression.
Instead, use the original operand and see if we can refine a later
operand.
llvm-svn: 276959
Zijiao Ma [Thu, 28 Jul 2016 06:24:48 +0000 (06:24 +0000)]
[AArch64] Using AArch64TargetParser in Clang.
This resubmit r270688 which broke some specific buildbots.That's because
there is incorrect indexing problem in the targetparser,and the problem is
fixed in r276957.
Differential Revision: https://reviews.llvm.org/D21277
llvm-svn: 276958
Zijiao Ma [Thu, 28 Jul 2016 06:11:18 +0000 (06:11 +0000)]
Add unittests to {ARM | AArch64}TargetParser.
Add unittest to {ARM | AArch64}TargetParser,and by the way correct problems as below:
1.Correct a incorrect indexing problem in AArch64TargetParser. The architecture enumeration
is shared across ARM and AArch64 in original implementation.But In the code,I just used the
index which was offset by the ARM, and this would index into the array incorrectly. To make
AArch64 has its own arch enum,or we will do a lot of slowly iterating.
2.Correct a spelling error. The parameter of llvm::AArch64::getArchExtName.
3.Correct a writing mistake, in llvm::ARM::parseArchISA.
Differential Revision: https://reviews.llvm.org/D21785
llvm-svn: 276957
David Majnemer [Thu, 28 Jul 2016 05:03:22 +0000 (05:03 +0000)]
[CodeView] Don't crash on functions without subprograms
A function may have instructions annotated with debug info without
having a subprogram.
This fixes PR28747.
llvm-svn: 276956
Marshall Clow [Thu, 28 Jul 2016 04:52:02 +0000 (04:52 +0000)]
Add a bunch of noexcepts to char_traits and string_view.
llvm-svn: 276955
Jason Molenda [Thu, 28 Jul 2016 04:18:44 +0000 (04:18 +0000)]
Add some logging to the kernel dynamicloader plugin when we fail to read
a kext binary from memory.
<rdar://problem/
26158095>
llvm-svn: 276954
David Majnemer [Thu, 28 Jul 2016 03:28:43 +0000 (03:28 +0000)]
Add EP_CGSCCOptimizerLate extension point to PassManagerBuilder
The EP_CGSCCOptimizerLate extension point allows adding CallGraphSCC
passes at the end of the main CallGraphSCC passes and before any
function simplification passes run by CGPassManager.
Patch by Gor Nishanov!
Differential Revision: https://reviews.llvm.org/D22897
llvm-svn: 276953
David Majnemer [Thu, 28 Jul 2016 02:29:06 +0000 (02:29 +0000)]
[InstCombine] Handle failures from ConstantFoldConstantExpression
ConstantFoldConstantExpression returns null when folding fails.
This fixes PR28745.
llvm-svn: 276952
Etienne Bergeron [Thu, 28 Jul 2016 01:35:32 +0000 (01:35 +0000)]
Fix broken build bot
The address resolution is ussing RTLD_NEXT and not RTLD_DEFAULT.
Which means &func may not be equivalent to dlsym("func").
llvm-svn: 276951
Devin Coughlin [Thu, 28 Jul 2016 00:52:10 +0000 (00:52 +0000)]
[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.
This was an oversight from when I added BeginFunction support in r261293.
llvm-svn: 276950
Saleem Abdulrasool [Thu, 28 Jul 2016 00:43:14 +0000 (00:43 +0000)]
test: fix typo in file name (NFC)
llvm-svn: 276949
Saleem Abdulrasool [Thu, 28 Jul 2016 00:42:01 +0000 (00:42 +0000)]
clang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls
Ensure that Context is always properly initialised in the constructor. It is
used for querying the LangOpts in VisitTypeLoc. Prevent a null pointer
dereference in setResult by ensuring that a RecordDecl is being handled.
Patch by Alexander Shaposhnikov!
llvm-svn: 276948
Nirav Dave [Thu, 28 Jul 2016 00:36:34 +0000 (00:36 +0000)]
Replace preserve-as-comments CodeGen test with driver test
llvm-svn: 276947
Matt Arsenault [Thu, 28 Jul 2016 00:32:05 +0000 (00:32 +0000)]
AMDGPU: Turn dead checks into asserts
llvm-svn: 276946
Matt Arsenault [Thu, 28 Jul 2016 00:32:02 +0000 (00:32 +0000)]
AMDGPU: Remove analyzeImmediate
This no longer uses the more complicated classification
of constants.
llvm-svn: 276945
Lang Hames [Thu, 28 Jul 2016 00:28:48 +0000 (00:28 +0000)]
[lld][MachO] Remove some debugging output code that was mistakenly left in in
r276935.
llvm-svn: 276944
Wei Mi [Wed, 27 Jul 2016 23:53:58 +0000 (23:53 +0000)]
Fix the assertion error in collectLoopUniforms caused by empty Worklist before expanding.
Contributed-by: David Callahan
Differential Revision: https://reviews.llvm.org/D22886
llvm-svn: 276943
Justin Lebar [Wed, 27 Jul 2016 23:46:57 +0000 (23:46 +0000)]
Don't invoke getName() from Function::isIntrinsic().
Summary:
getName() involves a hashtable lookup, so is expensive given how
frequently isIntrinsic() is called. (In particular, many users cast to
IntrinsicInstr or one of its subclasses before calling
getIntrinsicID().)
This has an incidental functional change: Before, isIntrinsic() would
return true for any function whose name started with "llvm.", even if it
wasn't properly an intrinsic. The new behavior seems more correct to
me, because it's strange to say that isIntrinsic() is true, but
getIntrinsicId() returns "not an intrinsic".
Some callers want the old behavior -- they want to know whether the
caller is a recognized intrinsic, or might be one in some other version
of LLVM. For them, we added Function::hasLLVMReservedName(), which
checks whether the name starts with "llvm.".
This change is good for a 1.5% e2e speedup compiling a large Eigen
benchmark.
Reviewers: bogner
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D22065
llvm-svn: 276942
Michael Zolotukhin [Wed, 27 Jul 2016 23:35:53 +0000 (23:35 +0000)]
Add verifyAnalysis for LCSSA.
Summary:
LCSSAWrapperPass currently doesn't override verifyAnalysis method, so pass
manager doesn't verify LCSSA. This patch adds the method so that we start
verifying LCSSA between loop passes.
Reviewers: chandlerc, sanjoy, hfinkel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22888
llvm-svn: 276941
George Burgess IV [Wed, 27 Jul 2016 23:07:07 +0000 (23:07 +0000)]
[CFLAA] Add getModRefBehavior to CFLAnders.
This patch lets CFLAnders respond to mod-ref queries. It also includes
a small bugfix to CFLSteens.
Patch by Jia Chen.
Differential Revision: https://reviews.llvm.org/D22823
llvm-svn: 276939
Justin Lebar [Wed, 27 Jul 2016 23:06:00 +0000 (23:06 +0000)]
[LSV] Use Instruction*s rather than Value*s where possible.
Summary:
Given the crash in D22878, this patch converts the load/store vectorizer
to use explicit Instruction*s wherever possible. This is an overall
simplification and should be an improvement in safety, as we have fewer
naked cast<>s, and now where we use Value*, we really mean something
different from Instruction*.
This patch also gets rid of some cast<>s around Value*s returned by
Builder. Given that Builder constant-folds everything, we can't assume
much about what we get out of it.
One downside of this patch is that we have to copy our chain before
calling propagateMetadata. But I don't think this is a big deal, as our
chains are very small (usually 2 or 4 elems).
Reviewers: asbirlea
Subscribers: mzolotukhin, llvm-commits, arsenm
Differential Revision: https://reviews.llvm.org/D22887
llvm-svn: 276938
Vedant Kumar [Wed, 27 Jul 2016 23:02:20 +0000 (23:02 +0000)]
Retry: [Driver] Compute effective target triples once per job (NFCI)
Compute an effective triple once per job. Cache the triple in the
prevailing ToolChain for the duration of the job.
Clients which need effective triples now look them up in the ToolChain.
This eliminates wasteful re-computation of effective triples (e.g in
getARMFloatABI()).
While we're at it, delete MachO::ComputeEffectiveClangTriple. It was a
no-op override.
Differential Revision: https://reviews.llvm.org/D22596
llvm-svn: 276937
Vedant Kumar [Wed, 27 Jul 2016 23:01:55 +0000 (23:01 +0000)]
Revert "[Driver] Compute effective target triples once per job (NFCI)"
This reverts commit r275895 in order to address some post-commit review
feedback from Eric Christopher (see: the list thread for r275895).
llvm-svn: 276936
Lang Hames [Wed, 27 Jul 2016 22:55:30 +0000 (22:55 +0000)]
[lld][MachO] Re-apply r276921 with fix - initialize strings for debug string
copies.
llvm-svn: 276935
Samuel Antao [Wed, 27 Jul 2016 22:52:16 +0000 (22:52 +0000)]
[OpenMP] Add support to map member expressions with references to pointers.
Summary: This patch add support to map pointers through references in class members. Although a reference does not have storage that a user can access, it still has to be mapped in order to get the deep copy right and the dereferencing code work properly.
Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev
Subscribers: caomhin, cfe-commits
Differential Revision: https://reviews.llvm.org/D22787
llvm-svn: 276934
Samuel Antao [Wed, 27 Jul 2016 22:49:49 +0000 (22:49 +0000)]
[OpenMP] Add support for mapping array sections through pointer references.
Summary:
This patch fixes a bug in the map of array sections whose base is a reference to a pointer. The existing mapping support was not prepared to deal with it, causing the compiler to crash.
Mapping a reference to a pointer enjoys the same characteristics of a regular pointer, i.e., it is passed by value. Therefore, the reference has to be materialized in the target region.
Reviewers: hfinkel, carlo.bertolli, kkwli0, ABataev
Subscribers: caomhin, cfe-commits
Differential Revision: https://reviews.llvm.org/D22690
llvm-svn: 276933
Matthias Braun [Wed, 27 Jul 2016 22:47:09 +0000 (22:47 +0000)]
Basic/Targets.cpp: Reformat aarch64 CPU list.
Having 1 entry per line and an alphabetical order is clearer and reduces
the risk of invalid merges.
llvm-svn: 276931
Matthias Braun [Wed, 27 Jul 2016 22:47:07 +0000 (22:47 +0000)]
test/Frontend: Add a test for aarch64 target CPU names.
Nothing else checked the target cpu names for aarch64 yet.
Add a test in the spirit of x86-target-cpu.c.
llvm-svn: 276930
Samuel Antao [Wed, 27 Jul 2016 22:46:31 +0000 (22:46 +0000)]
Refactor how include paths are appended to the command arguments.
Summary:
This patch aims at removing redundancy in the way include paths for the regular and offloading toolchains are appended to the arguments list in the clang tool.
This was suggested by @rsmith in response to r275931.
Reviewers: rsmith, tra
Subscribers: rsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D22518
llvm-svn: 276929
Lang Hames [Wed, 27 Jul 2016 22:46:02 +0000 (22:46 +0000)]
[lld][MachO] Temporarily revert r276921 - it's causing bot-failures on Linux.
llvm-svn: 276928
Justin Lebar [Wed, 27 Jul 2016 22:36:21 +0000 (22:36 +0000)]
[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different from the clang type's alignment.
Summary:
Before this patch, we computed the offsets in memory of args passed to
GPU kernel functions by throwing all of the args into an LLVM struct.
clang emits packed llvm structs basically whenever it feels like it, and
packed structs have alignment 1. So we cannot rely on the llvm type's
alignment matching the C++ type's alignment.
This patch fixes our codegen so we always respect the clang types'
alignments.
Reviewers: rnk
Subscribers: cfe-commits, tra
Differential Revision: https://reviews.llvm.org/D22879
llvm-svn: 276927
Justin Lebar [Wed, 27 Jul 2016 22:33:36 +0000 (22:33 +0000)]
[LVI] Use DenseMap::find_as in LazyValueInfo.
Summary:
This lets us avoid creating and destroying a CallbackVH every time we
check the cache.
This is good for a 2% e2e speedup when compiling one of the large Eigen
tests at -O3.
FTR, I tried making the ValueCache hashtable one-level -- i.e., mapping
a pair (Value*, BasicBlock*) to a lattice value, and that didn't seem to
provide any additional improvement. Saving a word in LVILatticeVal by
merging the Tag and Val fields also didn't yield a speedup.
Reviewers: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D21951
llvm-svn: 276926
Justin Lebar [Wed, 27 Jul 2016 22:04:24 +0000 (22:04 +0000)]
Don't crash when generating code for __attribute__((naked)) member functions.
Summary:
Previously this crashed inside EmitThisParam(). There should be no
prelude for naked functions, so just skip the whole thing.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22715
llvm-svn: 276925
Vedant Kumar [Wed, 27 Jul 2016 21:57:15 +0000 (21:57 +0000)]
[llvm-cov] Add a debug mode for source range highlighting (in html)
llvm-cov's `-dump' option now emits information which helps debug source
range highlighting in html mode.
llvm-svn: 276924
Justin Lebar [Wed, 27 Jul 2016 21:45:48 +0000 (21:45 +0000)]
[LSV] Don't assume that bitcast ops are Instructions.
Summary:
When we ask the builder to create a bitcast on a constant, we get back a
constant, not an instruction.
Reviewers: asbirlea
Subscribers: jholewinski, mzolotukhin, llvm-commits, arsenm
Differential Revision: https://reviews.llvm.org/D22878
llvm-svn: 276922
Lang Hames [Wed, 27 Jul 2016 21:31:25 +0000 (21:31 +0000)]
[lld][MachO] Add debug info support for MachO.
This patch causes LLD to build stabs debugging symbols for files containing
DWARF debug info, and to propagate existing stabs symbols for object files
built using '-r' mode. This enables debugging of binaries generated by LLD
from MachO objects.
llvm-svn: 276921
Krzysztof Parzyszek [Wed, 27 Jul 2016 21:20:54 +0000 (21:20 +0000)]
[Hexagon] Find speculative loop preheader in hardware loop generation
Before adding a new preheader block, check if there is a candidate block
where the loop setup could be placed speculatively. This will be off by
default.
llvm-svn: 276919
Michael Kuperstein [Wed, 27 Jul 2016 20:59:51 +0000 (20:59 +0000)]
[X86] Factor out another piece of the SAD combine. NFCI.
llvm-svn: 276918
Krzysztof Parzyszek [Wed, 27 Jul 2016 20:58:43 +0000 (20:58 +0000)]
[Hexagon] Add option to bisect spill slot optimization
llvm-svn: 276917
Krzysztof Parzyszek [Wed, 27 Jul 2016 20:50:42 +0000 (20:50 +0000)]
[Hexagon] Do not optimize volatile stack spill slots
llvm-svn: 276916
Nirav Dave [Wed, 27 Jul 2016 20:48:39 +0000 (20:48 +0000)]
Add target triple in test
llvm-svn: 276915
Greg Clayton [Wed, 27 Jul 2016 20:47:49 +0000 (20:47 +0000)]
Fixed "void SBWatchpoint::SetEnabled (bool enabled)" to work properly and added a test for it.
https://llvm.org/bugs/show_bug.cgi?id=28729
<rdar://problem/
27575225>
llvm-svn: 276914
Hans Wennborg [Wed, 27 Jul 2016 20:38:01 +0000 (20:38 +0000)]
build_llvm_package.bat: try tests three times
Sometimes they're flaky on Windows, and starting the whole thing
over is painful.
llvm-svn: 276913
Matt Masten [Wed, 27 Jul 2016 20:23:32 +0000 (20:23 +0000)]
test commit
llvm-svn: 276912
Matt Masten [Wed, 27 Jul 2016 20:22:21 +0000 (20:22 +0000)]
test commit
llvm-svn: 276911
Kyle Butt [Wed, 27 Jul 2016 20:19:33 +0000 (20:19 +0000)]
Codegen: IfConversion: Factor out a function to count dup instrs.
Factor out countDuplicatedInstructions to Count duplicated instructions at the
beginning and end of a diamond pattern. This is in prep for adding support for
diamonds that need to be tail-merged.
llvm-svn: 276910
Kyle Butt [Wed, 27 Jul 2016 20:19:31 +0000 (20:19 +0000)]
Codegen: IfConversion: add const qualifier. NFC
Add a const qualifier to ReverseBranchCondition.
llvm-svn: 276909
Vedant Kumar [Wed, 27 Jul 2016 19:59:44 +0000 (19:59 +0000)]
Revert "[llvm-cov] Minor aesthetic improvements for html reports"
This reverts commit r276906. It breaks tests.
llvm-svn: 276908
Nirav Dave [Wed, 27 Jul 2016 19:57:40 +0000 (19:57 +0000)]
Add flags to toggle preservation of assembly comments
Summary: Add -fpreserve-as-comments and -fno-preserve-as-comments.
Reviewers: echristo, rnk
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D22883
llvm-svn: 276907
Vedant Kumar [Wed, 27 Jul 2016 19:51:17 +0000 (19:51 +0000)]
[llvm-cov] Minor aesthetic improvements for html reports
This fixes the highlighting for lines without any coverage segments. I
don't have a neat way of testing this yet, but am working on it.
llvm-svn: 276906