Renato Golin [Thu, 11 Feb 2016 21:22:57 +0000 (21:22 +0000)]
[AArch64] Fix libunwind build when using GNU assembler
Use x29 and x30 for fp and lr respectively.
This does not change the code generation with integrated asm
but using x30 and x29 helps compile the code with gnu as. Currently gas
fails to assemble this code with errors as below.
Error: operand X should be an integer register.
Newer versions of binutils should be fixed, but enough exists in the wild
to make this change harmless and worthy.
Patch by Khem Raj.
llvm-svn: 260595
Quentin Colombet [Thu, 11 Feb 2016 21:21:40 +0000 (21:21 +0000)]
[GlobalISel][MachineIRBuilder] Fix comments.
llvm-svn: 260594
Quentin Colombet [Thu, 11 Feb 2016 21:20:35 +0000 (21:20 +0000)]
[GlobalISel] Make the getter for MBB in MachneIRBuilder public.
llvm-svn: 260593
Rui Ueyama [Thu, 11 Feb 2016 21:18:01 +0000 (21:18 +0000)]
ELF: Release Target at end of link().
Previously, Target held a value until a new value is assigned to the
variable. That was a benign leak -- that was not an unbounded leak
and didn't grab any resources except a small amount of memory. But
it is better to fix than leaving as is.
llvm-svn: 260592
Rui Ueyama [Thu, 11 Feb 2016 21:17:59 +0000 (21:17 +0000)]
ELF: Create LinkerScript class to move code out of Writer.
Previously, we had code for linker scripts in Writer. This patch
separates that as LinkerScript class. The class provides a few
functions to query linker scripts and is also a container of some
linker-script-specific information.
Hopefully, Writer will only implement the default behavior and let
the new class handle gotchas regarding linker scripts.
llvm-svn: 260591
Quentin Colombet [Thu, 11 Feb 2016 21:16:56 +0000 (21:16 +0000)]
[Target] Add a helper function to check if an opcode is invalid after isel.
llvm-svn: 260590
Ed Maste [Thu, 11 Feb 2016 21:15:49 +0000 (21:15 +0000)]
XFAIL TestCommandScriptImmediateOutput on FreeBSD also
llvm-svn: 260589
Tom Stellard [Thu, 11 Feb 2016 21:14:34 +0000 (21:14 +0000)]
AMDGPU/SI: When splitting SMRD instructions, add its users to VALU worklist
Summary:
When we split SMRD instructions into two MUBUFs we were adding the users
of the newly created MUBUFs to the VALU worklist. However, the only
users these instructions had was the REG_SEQUENCE that was inserted
by splitSMRD when the original SMRD instruction was split.
We need to make sure to add the users of the original SMRD to the VALU
worklist before it is split.
I have a test case, but it requires one other bug fix, so it will be
added in a later commt.
Reviewers: mareko, arsenm
Subscribers: arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D17101
llvm-svn: 260588
Pete Cooper [Thu, 11 Feb 2016 21:10:40 +0000 (21:10 +0000)]
Set load alignment on aggregate loads.
When optimizing a extractvalue(load), we generate a load from the
aggregate type. This load didn't have alignment set and so would
get the alignment of the type. This breaks when the type is packed
and so the alignment should be lower.
For example, loading { int, int } would give us alignment of 4, but
the original load from this type may have an alignment of 1 if packed.
Reviewed by David Majnemer
Differential revision: http://reviews.llvm.org/D17158
llvm-svn: 260587
Matthias Braun [Thu, 11 Feb 2016 21:07:44 +0000 (21:07 +0000)]
Revert "LiveIntervalAnalysis: Support moving of subregister defs in handleMove"
This is broke a bot:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/4703/steps/test-suite/logs/test.log
Reverting while I investigate.
This reverts commit r260565.
llvm-svn: 260586
Derek Schuff [Thu, 11 Feb 2016 20:57:09 +0000 (20:57 +0000)]
[WebAssembly] Reformat WebAssemblyFrameLowering and WebAssemblyISelLowering
Reviewers: sunfish, jfb
Subscribers: jfb, dschuff
Differential Revision: http://reviews.llvm.org/D17156
llvm-svn: 260585
Richard Smith [Thu, 11 Feb 2016 20:36:47 +0000 (20:36 +0000)]
XFAIL this test for PPC64 for now. It looks like the *_MIN_EXP macros are in fact defined incorrectly for that target.
llvm-svn: 260583
Sanjay Patel [Thu, 11 Feb 2016 20:21:24 +0000 (20:21 +0000)]
[SelectionDAG] change getConstant() to use the input SDLoc when building splat vectors
The code change is simple enough: instead of attaching an anonymous SDLoc to splatted
vector constants, use the scalar constant's existing SDLoc since that is what is passed
into getConstant() as a param. But this changes instruction scheduling, so I'll explain
why that happens.
The motivation for this patch starts near:
http://reviews.llvm.org/rL258833
...x86's getZeroVector() could be similarly cleaned up and I thought it would be 'NFC'.
But when I made that change locally, several x86 codegen tests wiggled.
It turns out that the lack of SDLoc consistency in getConstant() changes the way
ScheduleDAGRRList behaves. This is because the SDLoc contains 'IROrder' and some DAG
scheduler algorithms use IROrder for tie-breaking.
Differential Revision: http://reviews.llvm.org/D16972
llvm-svn: 260582
Carlo Bertolli [Thu, 11 Feb 2016 20:12:28 +0000 (20:12 +0000)]
Add parse+sema and regression test for OpenMP firstprivate clause of target directive
llvm-svn: 260581
Quentin Colombet [Thu, 11 Feb 2016 19:59:41 +0000 (19:59 +0000)]
[GlobalISel] Add the necessary plumbing to lower formal arguments.
llvm-svn: 260579
Peter Collingbourne [Thu, 11 Feb 2016 19:57:46 +0000 (19:57 +0000)]
DwarfDebug: emit type units immediately.
Rather than storing type units in a vector and emitting them at the end
of code generation, emit them immediately and destroy them, reclaiming the
memory we were using for their DIEs.
In one benchmark carried out against Chromium's 50 largest (by bitcode
file size) translation units, total peak memory consumption with type units
decreased by median 17%, or by 7% when compared against disabling type units.
Tested using check-{llvm,clang}, the GDB 7.5 test suite (with
'-fdebug-types-section') and by eyeballing llvm-dwarfdump output on those
Chromium translation units with split DWARF both disabled and enabled, and
verifying that the only changes were to addresses and abbreviation ordering.
Differential Revision: http://reviews.llvm.org/D17118
llvm-svn: 260578
Richard Smith [Thu, 11 Feb 2016 19:57:37 +0000 (19:57 +0000)]
In C11, provide macros FLT_DECIMAL_DIG, DBL_DECIMAL_DIG, and LDBL_DECIMAL_DIG in <float.h>.
Patch by Jorge Teixeira!
llvm-svn: 260577
Rafael Espindola [Thu, 11 Feb 2016 19:54:18 +0000 (19:54 +0000)]
Use copy initialization.
We can do it since getMemBuffer returns a unique_ptr.
llvm-svn: 260576
Quentin Colombet [Thu, 11 Feb 2016 19:45:27 +0000 (19:45 +0000)]
[AArch64] Trivial implementation of lower return for the IRTranslator.
llvm-svn: 260574
Reid Kleckner [Thu, 11 Feb 2016 19:44:26 +0000 (19:44 +0000)]
[codeview] Add test intended for r260571
llvm-svn: 260573
Kevin B. Smith [Thu, 11 Feb 2016 19:43:04 +0000 (19:43 +0000)]
[X86] New pass to change byte and word instructions to zero-extending versions.
Differential Revision: http://reviews.llvm.org/D17032
llvm-svn: 260572
Reid Kleckner [Thu, 11 Feb 2016 19:41:47 +0000 (19:41 +0000)]
[codeview] Fix bug around multi-level wrapper inlining
If there were wrapper functions with no instructions of their own in the
inlining tree, we would fail to emit InlineSite records for them.
llvm-svn: 260571
Richard Smith [Thu, 11 Feb 2016 19:40:06 +0000 (19:40 +0000)]
Work around regression in glibc 2.22: request that glibc provides the correct
prototypes for <string.h> functions that are converted into overload sets in
C++. This matches the existing workaround in <wchar.h>.
llvm-svn: 260570
Quentin Colombet [Thu, 11 Feb 2016 19:35:06 +0000 (19:35 +0000)]
[AArch64] Plug the beginning of the GlobalISel pipeline.
llvm-svn: 260569
Quentin Colombet [Thu, 11 Feb 2016 19:33:21 +0000 (19:33 +0000)]
Play nice with Visual Studio and attributes
llvm-svn: 260568
Manman Ren [Thu, 11 Feb 2016 19:19:18 +0000 (19:19 +0000)]
[PR26550] Use a different TBAA root for C++ vs C.
This commit changes the root from "Simple C/C++ TBAA" to "Simple C++ TBAA" for
C++.
The problem is that the type name in the TBAA nodes is generated differently
for C vs C++. If we link an IR file for C with an IR file for C++, since they
have the same root and the type names are different, accesses to the two type
nodes will be considered no-alias, even though the two type nodes are from
the same type in a header file.
The fix is to use different roots for C and C++. Types from C will be treated
conservatively in respect to types from C++.
Follow-up commits will change the C root to "Simple C TBAA" plus some mangling
change for C types to make it a little more aggresive.
llvm-svn: 260567
Quentin Colombet [Thu, 11 Feb 2016 19:18:27 +0000 (19:18 +0000)]
[CMake] Produce an empty library for GlobalISel when not building it.
The rational for this change is that LLVMBuild cannot express conditional
dependencies. Therefore, when we start optionally using GlobalISel library for
say AArch64, without that change, all the tools that use the AArch64 library
would need to explicitly link with GlobalISel when we ask for it.
This does not scale.
Instead, we will set the dependencies between the target and GlobalISel and if
we did not ask to build GlobalISel, the library will just be empty.
Thanks to Chris Bieneman and Mehdi Animi for the idea.
llvm-svn: 260566
Matthias Braun [Thu, 11 Feb 2016 19:03:53 +0000 (19:03 +0000)]
LiveIntervalAnalysis: Support moving of subregister defs in handleMove
If two definitions write to independent subregisters then they can be
put in any order. LiveIntervalAnalysis::handleMove() did not support
this previously because it looks like moving a definition of a vreg past
another one.
This is a modified version of a patch proposed (two years ago) by
Vincent Lejeune! This version does not touch the read-undef flags and is
extended for the case of moving a subregister def behind all uses - this
can happen for subregister defs that are completely unused.
Differential Revision: http://reviews.llvm.org/D9067
llvm-svn: 260565
Alexey Samsonov [Thu, 11 Feb 2016 19:03:09 +0000 (19:03 +0000)]
[LSan] Test case fix: mode debug output, synchronization instead of sleep().
llvm-svn: 260564
Ben Langmuir [Thu, 11 Feb 2016 18:54:02 +0000 (18:54 +0000)]
[Modules] Early-exit if ReadOptionsBlock fails to avoid crashing
If we didn't tell ReadOptionsBlock to allow failures then we can't
assume that the stream is not in the middle of a block if it returns
out-of-date. This was causing a crash when we tried to continue reading.
Also, it's just generally a good idea to early-exit if we're doing
implicit module builds, since we will want to immediately rebuild this
module anyway and there's no reason to waste time continuing after
failure.
rdar://problem/
24114938
llvm-svn: 260563
Quentin Colombet [Thu, 11 Feb 2016 18:53:28 +0000 (18:53 +0000)]
[GlobalISel] Teach the IRTranslator how to lower returns.
llvm-svn: 260562
Alexey Samsonov [Thu, 11 Feb 2016 18:26:57 +0000 (18:26 +0000)]
[ASan] Disable test that uses profile runtime on Windows.
llvm-svn: 260561
Tom Stellard [Thu, 11 Feb 2016 18:25:26 +0000 (18:25 +0000)]
[AMDGPU] Fix for "v_div_scale_f64 reg, vcc, ..." parsing
Summary:
Added support for "VOP3Only" attribute in VOP3bInst encoding.
Set VOP3Only=1 for V_DIV_SCALE_F64/32 insns.
Added support for multi-dest instructions in AMDGPUAs::cvt*().
Added lit test for "V_DIV_SCALE_F64|F32 vreg,vcc|sreg,vreg,vreg,vreg".
Reviewers: tstellarAMD, arsenm
Subscribers: arsenm, SamWot, nhaustov, vpykhtin
Differential Revision: http://reviews.llvm.org/D16995
Patch By: Artem Tamazov
llvm-svn: 260560
Adrian McCarthy [Thu, 11 Feb 2016 18:24:57 +0000 (18:24 +0000)]
Improve ReadRegister for RegisterContextWindowsx86
In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the
control registers (EIP, ESP, EBP, EFLAGS). There are flags in the CONTEXT which indicate which
portions are valid, but those flags weren't checked. The old code would not detect this and give a
garbage value for the register. The new code will log the problem and return an error.
I consolidated the error checking and logging into a helper function, which makes the big switch
statement easier to read and verify.
Ran tests to ensure this doesn't break anything. Manually verified that a minidump without info on
the control registers now indicates the problem instead of giving bad information.
Differential Review: http://reviews.llvm.org/D17152
llvm-svn: 260559
Quentin Colombet [Thu, 11 Feb 2016 18:22:37 +0000 (18:22 +0000)]
[GlobalISel] Add a type to MachineInstr.
We actually need that information only for generic instructions, therefore it
would be nice not to have to pay the extra memory consumption for all
instructions. Especially because a typed non-generic instruction does not make
sense.
The question is then, is it possible to have that information in a union or
something?
My initial thought was that we could have a derived class GenericMachineInstr
with additional information, but in practice it makes little to no sense since
generic MachineInstrs are likely turned into non-generic ones by just switching
the opcode. In other words, we don't want to go through the process of creating
a new, non-generic MachineInstr, object each time we do this switch. The memory
benefit probably is not worth the extra compile time.
Another option would be to keep the type of the MachineInstr in a side table.
This would induce an extra indirection though.
Anyway, I will file a PR to discuss about it and remember we need to come back
to it at some point.
llvm-svn: 260558
Artem Belevich [Thu, 11 Feb 2016 18:21:47 +0000 (18:21 +0000)]
[NVPTX] emit .file directives for files referenced by subprograms.
.. so .loc directives referring to those files work correctly.
Differential Revision: http://reviews.llvm.org/D17086
llvm-svn: 260557
Eric Fiselier [Thu, 11 Feb 2016 18:21:18 +0000 (18:21 +0000)]
Revert r260514 because it has a bogus commit message.
llvm-svn: 260556
Chad Rosier [Thu, 11 Feb 2016 18:09:31 +0000 (18:09 +0000)]
[Driver] Add support for Qualcomm's Kryo CPU.
http://reviews.llvm.org/D17124
llvm-svn: 260555
Alexey Samsonov [Thu, 11 Feb 2016 18:07:17 +0000 (18:07 +0000)]
[LSan] Fix a crash when LSan hits a guard page while scanning thread stack for pointers.
Summary:
In some cases stack pointer register (SP) doesn't point into the thread
stack: e.g. if one is using swapcontext(). In this case LSan
conservatively tries to scan the whole thread stack for pointers.
However, thread stack (at least in glibc implementation) may also
include guard pages, causing LSan to crash when it's reading from them.
One of the solutions is to use a pthread_attr_getguardsize() to adjust
the calculated stack boundaries. However, here we're just using
IsAccessibleMemoryRange to skip guard pages and make the code (slightly)
less platform-specific.
Reviewers: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D17116
llvm-svn: 260554
Quentin Colombet [Thu, 11 Feb 2016 17:57:22 +0000 (17:57 +0000)]
[GlobalISel] Add a hook in TargetConfigPass to run GlobalISel.
llvm-svn: 260553
David Majnemer [Thu, 11 Feb 2016 17:54:39 +0000 (17:54 +0000)]
Remove unused includes
llvm-svn: 260552
Quentin Colombet [Thu, 11 Feb 2016 17:53:23 +0000 (17:53 +0000)]
[GlobalISel][IRTranslator] Change the ownership of the MIRBuilder field.
llvm-svn: 260551
Quentin Colombet [Thu, 11 Feb 2016 17:52:28 +0000 (17:52 +0000)]
[GlobalISel][IRTranslator] Fix a typo in assert.
llvm-svn: 260550
Quentin Colombet [Thu, 11 Feb 2016 17:51:31 +0000 (17:51 +0000)]
[GlobalISel][IRTranslator] Teach the pass how to translate Add instructions.
llvm-svn: 260549
David Majnemer [Thu, 11 Feb 2016 17:49:28 +0000 (17:49 +0000)]
Revert "Revert r260388 "[MS ABI] Never reference dllimport'd vtables""
This reverts commit r260449.
We would supress our emission of vftable definitions if we thought
another translation unit would provide the definition because we saw an
explicit instantiation declaration. This is not the case with
dllimport, we want to synthesize a definition of the vftable regardless.
This fixes PR26569.
llvm-svn: 260548
Quentin Colombet [Thu, 11 Feb 2016 17:44:59 +0000 (17:44 +0000)]
[GlobalISel] Add a MachineIRBuilder class.
Helper class to build machine instrs. This is a higher abstraction
than MachineInstrBuilder.
llvm-svn: 260547
Aidan Dodds [Thu, 11 Feb 2016 17:17:12 +0000 (17:17 +0000)]
[Renderscript] Fix typo in mips64 argument reading code.
A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits.
llvm-svn: 260546
Jacques Pienaar [Thu, 11 Feb 2016 17:16:20 +0000 (17:16 +0000)]
[lanai] Add Lanai triple.
Add triple for the Lanai backend.
General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend".
Differential Revision: http://reviews.llvm.org/D17003
llvm-svn: 260545
Jun Bum Lim [Thu, 11 Feb 2016 17:11:49 +0000 (17:11 +0000)]
Add a test case to show isKnownNonZero() returns correctly; NFC
Summary:
Added a test case just to make sure that isKnownNonZero() returns false
when we cannot guarantee that a ConstantExpr is a non-zero constant.
Reviewers: sanjoy, majnemer, mcrosier, nlewycky
Subscribers: nlewycky, mssimpso, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16908
llvm-svn: 260544
Ben Langmuir [Thu, 11 Feb 2016 17:04:42 +0000 (17:04 +0000)]
[Modules] Don't infinite recurse on implicit import of circular modules in preamble
Update the Preprocessor's VisibleModuleSet when typo-correction creates
an implicit module import so that we won't accidentally write an invalid
SourceLocation into the preamble AST. This would later lead to infinite
recursion when loading the preamble AST because we use the value in
ImportLocs to prevent visiting a module twice.
rdar://problem/
24440990
llvm-svn: 260543
James Y Knight [Thu, 11 Feb 2016 16:51:29 +0000 (16:51 +0000)]
Use new --match-full-lines FileCheck feature for Preprocessor/init.c.
This required fixing a few check lines which had omitted trailing
characters, and were passing incorrectly (e.g., asserting that
__UINT64_C_SUFFIX__ is "UL" instead of the "ULL" that it actually is set
to). All were obviously broken tests, not broken code.
llvm-svn: 260542
Jun Bum Lim [Thu, 11 Feb 2016 16:46:13 +0000 (16:46 +0000)]
Fixed typo in r260530
llvm-svn: 260541
James Y Knight [Thu, 11 Feb 2016 16:46:09 +0000 (16:46 +0000)]
Add -match-full-lines argument to FileCheck.
This is useful for some tests where more-exact matching is useful, such
as clang's Preprocessor tests.
llvm-svn: 260540
Reid Kleckner [Thu, 11 Feb 2016 16:44:35 +0000 (16:44 +0000)]
[Windows] Fill in read/write information in SignalContext
Implements https://github.com/google/sanitizers/issues/653
llvm-svn: 260539
Hans Wennborg [Thu, 11 Feb 2016 16:44:06 +0000 (16:44 +0000)]
Revert r260507: "[X86] Enable the LEA optimization pass by default."
This caused PR26575.
llvm-svn: 260538
NAKAMURA Takumi [Thu, 11 Feb 2016 16:43:08 +0000 (16:43 +0000)]
Revert r260266 (and r260276), "clang-cl: Enable plugins on Windows"
It doesn't work, at least, i686-win32.
llvm-svn: 260537
NAKAMURA Takumi [Thu, 11 Feb 2016 16:33:20 +0000 (16:33 +0000)]
Revert r260265, "clang-cl: Support loading plugins on Windows"
It causes memory exhaust on mingw-w64(x64). Investigating.
llvm-svn: 260536
Alexander Kornienko [Thu, 11 Feb 2016 16:22:58 +0000 (16:22 +0000)]
[clang-tidy] google-runtime-int: fix a false positive in implicit code.
llvm-svn: 260535
Jun Bum Lim [Thu, 11 Feb 2016 16:18:24 +0000 (16:18 +0000)]
[AArch64] Refactoring findMatchingStore() in aarch64-ldst-opt; NFC
Summary: This change makes findMatchingStore() follow the same coding style introduced in r260275.
Reviewers: gberry, junbuml
Subscribers: aemerson, rengolin, haicheng, bmakam, mssimpso
Differential Revision: http://reviews.llvm.org/D17083
llvm-svn: 260534
Oliver Stannard [Thu, 11 Feb 2016 16:05:52 +0000 (16:05 +0000)]
[ARM] Add command-line options for ARMv8.2-A
This allows ARMv8.2-A to be targeted either by using "armv8.2a" in the
triple, or by using -march=armv8.2-a (or the alias -march=armv8.2a).
The FP16 extension can be enabled with the "+fp16" suffix to the -march
or -mcpu option. This is consistent with the AArch64 option, rather than
the usual ARM option of -mfpu. We have agreed with the team which will
be upstreaming this to GCC that we want to use this new option format
for new architecture extensions for both ARM and AArch64.
Most of the work for this was done by the TargetParser patch in llvm.
Differential Revision: http://reviews.llvm.org/D15040
llvm-svn: 260533
Cong Liu [Thu, 11 Feb 2016 16:03:27 +0000 (16:03 +0000)]
Merge branch 'arcpatch-D16922'
llvm-svn: 260532
Eric Fiselier [Thu, 11 Feb 2016 15:52:52 +0000 (15:52 +0000)]
Rename CheckLibcxxAtomic.cmake variable result names so they don't clash with LLVM
llvm-svn: 260531
Jun Bum Lim [Thu, 11 Feb 2016 15:50:07 +0000 (15:50 +0000)]
[InstCombine] Simplify a known nonzero incoming value of PHI
Summary:
When a PHI is used only to be compared with zero, it is possible to replace an
incoming value with any non-zero constant if the incoming value can be proved as
a known nonzero value. For example, in below code, we can replace the incoming value %v with
any non-zero constant based on the fact that the PHI is only used to be compared with zero
and %v is a known non-zero value:
%v = select %cond, 1, 2
%p = phi [%v, BB] ...
%c = icmp eq, %p, 0
Reviewers: mcrosier, jmolloy, sanjoy
Subscribers: hfinkel, mcrosier, majnemer, llvm-commits, haicheng, bmakam, mssimpso, gberry
Differential Revision: http://reviews.llvm.org/D16240
llvm-svn: 260530
Benjamin Kramer [Thu, 11 Feb 2016 15:41:56 +0000 (15:41 +0000)]
Drop the hidden visibility from DebugHandlerBase for now.
If a class has hidden visibility all derived classes and all classes
that have it as a member must have hidden visibility too. That may
be fixable here but requires changes to quite a lot of debug info
classes.
This is also one of the things that GCC enforces aggressively while
clang ignores it, making testing more annoying than necessary.
llvm-svn: 260529
Rafael Espindola [Thu, 11 Feb 2016 15:24:48 +0000 (15:24 +0000)]
Sort includes. NFC.
llvm-svn: 260528
Marshall Clow [Thu, 11 Feb 2016 15:23:04 +0000 (15:23 +0000)]
Add some tests to ensure that the __regex_word does not conflict with any of ctype_base's values.
Hopefully this will catch cases like https://llvm.org/bugs/show_bug.cgi?id=26476 in the future.
llvm-svn: 260527
Eric Fiselier [Thu, 11 Feb 2016 15:22:37 +0000 (15:22 +0000)]
Properly down-cast a sentinal node pointer through void*
llvm-svn: 260526
Aidan Dodds [Thu, 11 Feb 2016 15:16:37 +0000 (15:16 +0000)]
[Renderscript] Refactor target argument reading code.
This patch reworks the function argument reading code, allowing us to annotate arguments with their types. The type/size information is needed to correctly parse arguments passed on the stack.
llvm-svn: 260525
Eric Fiselier [Thu, 11 Feb 2016 15:05:56 +0000 (15:05 +0000)]
Fix r260515 - Correct typos in CMake changes
llvm-svn: 260524
Chad Rosier [Thu, 11 Feb 2016 14:25:08 +0000 (14:25 +0000)]
[AArch64] Improve load/store optimizer to handle LDUR + LDR.
This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.
This is a reapplication of r259812, which had an incorrect assert. The
test_stur_str_no_assert() test is a reduced version of the issue hit in
the AArch64 self-host.
PR24465
llvm-svn: 260523
Rafael Espindola [Thu, 11 Feb 2016 14:13:17 +0000 (14:13 +0000)]
Revert "Bail on compilation as soon as a job fails."
This reverts commit r260448.
It was causing Driver/output-file-cleanup.c to fail.
llvm-svn: 260522
Scott Egerton [Thu, 11 Feb 2016 13:48:49 +0000 (13:48 +0000)]
[MC] Fixed parsing of macro arguments where expressions with spaces are present.
Summary:
Fixed an issue for mips with an instruction such as 'sdc1 $f1, 272 +8(a0)' which has a space between '272' and '+'. The parser would then parse '272' and '+8' as two arguments instead of a single expression resulting in one too many arguments in the pseudo instruction.
The reason that the test case has been changed is so that the expected
output matches the output of the GNU assembler.
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits
Differential Revision: http://reviews.llvm.org/D13592
llvm-svn: 260521
Artur Pilipenko [Thu, 11 Feb 2016 13:42:59 +0000 (13:42 +0000)]
Make context-sensitive isDereferenceable queries in isSafeToLoadUnconditionally
This is a part of the refactoring to unify isSafeToLoadUnconditionally and isDereferenceablePointer functions. In the subsequent change isSafeToSpeculativelyExecute will be modified to use isSafeToLoadUnconditionally instead of isDereferenceableAndAlignedPointer.
Reviewed By: reames
Differential Revision: http://reviews.llvm.org/D16227
llvm-svn: 260520
Andrey Bokhanko [Thu, 11 Feb 2016 13:27:02 +0000 (13:27 +0000)]
Partial revert of rL260506.
After some experiments I discovered that clang doesn't support static
initialization of flexible array members in full, so restored this paragraph in
"GCC extensions not implemented yet" list.
llvm-svn: 260519
Daniel Jasper [Thu, 11 Feb 2016 13:24:15 +0000 (13:24 +0000)]
clang-format: [JS] Support for (.. of ..) loops.
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
llvm-svn: 260518
Daniel Jasper [Thu, 11 Feb 2016 13:15:14 +0000 (13:15 +0000)]
clang-format: Make indentation after "<<" more consistent.
Before:
Diag(
aaaaaaaaaaaaaaaaaaaa,
aaaaaaaa)
<<
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(
aaaaaaaaaaaaaaaaaaaa,
aaaaaaaa)
<<
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
After:
Diag(
aaaaaaaaaaaaaaaaaaaa,
aaaaaaaa)
<<
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
Diag(
aaaaaaaaaaaaaaaaaaaa,
aaaaaaaa)
<<
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
<< aaa;
llvm-svn: 260517
Eric Fiselier [Thu, 11 Feb 2016 12:51:19 +0000 (12:51 +0000)]
separate nested >>
llvm-svn: 260516
Vasileios Kalintiris [Thu, 11 Feb 2016 12:43:04 +0000 (12:43 +0000)]
Re-commit "Introduce a cmake module to figure out whether we need to link with libatomic."
This re-applies commit r260235. However, this time we add -gcc-toolchain
to the compiler's flags when the user has specified the LIBCXX_GCC_TOOLCHAIN
variable.
llvm-svn: 260515
Eric Fiselier [Thu, 11 Feb 2016 12:25:27 +0000 (12:25 +0000)]
Teach __hash_table how to handle unordered_map's __hash_value_type.
This patch is fairly large and contains a number of changes. The main change
is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
this change is a rampant layering violation, but it's required to make
unordered_map conforming without re-writing all of __hash_table.
After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.
The major changes found in this patch are:
* Teach __hash_table to differentiate between the true container value type
and the node value type by introducing the "__container_value_type" and
"__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.
* Switch almost all overloads in '__hash_table' previously taking 'value_type'
(AKA '__node_value_type) to take '__container_value_type' instead. Previously
'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
of the function signature.
* Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
'__key_value_types'. These functions allow '__hash_table' to unwrap
'__node_value_type' objects into '__container_value_type' and its sub-parts.
* Pass '__hash_value_type::__value_' to 'a.construct(p, ...)' instead of
'__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
and 'a.destroy()' are only ever instantiated for the containers value type.
* Remove '__hash_value_type's constructors and destructors. We should never
construct an instance of this type.
(TODO this is UB but we already do it in plenty of places).
* Add a generic "try-emplace" function to '__hash_table' called
'__emplace_unique_key_args(Key const&, Args...)'.
The following changes were done as cleanup:
* Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
'_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.
* Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
For example this patch removes the __construct_node overloads that do
manual pack expansion.
* Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
resulting from the change. This includes almost all
'unordered_map::__construct_node' overloads.
The following changes are planed for future revisions:
* Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
'__emplace_unique_key_args'.
* Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.
* Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
This prevent unneeded allocations when inserting duplicate entries.
The additional follow up work needed after this patch:
* Respect the lifetime rules for '__hash_value_type' by actually constructing it.
* Make '__insert_multi' act similar to '__insert_unique' for objects of type
'T&' and 'T const &&' with 'T = __container_value_type'.
llvm-svn: 260514
Eric Fiselier [Thu, 11 Feb 2016 11:59:44 +0000 (11:59 +0000)]
Teach __hash_table how to handle unordered_map's __hash_value_type.
This patch is fairly large and contains a number of changes. The main change
is teaching '__hash_table' how to handle '__hash_value_type'. Unfortunately
this change is a rampant layering violation, but it's required to make
unordered_map conforming without re-writing all of __hash_table.
After this change 'unordered_map' can delegate to '__hash_table' in almost all cases.
The major changes found in this patch are:
* Teach __hash_table to differentiate between the true container value type
and the node value type by introducing the "__container_value_type" and
"__node_value_type" typedefs. In the case of unordered_map '__container_value_type'
is 'pair<const Key, Value>' and '__node_value_type' is '__hash_value_type'.
* Switch almost all overloads in '__hash_table' previously taking 'value_type'
(AKA '__node_value_type) to take '__container_value_type' instead. Previously
'pair<K, V>' would be implicitly converted to '__hash_value_type<K, V>' because
of the function signature.
* Add '__get_key', '__get_value', '__get_ptr', and '__move' static functions to
'__key_value_types'. These functions allow '__hash_table' to unwrap
'__node_value_type' objects into '__container_value_type' and its sub-parts.
* Pass '__hash_value_type::__value_' to 'a.construct(p, ...)' instead of
'__hash_value_type' itself. The C++14 standard requires that 'a.construct()'
and 'a.destroy()' are only ever instantiated for the containers value type.
* Remove '__hash_value_type's constructors and destructors. We should never
construct an instance of this type.
(TODO this is UB but we already do it in plenty of places).
* Add a generic "try-emplace" function to '__hash_table' called
'__emplace_unique_key_args(Key const&, Args...)'.
The following changes were done as cleanup:
* Introduce the '_LIBCPP_CXX03_LANG' macro to be used in place of
'_LIBCPP_HAS_NO_VARIADICS' or '_LIBCPP_HAS_NO_RVALUE_REFERENCE'.
* Cleanup C++11 only overloads that assume an incomplete C++11 implementation.
For example this patch removes the __construct_node overloads that do
manual pack expansion.
* Forward 'unordered_map::emplace' to '__hash_table' and remove dead code
resulting from the change. This includes almost all
'unordered_map::__construct_node' overloads.
The following changes are planed for future revisions:
* Fix LWG issue #2469 by delegating 'unordered_map::operator[]' to use
'__emplace_unique_key_args'.
* Rewrite 'unordered_map::try_emplace' in terms of '__emplace_unique_key_args'.
* Optimize '__emplace_unique' to call '__emplace_unique_key_args' when possible.
This prevent unneeded allocations when inserting duplicate entries.
The additional follow up work needed after this patch:
* Respect the lifetime rules for '__hash_value_type' by actually constructing it.
* Make '__insert_multi' act similar to '__insert_unique' for objects of type
'T&' and 'T const &&' with 'T = __container_value_type'.
llvm-svn: 260513
Omair Javaid [Thu, 11 Feb 2016 11:41:22 +0000 (11:41 +0000)]
Handle floating-point type homogeneous aggregate return values in ABISysV_arm
For details refer to review link given below.
Differential revision: http://reviews.llvm.org/D16975
llvm-svn: 260512
Tamas Berghammer [Thu, 11 Feb 2016 11:27:51 +0000 (11:27 +0000)]
Fix MSVC 2013 build after rL260504
llvm-svn: 260511
Denis Zobnin [Thu, 11 Feb 2016 11:26:03 +0000 (11:26 +0000)]
[MCU] Fix assertion failure on function returning empty union.
Treat empty struct/union in return type as void for MCU ABI. PR26438.
Differential Revision: http://reviews.llvm.org/D16808
llvm-svn: 260510
Artur Pilipenko [Thu, 11 Feb 2016 11:22:46 +0000 (11:22 +0000)]
Don't propagate dereferenceable attribute through gc.relocate in InstCombine
Reviewed By: reames
Differential Revision: http://reviews.llvm.org/D16143
llvm-svn: 260509
George Rimar [Thu, 11 Feb 2016 11:14:46 +0000 (11:14 +0000)]
[ELF] - Remove R_X86_64_GOTTPOFF from static relocation processing
R_X86_64_TPOFF64 is a dynamic relocation,
it should not appear in static relocation processing.
Patch fixes it.
Differential revision: http://reviews.llvm.org/D16880
llvm-svn: 260508
Andrey Turetskiy [Thu, 11 Feb 2016 10:51:26 +0000 (10:51 +0000)]
[X86] Enable the LEA optimization pass by default.
Differential Revision: http://reviews.llvm.org/D16877
llvm-svn: 260507
Andrey Bokhanko [Thu, 11 Feb 2016 10:36:06 +0000 (10:36 +0000)]
Update of "GCC extensions not implemented yet" in Clang User's Manual
#pragma weak, global register variables and static initialization of flexible
array members are supported now, so they are removed from "GCC extensions not
implemented yet" list.
Differential Revision: http://reviews.llvm.org/D16851
llvm-svn: 260506
Haojian Wu [Thu, 11 Feb 2016 09:57:55 +0000 (09:57 +0000)]
[clang-tidy] Fix an assert failure in 'readability-braces-around-statements' check.
Summary:
The check will trigger a assert failure("CondEndLoc.isValid") when
checking the IfStmt whose condition expression is not parsed.
In this case, we should ignore that.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D17069
llvm-svn: 260505
Ashutosh Nema [Thu, 11 Feb 2016 09:23:53 +0000 (09:23 +0000)]
Fixed typo in comment & coding style for LoopVersioningLICM.
llvm-svn: 260504
Gabor Horvath [Thu, 11 Feb 2016 09:23:33 +0000 (09:23 +0000)]
[clang-tidy] Add a check to find unintended semicolons that changes the semantics.
Reviewers: hokein, alexfh
Differential Revision: http://reviews.llvm.org/D16535
llvm-svn: 260503
Craig Topper [Thu, 11 Feb 2016 07:39:29 +0000 (07:39 +0000)]
[TableGen] Use range-based for loops. NFC
llvm-svn: 260502
Craig Topper [Thu, 11 Feb 2016 07:39:27 +0000 (07:39 +0000)]
[TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.
llvm-svn: 260501
Craig Topper [Thu, 11 Feb 2016 07:39:25 +0000 (07:39 +0000)]
[TableGen] Whitespace cleanup in output file. NFC
llvm-svn: 260500
Craig Topper [Thu, 11 Feb 2016 07:39:22 +0000 (07:39 +0000)]
[TableGen] Simplify code slightly. NFC
llvm-svn: 260499
Simon Atanasyan [Thu, 11 Feb 2016 06:45:54 +0000 (06:45 +0000)]
[MC][ELF] Handle MIPS specific .sdata and .sbss directives
MIPS specific .sdata and .sbss directives create corresponding sections
with proper initialized ELF flags including ELF::SHF_MIPS_GPREL.
Differential Revision: http://reviews.llvm.org/D17001
llvm-svn: 260498
Daniel Jasper [Thu, 11 Feb 2016 06:43:01 +0000 (06:43 +0000)]
clang-format: Make it more expensive to break template parameters.
In particular, make it more expensive than breaking after the return
type of a function definition/declaration.
Before:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa<
T>::
aaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
After:
template <typename T>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaa<T>::
aaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa);
llvm-svn: 260497
Akira Hatanaka [Thu, 11 Feb 2016 06:36:35 +0000 (06:36 +0000)]
[Objective-c] Stop attaching section "datacoal_nt" to global variables.
The current macho linker just copies symbols in section datacoal_nt to
section data, so it doesn't really matter whether or not section
"datacoal_nt" is attached to the global variable.
This is a follow-up to r250370, which made changes in llvm to stop
putting functions and data in the *coal* sections.
rdar://problem/
24528611
llvm-svn: 260496
Matt Arsenault [Thu, 11 Feb 2016 06:15:39 +0000 (06:15 +0000)]
AMDGPU: Fix constant bus use check with subregisters
If the two operands to an instruction were both
subregisters of the same super register, it would incorrectly
think this counted as the same constant bus use.
This fixes the verifier error in fmin_legacy.ll which
was missing -verify-machineinstrs.
llvm-svn: 260495
Matt Arsenault [Thu, 11 Feb 2016 06:15:34 +0000 (06:15 +0000)]
AMDGPU: Fix passes depending on dominator tree for no reason
llvm-svn: 260494
Matt Arsenault [Thu, 11 Feb 2016 06:02:01 +0000 (06:02 +0000)]
AMDGPU: Remove some old intrinsic uses from tests
llvm-svn: 260493