platform/upstream/llvm.git
8 years ago[AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.
Ahmed Bougacha [Thu, 28 Jul 2016 16:58:21 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Remove 'alignment' from MIR tests. NFC.

llvm-svn: 277000

8 years ago[lld][MachO] Fix bugs in the debug-syms test case.
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

8 years agoAMDGPU : Add intrinsics for compare with the full wavefront result
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

8 years agoTargetInstrInfo: rename GetInstSizeInBytes to getInstSizeInBytes. NFC
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

8 years ago[CUDA] Remove duplicated test that should have been removed in r276995.
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

8 years ago[CUDA] Rename cuda_phases.cu test to cuda-phases.cu to be consistent with the other...
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

8 years ago[mips] Fix a warning that occurs on some gcc 4.9.2's but not all of them.
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

8 years agoRevert r276982 and r276984: [mips][fastisel] Handle 0-4 arguments without SelectionDAG
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

8 years ago[OpenMP] Change name of variable in mappble expression.
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

8 years ago[X86] Remove CustomInserter for FMA3 instructions. Looks like since we got full commu...
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

8 years ago[mips] Reword debug message as should have been done before committing r276982
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

8 years ago[OpenMP] Fix link command pattern in offloading interoperability test.
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

8 years ago[mips][fastisel] Handle 0-4 arguments without SelectionDAG.
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

8 years ago[OpenMP] Do not use default argument in lambda from mappable expressions handlers.
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

8 years agoAMDGPU/SI: Don't use reserved VGPRs for SGPR spilling
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

8 years ago[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.
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

8 years ago[OpenMP] Code generation for the is_device_ptr clause
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

8 years ago[OpenMP] Codegen for use_device_ptr clause.
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

8 years agoAdd IR fixups for RenderScript ABI mismatch between ARMV7 frontend and x86 backend
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

8 years agoRemoved unused variables
Simon Pilgrim [Thu, 28 Jul 2016 13:42:57 +0000 (13:42 +0000)]
Removed unused variables

llvm-svn: 276975

8 years agoFix signed/unsigned warning.
Simon Pilgrim [Thu, 28 Jul 2016 13:29:56 +0000 (13:29 +0000)]
Fix signed/unsigned warning.

llvm-svn: 276974

8 years agoReapply r276856 "Adjust Registry interface to not require plugins to export a registry"
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

8 years agoAMDGPU: add execfix flag to SI_ELSE
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

8 years ago[clang-rename] remove redundant *_cast<> traversal
Kirill Bobyrev [Thu, 28 Jul 2016 10:31:16 +0000 (10:31 +0000)]
[clang-rename] remove redundant *_cast<> traversal

llvm-svn: 276971

8 years ago[modules] Add missing includes.
Vassil Vassilev [Thu, 28 Jul 2016 10:26:33 +0000 (10:26 +0000)]
[modules] Add missing includes.

llvm-svn: 276970

8 years agoRemove two tests added in r276957.
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

8 years agofix some typos in the doc
Sylvestre Ledru [Thu, 28 Jul 2016 09:28:58 +0000 (09:28 +0000)]
fix some typos in the doc

llvm-svn: 276968

8 years ago[clang-rename] USRFinder.cpp cleanup
Kirill Bobyrev [Thu, 28 Jul 2016 09:05:06 +0000 (09:05 +0000)]
[clang-rename] USRFinder.cpp cleanup

llvm-svn: 276967

8 years agoR276957 broke bot clang-ppc64be-linux-multistage,try to fix it.
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

8 years ago[ELF] - Linkerscript: ignore SORT(CONSTRUCTORS)
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

8 years agoAdd missing REQUIRES line
Tobias Grosser [Thu, 28 Jul 2016 07:08:34 +0000 (07:08 +0000)]
Add missing REQUIRES line

llvm-svn: 276964

8 years agoGPGPU: Pass context parameters to GPU kernel
Tobias Grosser [Thu, 28 Jul 2016 06:47:59 +0000 (06:47 +0000)]
GPGPU: Pass context parameters to GPU kernel

llvm-svn: 276963

8 years agoGPGPU: Pass host iterators to kernel
Tobias Grosser [Thu, 28 Jul 2016 06:47:56 +0000 (06:47 +0000)]
GPGPU: Pass host iterators to kernel

llvm-svn: 276962

8 years agoGPGPU: use current 'Index' to find slot in parameter array
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

8 years agoGPGPU: Generate kernel parameter allocation with right size
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

8 years ago[ConstantFolding] Don't bail on folding if ConstantFoldConstantExpression fails
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

8 years ago[AArch64] Using AArch64TargetParser in Clang.
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

8 years agoAdd unittests to {ARM | AArch64}TargetParser.
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

8 years ago[CodeView] Don't crash on functions without subprograms
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

8 years agoAdd a bunch of noexcepts to char_traits and string_view.
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

8 years agoAdd some logging to the kernel dynamicloader plugin when we fail to read
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

8 years agoAdd EP_CGSCCOptimizerLate extension point to PassManagerBuilder
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

8 years ago[InstCombine] Handle failures from ConstantFoldConstantExpression
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

8 years agoFix broken build bot
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

8 years ago[analyzer] Add check::BeginFunction to CheckerDocumentation checks. NFC.
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

8 years agotest: fix typo in file name (NFC)
Saleem Abdulrasool [Thu, 28 Jul 2016 00:43:14 +0000 (00:43 +0000)]
test: fix typo in file name (NFC)

llvm-svn: 276949

8 years agoclang-rename: adjust NamedDeclFindingASTVisitor for RecordDecls
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

8 years agoReplace preserve-as-comments CodeGen test with driver test
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

8 years agoAMDGPU: Turn dead checks into asserts
Matt Arsenault [Thu, 28 Jul 2016 00:32:05 +0000 (00:32 +0000)]
AMDGPU: Turn dead checks into asserts

llvm-svn: 276946

8 years agoAMDGPU: Remove analyzeImmediate
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

8 years ago[lld][MachO] Remove some debugging output code that was mistakenly left in in
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

8 years agoFix the assertion error in collectLoopUniforms caused by empty Worklist before expanding.
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

8 years agoDon't invoke getName() from Function::isIntrinsic().
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

8 years agoAdd verifyAnalysis for LCSSA.
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

8 years ago[CFLAA] Add getModRefBehavior to CFLAnders.
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

8 years ago[LSV] Use Instruction*s rather than Value*s where possible.
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

8 years agoRetry: [Driver] Compute effective target triples once per job (NFCI)
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

8 years agoRevert "[Driver] Compute effective target triples once per job (NFCI)"
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

8 years ago[lld][MachO] Re-apply r276921 with fix - initialize strings for debug string
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

8 years ago[OpenMP] Add support to map member expressions with references to pointers.
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

8 years ago[OpenMP] Add support for mapping array sections through pointer references.
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

8 years agoBasic/Targets.cpp: Reformat aarch64 CPU list.
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

8 years agotest/Frontend: Add a test for aarch64 target CPU names.
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

8 years agoRefactor how include paths are appended to the command arguments.
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

8 years ago[lld][MachO] Temporarily revert r276921 - it's causing bot-failures on Linux.
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

8 years ago[CUDA] Align kernel launch args correctly when the LLVM type's alignment is different...
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

8 years ago[LVI] Use DenseMap::find_as in LazyValueInfo.
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

8 years agoDon't crash when generating code for __attribute__((naked)) member functions.
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

8 years ago[llvm-cov] Add a debug mode for source range highlighting (in html)
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

8 years ago[LSV] Don't assume that bitcast ops are Instructions.
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

8 years ago[lld][MachO] Add debug info support for MachO.
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

8 years ago[Hexagon] Find speculative loop preheader in hardware loop generation
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

8 years ago[X86] Factor out another piece of the SAD combine. NFCI.
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

8 years ago[Hexagon] Add option to bisect spill slot optimization
Krzysztof Parzyszek [Wed, 27 Jul 2016 20:58:43 +0000 (20:58 +0000)]
[Hexagon] Add option to bisect spill slot optimization

llvm-svn: 276917

8 years ago[Hexagon] Do not optimize volatile stack spill slots
Krzysztof Parzyszek [Wed, 27 Jul 2016 20:50:42 +0000 (20:50 +0000)]
[Hexagon] Do not optimize volatile stack spill slots

llvm-svn: 276916

8 years agoAdd target triple in test
Nirav Dave [Wed, 27 Jul 2016 20:48:39 +0000 (20:48 +0000)]
Add target triple in test

llvm-svn: 276915

8 years agoFixed "void SBWatchpoint::SetEnabled (bool enabled)" to work properly and added a...
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

8 years agobuild_llvm_package.bat: try tests three times
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

8 years agotest commit
Matt Masten [Wed, 27 Jul 2016 20:23:32 +0000 (20:23 +0000)]
test commit

llvm-svn: 276912

8 years agotest commit
Matt Masten [Wed, 27 Jul 2016 20:22:21 +0000 (20:22 +0000)]
test commit

llvm-svn: 276911

8 years agoCodegen: IfConversion: Factor out a function to count dup instrs.
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

8 years agoCodegen: IfConversion: add const qualifier. NFC
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

8 years agoRevert "[llvm-cov] Minor aesthetic improvements for html reports"
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

8 years agoAdd flags to toggle preservation of assembly comments
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

8 years ago[llvm-cov] Minor aesthetic improvements for html reports
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

8 years agoInitialize PreserveAsmComments in MCTargetOptions
Nirav Dave [Wed, 27 Jul 2016 19:19:13 +0000 (19:19 +0000)]
Initialize PreserveAsmComments in MCTargetOptions

llvm-svn: 276905

8 years agoAdjust coercion of aggregates on RenderScript
Pirama Arumuga Nainar [Wed, 27 Jul 2016 19:01:51 +0000 (19:01 +0000)]
Adjust coercion of aggregates on RenderScript

Summary:
In RenderScript, the size of the argument or return value emitted in the
IR is expected to be the same as the size of corresponding qualified
type.  For ARM and AArch64, the coercion performed by Clang can
change the parameter or return value to a type whose size is different
(usually larger) than the original aggregate type.  Specifically, this
can happen in the following cases:
    - Aggregate parameters of size <= 64 bytes and return values smaller
      than 4 bytes on ARM
    - Aggregate parameters and return values smaller than bytes on
      AArch64

This patch coerces the cases above to an integer array that is the same
size and alignment as the original aggregate.  A new field is added to
TargetInfo to detect a RenderScript target and limit this coercion just
to that case.

Tests added to test/CodeGen/renderscript.c

Reviewers: rsmith

Subscribers: aemerson, srhines, llvm-commits

Differential Revision: https://reviews.llvm.org/D22822

llvm-svn: 276904

8 years ago[Hexagon] Handle extended versions of restore routines
Krzysztof Parzyszek [Wed, 27 Jul 2016 18:47:25 +0000 (18:47 +0000)]
[Hexagon] Handle extended versions of restore routines

llvm-svn: 276903

8 years agoCodeGen: Make iterator-to-pointer conversion explicit, NFC
Duncan P. N. Exon Smith [Wed, 27 Jul 2016 18:45:18 +0000 (18:45 +0000)]
CodeGen: Make iterator-to-pointer conversion explicit, NFC

Remove the implicit conversion from MachineInstrBundleIterator to
MachineInstr*, leaving behind an explicit conversion.

I *think* this is the last ilist_iterator-related implicit conversion to
ilist_node subclass.  If I'm right, I can finally dig in and fix the UB
in ilist that these conversions were relying on.

Note that the implicit users of this conversion have already been
removed.  If you have out-of-tree code that doesn't update, you might be
able to buy some time by temporarily reverting this commit.

llvm-svn: 276902

8 years agoFix the build for libstdc++ 4.7
David Majnemer [Wed, 27 Jul 2016 18:25:12 +0000 (18:25 +0000)]
Fix the build for libstdc++ 4.7

libstdc++ 4.7 doesn't have emplace.  Use std::map::insert instead.

llvm-svn: 276901

8 years ago[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer
Erik Pilkington [Wed, 27 Jul 2016 18:25:10 +0000 (18:25 +0000)]
[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer

Fixes PR27994, a crash on valid.

Differential revision: https://reviews.llvm.org/D21145

llvm-svn: 276900

8 years agoXCore: Avoid implicit iterator conversions, NFC
Duncan P. N. Exon Smith [Wed, 27 Jul 2016 18:14:38 +0000 (18:14 +0000)]
XCore: Avoid implicit iterator conversions, NFC

Avoid implicit conversions from MachineInstrBundleIterator to
MachineInstr*, mainly by preferring MachineInstr& over MachineInstr*.

llvm-svn: 276899

8 years agoRevert EH-specific checks in BranchFolding that were causing blow ups in compile...
Andrew Kaylor [Wed, 27 Jul 2016 17:55:33 +0000 (17:55 +0000)]
Revert EH-specific checks in BranchFolding that were causing blow ups in compile time.

Differential Revision: https://reviews.llvm.org/D22839

llvm-svn: 276898

8 years agoGlobalISel: support zero-sized allocas
Tim Northover [Wed, 27 Jul 2016 17:47:54 +0000 (17:47 +0000)]
GlobalISel: support zero-sized allocas

All allocas must be at least 1 byte at the MachineIR level so we allocate just
one byte.

llvm-svn: 276897

8 years agoUpdate Clang Parser test error message to match new parser errors
Nirav Dave [Wed, 27 Jul 2016 17:39:47 +0000 (17:39 +0000)]
Update Clang Parser test error message to match new parser errors

llvm-svn: 276896

8 years ago[MC][X86] Fix Intel Operand assembly parsing for .set ids
Nirav Dave [Wed, 27 Jul 2016 17:39:41 +0000 (17:39 +0000)]
[MC][X86] Fix Intel Operand assembly parsing for .set ids

Fix intel syntax special case identifier operands that refer to a constant
(e.g. .set <ID> n) to be interpreted as immediate not memory in parsing.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22585

llvm-svn: 276895

8 years ago[DSE] Fix bug in updating MadeChange flag
Jun Bum Lim [Wed, 27 Jul 2016 17:25:20 +0000 (17:25 +0000)]
[DSE] Fix bug in updating MadeChange flag

Summary: The MadeChange flag should be ORed to keep the previous result.

Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D22873

llvm-svn: 276894

8 years agoUsersManual.rst: update clang-cl option list
Hans Wennborg [Wed, 27 Jul 2016 16:56:03 +0000 (16:56 +0000)]
UsersManual.rst: update clang-cl option list

llvm-svn: 276891

8 years agoFix unnecessary default switch warning
Simon Pilgrim [Wed, 27 Jul 2016 16:41:56 +0000 (16:41 +0000)]
Fix unnecessary default switch warning

llvm-svn: 276889

8 years agoUpdate cxx_dr_Status after 3.9 branch
Hans Wennborg [Wed, 27 Jul 2016 16:39:45 +0000 (16:39 +0000)]
Update cxx_dr_Status after 3.9 branch

llvm-svn: 276887