Benjamin Kramer [Mon, 2 Mar 2015 22:20:22 +0000 (22:20 +0000)]
IndexedMap: Document why SmallVector<T, 0> is preferable here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231028
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 22:02:36 +0000 (22:02 +0000)]
Revert "Revert "For the dwarf expression code get the subtarget off of the current""
This reapplies r230990 without modifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231024
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 22:02:33 +0000 (22:02 +0000)]
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.
Ought to be NFC, but it does slightly alter the output format of the
textual assembly.
This reapplies 230930 without the assertion in DebugLocEntry::finalize()
because not all Machine registers can be lowered into DWARF register
numbers and floating point constants cannot be expressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231023
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 2 Mar 2015 22:00:23 +0000 (22:00 +0000)]
cmake: Use MSVC atomics with clang-cl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231022
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Mon, 2 Mar 2015 21:50:28 +0000 (21:50 +0000)]
Support: Use const pointers for reads.
Fixes tons of const-cast warnings.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Rui Ueyama <ruiu@google.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231021
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 2 Mar 2015 21:41:07 +0000 (21:41 +0000)]
Revert some changes that were made to fix PR20680.
This re-lands change r230921. r230921 was reverted because it broke a
clang test; a checkin fixing the clang test will be commited shortly.
Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533. SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow. There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.
Revert "IndVarSimplify: Allow LFTR to fire more often"
This reverts commit
1ade0f0faa98877b688e0b9da58e876052c1e04e (SVN: 222213).
Revert "IndVarSimplify: Don't let LFTR compare against a poison value"
This reverts commit
c0f2b8b528d8a37b0a1522aae90af649d6357eb5 (SVN: 217102).
Reviewers: majnemer, atrick, spatel
Differential Revision: http://reviews.llvm.org/D7979
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231018
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 2 Mar 2015 21:33:18 +0000 (21:33 +0000)]
lit: Add 'cd' support to the internal shell and port some tests
The internal shell was already threading around a 'cwd' parameter. We
just have to make it mutable so that we can update it as the test script
executes.
If the shell ever grows support for environment variable substitution,
we could also implement support for export.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231017
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Mon, 2 Mar 2015 21:19:12 +0000 (21:19 +0000)]
Use read{16,32,64}{le,be}() instead of *reinterpret_cast<u{little,big}{16,32,64}_t>().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231016
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 21:16:04 +0000 (21:16 +0000)]
SmallVector: Allow initialization and assignment from initializer_list.
Modeled after std::vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231015
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Mon, 2 Mar 2015 20:50:08 +0000 (20:50 +0000)]
TLI: Use lambda. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231011
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Mon, 2 Mar 2015 20:43:24 +0000 (20:43 +0000)]
Make ToVectorTy static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231007
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Mon, 2 Mar 2015 20:37:10 +0000 (20:37 +0000)]
Fix a copy-paste bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231006
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 20:01:54 +0000 (20:01 +0000)]
Revert "Refactor DebugLocDWARFExpression so it doesn't require access to the"
This reverts commit 230975 to investigate buildbot breakage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231004
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 20:01:47 +0000 (20:01 +0000)]
Revert "For the dwarf expression code get the subtarget off of the current"
This reverts commit 230990 because also reverting 230975.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231003
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Mon, 2 Mar 2015 20:00:15 +0000 (20:00 +0000)]
Support: Add {read,write}{16,32,64}{le,be} functions.
Add convenient functions for endian-aware reads/writes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231002
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Mon, 2 Mar 2015 19:52:42 +0000 (19:52 +0000)]
Remove useless .debug_macinfo section setup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231001
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 2 Mar 2015 19:34:11 +0000 (19:34 +0000)]
Change SystemZ large tests to use the existing long_tests property
(this is already used in Clang for a couple of tests)
Reviewers: uweigand
Differential Revision: http://reviews.llvm.org/D7965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230998
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 2 Mar 2015 19:19:04 +0000 (19:19 +0000)]
[PerformanceTips] Document various items folks have suggested
This could stand to be expanded - patches welcome! - but let's at least write them down so they don't get forgotten.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230995
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 2 Mar 2015 19:08:03 +0000 (19:08 +0000)]
Add r230655 back with a fix.
The issue is that now we have a diag handler during optimizations
and get forward every optimization remark, flooding stdout.
The same filtering should probably be done with or without a
custom handler, but for now just ignore remarks.
Original message:
gold-plugin: "Upgrade" debug info and handle its warnings.
The gold plugin never calls MaterializeModule, so any old debug info
was not deleted and could cause crashes.
Now that it is being "upgraded", the plugin also has to handle warnings
and create Modules with a nice id (it shows in the warning).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230991
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 2 Mar 2015 19:01:47 +0000 (19:01 +0000)]
For the dwarf expression code get the subtarget off of the current
MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230990
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Mon, 2 Mar 2015 18:59:38 +0000 (18:59 +0000)]
Restore LLVMLinkModules C API until it is properly deprecated.
Add the enum "LLVMLinkerMode" back for backwards-compatibility and add the
linker mode parameter back to the "LLVMLinkModules" function. The paramter is
ignored and has no effect.
Patch provided by: Filip Pizlo
Reviewed by: Rafael and Sean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230988
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Mon, 2 Mar 2015 18:56:52 +0000 (18:56 +0000)]
R600: Use c++11 style for loop
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tom@stellard.net>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230987
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Mon, 2 Mar 2015 18:50:18 +0000 (18:50 +0000)]
Revert r230979, should apply to all X86 ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230985
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Mon, 2 Mar 2015 17:50:13 +0000 (17:50 +0000)]
Making the SO version major.minor instead of just major because ABI and API change between minor versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230981
91177308-0d34-0410-b5e6-
96231b3b80d8
Paul Robinson [Mon, 2 Mar 2015 17:44:52 +0000 (17:44 +0000)]
[PS4] Correct relocation for DWARF TLS references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230979
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Mon, 2 Mar 2015 17:30:42 +0000 (17:30 +0000)]
export.sh: Make sure umask is not too restrictive (PR22742)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230977
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Mon, 2 Mar 2015 17:26:43 +0000 (17:26 +0000)]
Detect malformed YAML sequence in yaml::Input::beginSequence()
When reading a yaml::SequenceTraits object, YAMLIO does not report an
error if the yaml item is not a sequence. Instead, YAMLIO reads an
empty sequence. For example:
---
seq:
foo: 1
bar: 2
...
If `seq` is a SequenceTraits object, then reading the above yaml will
yield `seq` as an empty sequence.
Fix this to report an error for the above mapping ("not a sequence")
Patch by William Fisher. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230976
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 17:21:06 +0000 (17:21 +0000)]
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.
Ought to be NFC, but it does slightly alter the output format of the
textual assembly.
This reapplies 230930 with a relaxed assertion in DebugLocEntry::finalize()
that allows for empty DWARF expressions for constant FP values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230975
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 16:45:08 +0000 (16:45 +0000)]
Accidentaly inverted the condition again. Sorry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230973
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 16:42:56 +0000 (16:42 +0000)]
Avoid assertion in MSVC 2013 debug builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230972
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 15:24:41 +0000 (15:24 +0000)]
AsmWriter: Only print one space after the load type
Before: %x = load i32, i32* %i
After: %x = load i32, i32* %i
Purely cosmetic, so no new test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230966
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 15:24:36 +0000 (15:24 +0000)]
SLPVectorizer: Rewrite ArrayRef slice compare to be more idiomatic.
NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230965
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 15:24:30 +0000 (15:24 +0000)]
TblGen: Remove copy of SmallVector::operator==. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230964
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 2 Mar 2015 15:00:34 +0000 (15:00 +0000)]
AVX-512: Add assembly parser support for Rounding mode
By Asaf Badouh <asaf.badouh@intel.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230962
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 13:16:28 +0000 (13:16 +0000)]
NVPTX: Remove dead code.
Fun fact: This file was never referenced since the initial checkin of
the NVPTX backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230957
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Mon, 2 Mar 2015 12:47:32 +0000 (12:47 +0000)]
[mips] Optimize conditional moves where RHS is zero.
Summary:
When the RHS of a conditional move node is zero, we can utilize the $zero
register by inverting the conditional move instruction and by swapping the
order of its True/False operands.
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D7945
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230956
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Mon, 2 Mar 2015 12:46:21 +0000 (12:46 +0000)]
AVX-512: Simplified MOV patterns, no functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230954
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Wilkins [Mon, 2 Mar 2015 12:27:04 +0000 (12:27 +0000)]
bindings/go: expose DIBuilder::createReplaceableCompositeType
Summary:
We extend the DIBuilder type, adding a method for creating
replaceable composite types. This is necessary for creating
debug info describing self-referential types.
Reviewers: pcc
Reviewed By: pcc
Subscribers: axw, llvm-commits
Differential Revision: http://reviews.llvm.org/D7851
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230951
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 11:57:04 +0000 (11:57 +0000)]
Simplify code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230948
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 09:35:06 +0000 (09:35 +0000)]
Teach the verifier to enforce that the alignment argument of memory intrinsics must be a power of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230941
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 09:35:03 +0000 (09:35 +0000)]
Teach DataLayout that alignments on basic types must be powers of two.
Fixes assertion failures/crashes on bad datalayout specifications.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230940
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 09:34:59 +0000 (09:34 +0000)]
Teach DataLayout that ABI alignments for non-aggregate types must be non-zero.
This manifested as assertions and/or crashes in later phases of optimization,
depending on the build configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230939
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 06:33:51 +0000 (06:33 +0000)]
Teach DataLayout that pointer ABI and preferred alignments are required to be powers of two.
Previously this resulted in asserts and/or crashes (depending on build configuration) at various phases in the optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230938
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 06:00:02 +0000 (06:00 +0000)]
Teach DataLayout that zero-byte pointer sizes don't make sense.
Previously this would result in assertion failures or simply crashes
at various points in the optimizer when trying to create types of zero
bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230936
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 05:25:09 +0000 (05:25 +0000)]
Teach the LLParser to fail gracefully when it encounters an invalid label name.
Previous it would either assert in +Asserts, or crash in -Asserts. Found by fuzzing LLParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230935
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 2 Mar 2015 05:25:06 +0000 (05:25 +0000)]
Fix a crash in the LL parser where it failed to validate that the pointer operand of a GEP was valid.
This manifested as an assertion failure in +Asserts builds, and a hard crash in -Asserts builds. Found by fuzzing the LL parser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230934
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 2 Mar 2015 04:39:56 +0000 (04:39 +0000)]
[llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements:
1) Now supports -all command line argument, which implies many
other command line arguments to simplify usage.
2) Now supports -no-compiler-generated command line argument to
exclude compiler generated types.
3) Prints base class list.
4) -class-definitions implies -types.
5) Proper display of bitfields.
6) Can now distinguish between struct/class/interface/union.
And a few other minor tweaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230933
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Mon, 2 Mar 2015 04:37:11 +0000 (04:37 +0000)]
Revert r230930, it caused PR22747.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230932
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Mar 2015 03:33:11 +0000 (03:33 +0000)]
[X86] There are only 8 mask registers. Fail disassembly if instruction tries to reference more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230931
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 2 Mar 2015 02:38:18 +0000 (02:38 +0000)]
Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.
Ought to be NFC, but it does slightly alter the output format of the
textual assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230930
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 2 Mar 2015 01:14:03 +0000 (01:14 +0000)]
Revert r230921, "Revert some changes that were made to fix PR20680.", for now.
It caused a failure on clang/test/Misc/backend-optimization-failure.cpp .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230929
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 2 Mar 2015 01:08:07 +0000 (01:08 +0000)]
Add another missing header that used to be included transitively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230927
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 2 Mar 2015 01:04:34 +0000 (01:04 +0000)]
llvm/examples: Add missing include according to r230907.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230926
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 2 Mar 2015 00:22:29 +0000 (00:22 +0000)]
[X86] Fix diassembler crash on AVX512 cmpps/cmppd with immediate that doesn't fit in 5-bits. Fixes PR22743.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230924
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 2 Mar 2015 00:17:18 +0000 (00:17 +0000)]
[AArch64] fix an invalid-iterator-use bug.
Summary:
In AArch64PromoteConstant::appendAndTransferDominatedUses,
`InsertPts[NewPt]` invalidates IPI. Therefore, `InsertPts[NewPt] =
std::move(IPI->second)` is not legal.
This was caught by running `make check` with
http://reviews.llvm.org/D7931.
Reviewers: t.p.northover, grosbach, bkramer
Reviewed By: bkramer
Subscribers: aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D7988
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230923
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 23:56:19 +0000 (23:56 +0000)]
Fix a really bad typo in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230922
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 1 Mar 2015 23:36:26 +0000 (23:36 +0000)]
Revert some changes that were made to fix PR20680.
Summary:
As far as I can tell, the real bug causing the issue was fixed in
r230533. SCEVExpander should mark an increment operation as nuw or nsw
only if it can *prove* that the operation does not overflow. There
shouldn't be any situation where we have to do something different
because of no-wrap flags generated by SCEVExpander.
Revert "IndVarSimplify: Allow LFTR to fire more often"
This reverts commit
1ade0f0faa98877b688e0b9da58e876052c1e04e (SVN: 222213).
Revert "IndVarSimplify: Don't let LFTR compare against a poison value"
This reverts commit
c0f2b8b528d8a37b0a1522aae90af649d6357eb5 (SVN: 217102).
Reviewers: majnemer, atrick, spatel
Differential Revision: http://reviews.llvm.org/D7979
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230921
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 23:35:20 +0000 (23:35 +0000)]
ArrayRef: Put back std::equal for operator== with a check for the empty ArrayRefs
This has the nice property of compiling down to memcmp when feasible. An empty
ArrayRef can have a nullptr in its Data field. I didn't find anything in the
standard speaking against std::equal(nullptr, nullptr, nullptr) begin valid but
MSVC asserts. The way libstdc++ lowers std::equal down to memcmp also makes
invoking std::equal with a nullptr undefined behavior so checking is the only
way to be safe.
The extra check doesn't cost us perf either because we're essentially peeling
the loop header away from the rotated loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230920
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 22:34:04 +0000 (22:34 +0000)]
Another missing include for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230918
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 21:49:21 +0000 (21:49 +0000)]
std::function is part of <functional>, not <utility>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230913
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 21:47:46 +0000 (21:47 +0000)]
Add another missing include for MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230912
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 21:47:40 +0000 (21:47 +0000)]
X86: Replace variadic function with init list. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230911
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 21:28:53 +0000 (21:28 +0000)]
Add missing includes. make_unique proliferated everywhere.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230909
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Sun, 1 Mar 2015 21:22:50 +0000 (21:22 +0000)]
[PBQP] Address post-commit style comment for r230904. NFC.
Thanks David !
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230908
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 21:05:05 +0000 (21:05 +0000)]
ArrayRef: Remove the equals helper with many arguments.
With initializer lists there is a really neat idiomatic way to write
this, 'ArrayRef.equals({1, 2, 3, 4, 5})'. Remove the equal method which
always had a hard limit on the number of arguments. I considered
rewriting it with variadic templates but that's not really a good fit
for a function with homogeneous arguments.
'ArrayRef == {1, 2, 3, 4, 5}' would've been even more awesome, but C++11
doesn't allow init lists with binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230907
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Sun, 1 Mar 2015 20:39:34 +0000 (20:39 +0000)]
[PBQP] Do not add an edge between nodes with totally disjoint allowed registers
Such edges are zero matrix, and they bring no additional info to the
allocation problem, apart from contributing to nodes' degree. Removing
those edges is expected to improve allocation time.
Tune the spill cost comparison, as this gives better average performances
now that the nodes' degrees has changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230904
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 18:10:07 +0000 (18:10 +0000)]
Make VTs and UnicodeCharSet ctors constexpr if the compiler supports it.
There are static variables of this around that we really want to go
into a read-only segment. Sadly compilers are not smart enough to figure
that out without constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230895
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 1 Mar 2015 18:09:56 +0000 (18:09 +0000)]
Make some non-constant static variables non-static or fully const.
Otherwise we have to emit thread-safe initialization for them. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230894
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 1 Mar 2015 08:23:41 +0000 (08:23 +0000)]
Reverted 230471 - gather scatter handling in table gen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230892
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 1 Mar 2015 07:44:04 +0000 (07:44 +0000)]
AVX-512: Added mask and rounding mode for scalar arithmetics
Added more tests for scalar instructions to destinguish between AVX and AVX-512 forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230891
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 1 Mar 2015 06:59:57 +0000 (06:59 +0000)]
[llvm-pdbdump] Fix GCC build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230890
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 1 Mar 2015 06:51:29 +0000 (06:51 +0000)]
[llvm-pdbdump] Clean up method signatures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230889
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sun, 1 Mar 2015 06:49:49 +0000 (06:49 +0000)]
[llvm-pdbdump] Add regex-based filtering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230888
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 1 Mar 2015 04:16:28 +0000 (04:16 +0000)]
Revert r230655, "gold-plugin: "Upgrade" debug info and handle its warnings."
It emits *millions of warnings* during selfhosting LTO build, to choke the buildbot with gigbytes of log.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230885
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 1 Mar 2015 00:09:35 +0000 (00:09 +0000)]
avoid infinite looping when folding vector multiplies of constants (PR22698)
We were missing a check for the following fold in DAGCombiner:
// fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))
If 'x' is also a constant, then we shouldn't do anything. Otherwise, we could end up swapping the operands back and forth forever.
This should fix:
http://llvm.org/bugs/show_bug.cgi?id=22698
Differential Revision: http://reviews.llvm.org/D7917
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230884
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 1 Mar 2015 00:02:03 +0000 (00:02 +0000)]
fixed to test only the feature, not the feature and a CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230883
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:57:16 +0000 (23:57 +0000)]
DebugInfo: Convert DW_OP_piece => DW_OP_bit_piece
r228631 stopped using `DW_OP_piece` inside `DIExpression`s in the IR,
but it apparently missed updating these testcases. Caught by verifier
checks for `MDExpression` while working on moving the new hierarchy into
place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230882
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 28 Feb 2015 23:55:24 +0000 (23:55 +0000)]
make the tested feature (SSE2) explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230881
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:52:24 +0000 (23:52 +0000)]
DebugInfo: Fix invalid file reference in CodeGen/X86/unknown-location.ll
There are two types of files in the old (current) debug info schema.
!0 = !{!"some/filename", !"/path/to/dir"}
!1 = !{!"0x29", !0} ; [ DW_TAG_file_type ]
!1 has a wrapper class called `DIFile` which inherits from `DIScope` and
is referenced in 'scope' fields.
!0 is called a "file node", and debug info nodes with a 'file' field
point at one of these directly -- although they're built in `DIBuilder`
by sending in a `DIFile` and reaching into it.
In the new hierarchy, I unified these nodes as `MDFile` (which `DIFile`
is a lightweight wrapper for) in r230057. Moving the new hierarchy into
place (and upgrading testcases) caused CodeGen/X86/unknown-location.ll
to start failing -- apparently "0x29" was previously showing up in the
linetable as a filename, causing:
.loc 2 4 3
(where 2 points at filename "0x29") instead of:
.loc 1 4 3
(where 1 points at the actual filename).
Change the testcase to use the old schema correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230880
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:48:02 +0000 (23:48 +0000)]
DebugInfo: Use TempMDNode in DIDescriptor::replaceAllUsesWith()
Start using `TempMDNode` in `DIDescriptor::replaceAllUsesWith()`
(effectively `std::unique_ptr<MDNode, MDNode::deleteTemporary>`).
Besides making ownership more explicit, this prepares for when
`DIDescriptor` refers to nodes that are *not* `MDTuple`. The old logic
for "replacing" a node with itself used `MDNode::get()` to return a new
(uniqued) `MDTuple`, while the new logic just defers to
`MDNode::replaceWithUniqued()` (which also typically saves an allocation
and RAUW traffic by mutating the temporary in place).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230879
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 28 Feb 2015 23:47:09 +0000 (23:47 +0000)]
fixed to test only the feature, not the feature and a CPU
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230878
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 23:21:38 +0000 (23:21 +0000)]
Optimize metadata node fields for CHECK-ability
While gaining practical experience hand-updating CHECK lines (for moving
the new debug info hierarchy into place), I learnt a few things about
CHECK-ability of the specialized node assembly output.
- The first part of a `CHECK:` is to identify the "right" node (this
is especially true if you intend to use the new `CHECK-SAME`
feature, since the first CHECK needs to identify the node correctly
before you can split the line).
- If there's a `tag:`, it should go first.
- If there's a `name:`, it should go next (followed by the
`linkageName:`, if any).
- If there's a `scope:`, it should follow after that.
- When a node type supports multiple DW_TAGs, but one is implied by
its name and is overwhelmingly more common, the `tag:` field is
terribly uninteresting unless it's different.
- `MDBasicType` is almost always `DW_TAG_base_type`.
- `MDTemplateValueParameter` is almost always
`DW_TAG_template_value_parameter`.
- Printing `name: ""` doesn't improve CHECK-ability, and there are far
more nodes than I realized that are commonly nameless.
- There are a few other fields that similarly aren't very interesting
when they're empty.
This commit updates the `AsmWriter` as suggested above (and makes
necessary changes in `LLParser` for round-tripping).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230877
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 28 Feb 2015 22:25:06 +0000 (22:25 +0000)]
fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230876
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 22:20:16 +0000 (22:20 +0000)]
AsmWriter: Escape string fields in metadata
Properly escape string fields in metadata. I've added a spot-check with
direct coverage for `MDFile::getFilename()`, but we'll get more coverage
once the hierarchy is moved into place (since this comes up in various
checked-in testcases).
I've replicated the `if` logic using the `ShouldSkipEmpty` flag
(although a follow-up commit is going to change how often this flag is
specified); no NFCI other than escaping the string fields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230875
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 22:16:56 +0000 (22:16 +0000)]
AsmWriter: Extract writeStringField(), NFCI
Extract logic for escaping a string field in the new debug info
hierarchy from `GenericDebugNode`. A follow-up commit will use it far
more widely (hence the dead code for `ShouldSkipEmpty`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230873
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 21:58:10 +0000 (21:58 +0000)]
Fix buildbot issues for MDScope::getFile() after r230871
I hope this extra cast will make everyone happy...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230872
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 21:47:02 +0000 (21:47 +0000)]
IR: Specialize MDScope::getFile() for MDFile
Fix `MDScope::getFile()` so that it correctly returns a valid `MDFile`
even when it's an instance of `MDFile`. This logic is necessary because
of r230057. I'm working on moving the new hierarchy into place
out-of-tree (on track to commit Monday morning, BTW), and this was
exposed by a few failing tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230871
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 28 Feb 2015 21:38:32 +0000 (21:38 +0000)]
Fix line endings on Transforms/Inline/inline_dbg_declare.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230870
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 28 Feb 2015 20:23:18 +0000 (20:23 +0000)]
[llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is
no PDB implementation for this platform" and "I tried to load
the PDB, but couldn't find the file", making it hard to figure
out if you built llvm-pdbdump incorrectly or if you just mistyped
a file name.
This patch adds proper error handling so that we can know exactly
what went wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230868
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Feb 2015 20:15:07 +0000 (20:15 +0000)]
IndexedMap: Default to SmallVector<T, 0>
This looks ridiculous but SmallVector's realloc tricks really help with
large vectors of PODs, such as our virtreg IndexedMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230866
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Feb 2015 20:15:00 +0000 (20:15 +0000)]
DwarfAccelTable: We know how many hashes we have in the output, just reserve the precise number
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230865
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Feb 2015 20:14:38 +0000 (20:14 +0000)]
StackColoring: Move set instead of copying. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230864
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Feb 2015 20:14:27 +0000 (20:14 +0000)]
LiveRange: Replace a creative vector erase loop with std::remove_if.
I didn't see this so far because it scans backwards, but that doesn't
make it any less quadratic. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230863
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Sat, 28 Feb 2015 19:43:20 +0000 (19:43 +0000)]
Revert r230812. Do not break builds for no reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230862
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Sat, 28 Feb 2015 19:34:54 +0000 (19:34 +0000)]
Fixup for recent -fast-isel-abort change: code didn't match description
Level 1 should abort for all instructions but call/terminators/args.
Instead it was aborting only if the level was > 2
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230861
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 28 Feb 2015 19:33:17 +0000 (19:33 +0000)]
[X86] Remove the blendpd/blendps/pblendw/pblendd intrinsics. They can represented by shuffle_vector instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230860
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 28 Feb 2015 19:08:27 +0000 (19:08 +0000)]
[raw_ostream] When printing color on Windows, use correct bg color.
When using SetConsoleTextAttribute() to set the foreground or
background color, if you don't explicitly set both colors, then
a default value of black will be chosen for whichever you don't
specify a value for.
This is annoying when you have a non default console background
color, for example, and you try to set the foreground color.
This patch gets the existing fg/bg color and when you set one
attribute, sets the opposite attribute to its existing color
prior to comitting the update.
Reviewed by: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D7967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230859
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Sat, 28 Feb 2015 18:03:04 +0000 (18:03 +0000)]
bpf: fix build
complete the plumbing of passing TargetRegisterInfo through
computeRegisterProperties started by r230583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230858
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 28 Feb 2015 16:47:27 +0000 (16:47 +0000)]
TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator.
Leaving empty blocks around just opens up a can of bugs like PR22704. Deleting
them early also slightly simplifies code.
Thanks to Sanjay for the IR test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230856
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Sat, 28 Feb 2015 15:54:04 +0000 (15:54 +0000)]
Silence variable set but not used warning in CodeGenRegisters.cpp, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230854
91177308-0d34-0410-b5e6-
96231b3b80d8