Craig Topper [Thu, 8 Feb 2018 06:27:18 +0000 (06:27 +0000)]
[DAGCombiner] Fix a couple mistakes from r324311 by really passing the original load to ExtendSetCCUses.
We're passing the binary op that uses the load instead of the load.
Noticed by inspection. Not sure how to test this because this just prevents the introduction of an extend that will later be truncated and will probably be combined out.
llvm-svn: 324568
Craig Topper [Thu, 8 Feb 2018 06:04:18 +0000 (06:04 +0000)]
[DAGCombiner] Don't create truncate nodes in (aext (zextload x)) -> (zextload x) and similar folds. NFCI
The truncate is being used to replace other users of of the load, but we checked that the load only has one use so there are no other uses to replace.
llvm-svn: 324567
Marshall Clow [Thu, 8 Feb 2018 05:47:40 +0000 (05:47 +0000)]
Improve a test. NFC
llvm-svn: 324566
Peter Collingbourne [Thu, 8 Feb 2018 05:28:39 +0000 (05:28 +0000)]
ARM: Remove dead code. NFCI.
llvm-svn: 324565
Aaron Smith [Thu, 8 Feb 2018 05:11:17 +0000 (05:11 +0000)]
[docs] Update docs for cmake options LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER
Summary:
LLDB_TEST_COMPILER is not a valid option for CMake for LLDB. There are instead two properties LLDB_TEST_C_COMPILER and LLDB_TEST_CXX_COMPILER. Update the documents accordingly to reflect the correct information.
Reviewers: zturner, lldb-commits
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D43061
llvm-svn: 324564
Francis Visoiu Mistrih [Thu, 8 Feb 2018 05:02:00 +0000 (05:02 +0000)]
[CodeGen] Print MachineBasicBlock labels using MIR syntax in -debug output
Instead of:
%bb.1: derived from LLVM BB %for.body
print:
bb.1.for.body:
Also use MIR syntax for MBB attributes like "align", "landing-pad", etc.
llvm-svn: 324563
Craig Topper [Thu, 8 Feb 2018 04:38:04 +0000 (04:38 +0000)]
[DAGCombiner] Avoid creating truncate nodes in (zext (and (load)))->(and (zextload)) fold until we know for sure we're going to need it. NFCI
The truncate is only needed if the load has additional users. It used to get passed to extendSetCCUses so was created early, but that's no longer the case.
llvm-svn: 324562
Craig Topper [Thu, 8 Feb 2018 04:38:02 +0000 (04:38 +0000)]
[DAGCombiner] Rename variable to be slightly better. NFC
We were calling a load LN0 but it came from N0.getOperand(0) so its really more like LN00 if we follow the name used in other places.
llvm-svn: 324561
Yonghong Song [Thu, 8 Feb 2018 04:37:49 +0000 (04:37 +0000)]
bpf: Improve expanding logic in LowerSELECT_CC
LowerSELECT_CC is not generating optimal Select_Ri pattern at the moment. It
is not guaranteed to place ConstantNode at RHS which would miss matching
Select_Ri.
A new testcase added into the existing select_ri.ll, also there is an
existing case in cmp.ll which would be improved to use Select_Ri after this
patch, it is adjusted accordingly.
Reported-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 324560
Dmitry Mikulin [Thu, 8 Feb 2018 04:25:52 +0000 (04:25 +0000)]
Symbols defined in linker scripts should not have dso_local flag set in LTO resolutions.
Differential Revision: https://reviews.llvm.org/D43051
llvm-svn: 324559
Eugene Zemtsov [Thu, 8 Feb 2018 03:05:47 +0000 (03:05 +0000)]
Deactivate TestTargetSymbolsBuildidCase if host is windows
Makefile has unix magic and thus not working on windows.
llvm-svn: 324558
Peter Collingbourne [Thu, 8 Feb 2018 02:41:22 +0000 (02:41 +0000)]
gold-plugin: Do not set codegen opt level based on LTO opt level.
The LTO opt level should not affect the codegen opt level, and indeed
it does not affect it in lld. Ideally the codegen opt level should
be controlled by an IR-level attribute based on the compile-time opt
level, but that hasn't been implemented yet.
Differential Revision: https://reviews.llvm.org/D43040
llvm-svn: 324557
Rafael Espindola [Thu, 8 Feb 2018 02:29:56 +0000 (02:29 +0000)]
Add space inside the regular expression.
This should now pass on both ppc and x86. Sorry about the noise.
llvm-svn: 324556
Aaron Smith [Thu, 8 Feb 2018 02:13:48 +0000 (02:13 +0000)]
Add CMAKE_CFG_INTDIR as part of the include path for the default test compiler.
Summary:
This is a small change towards running the LLDB unit tests on Windows (still WIP).
Builds that use make do not point to specific configurations. However, builds with multiple configurations such as Visual Studio on Windows need the configuration (release/debug/etc) as part of the path so the binaries produced by clang are placed in the correct directory for the configuration.
Reviewers: zturner, lldb-commits, labath
Reviewed By: labath
Subscribers: labath, mgorny, hintonda, llvm-commits
Differential Revision: https://reviews.llvm.org/D42990
llvm-svn: 324555
Matt Arsenault [Thu, 8 Feb 2018 01:56:14 +0000 (01:56 +0000)]
AMDGPU: Fix incorrect reordering when inline asm defines LDS address
Defs of operands outside of the instruction's explicit defs need
to be checked.
llvm-svn: 324554
Ben Hamilton [Thu, 8 Feb 2018 01:49:10 +0000 (01:49 +0000)]
[clang-format] Set ObjCBinPackProtocolList to Never for google style
Summary:
This is split off from D42650, and sets ObjCBinPackProtocolList
to Never for the google style.
Depends On D42650
Test Plan: New tests added. make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: krasimir, jolesiak, stephanemoore
Reviewed By: krasimir, jolesiak, stephanemoore
Subscribers: klimek, cfe-commits, hokein, Wizard
Differential Revision: https://reviews.llvm.org/D42708
llvm-svn: 324553
Rafael Espindola [Thu, 8 Feb 2018 01:17:26 +0000 (01:17 +0000)]
Add a testcase for PR36268.
llvm-svn: 324552
Rafael Espindola [Thu, 8 Feb 2018 01:16:05 +0000 (01:16 +0000)]
Fix PR36268.
The issue is that clang was first creating a extern_weak hidden GV and
then changing the linkage to external.
Once we know it is not extern_weak we know it must be dso_local.
This patch refactors the code that sets the implicit dso_local to a
helper private function that is used every time we change the linkage
or visibility.
I will commit a patch to clang in a minute.
llvm-svn: 324551
Matt Arsenault [Thu, 8 Feb 2018 01:12:46 +0000 (01:12 +0000)]
AMDGPU: Don't crash when trying to fold implicit operands
llvm-svn: 324550
Justin Lebar [Thu, 8 Feb 2018 00:50:04 +0000 (00:50 +0000)]
[NVPTX] When dying due to a bad address space value, print out the value.
llvm-svn: 324549
Rafael Espindola [Thu, 8 Feb 2018 00:39:19 +0000 (00:39 +0000)]
Remove extra space.
Should fix the ppc bots.
llvm-svn: 324548
Stanislav Mekhanoshin [Thu, 8 Feb 2018 00:18:35 +0000 (00:18 +0000)]
[AMDGPU] Fixed wait count reuse
The code reusing existing wait counts is incorrect since it keeps
adding new operands to an old instruction instead of replacing
the immediate. It was also effectively switched off by the condition
that wait count is not an AMDGPU::S_WAITCNT.
Also switched to BuildMI instead of creating instructions directly.
Differential Revision: https://reviews.llvm.org/D42997
llvm-svn: 324547
Chandler Carruth [Wed, 7 Feb 2018 23:59:14 +0000 (23:59 +0000)]
[x86] Fix nasty bug in the x86 backend that is essentially impossible to
hit from IR but creates a minefield for MI passes.
The x86 backend has fairly powerful logic to try and fold loads that
feed register operands to instructions into a memory operand on the
instruction. This is almost always a good thing, but there are specific
relocated loads that are only allowed to appear in specific
instructions. Notably, R_X86_64_GOTTPOFF is only allowed in `movq` and
`addq`. This patch blocks folding of memory operands using this
relocation unless the target is in fact `addq`.
The particular relocation indicates why we simply don't hit this under
normal circumstances. This relocation is only used for TLS, and it gets
used in very specific ways in conjunction with %fs-relative addressing.
The result is that loads using this relocation are essentially never
eligible for folding into an instruction's memory operands. Unless, of
course, you have an MI pass that inserts usage of such a load. I have
exactly such an MI pass and was greeted by truly mysterious miscompiles
where the linker replaced my instruction with a completely garbage byte
sequence. Go team.
This is the only such relocation I'm aware of in x86, but there may be
others that need to be similarly restricted.
Fixes PR36165.
Differential Revision: https://reviews.llvm.org/D42732
llvm-svn: 324546
Eric Fiselier [Wed, 7 Feb 2018 23:50:25 +0000 (23:50 +0000)]
Fix size and alignment of array<T, 0>.
An array T[1] isn't necessarily the same say when it's
a member of a struct. This patch addresses that problem and corrects
the tests to deal with it.
llvm-svn: 324545
Mircea Trofin [Wed, 7 Feb 2018 23:29:52 +0000 (23:29 +0000)]
Verify profile data confirms large loop trip counts.
Summary:
Loops with inequality comparers, such as:
// unsigned bound
for (unsigned i = 1; i < bound; ++i) {...}
have getSmallConstantMaxTripCount report a large maximum static
trip count - in this case, 0xffff fffe. However, profiling info
may show that the trip count is much smaller, and thus
counter-recommend vectorization.
This change:
- flips loop-vectorize-with-block-frequency on by default.
- validates profiled loop frequency data supports vectorization,
when static info appears to not counter-recommend it. Absence
of profile data means we rely on static data, just as we've
done so far.
Reviewers: twoh, mkuper, davidxl, tejohnson, Ayal
Reviewed By: davidxl
Subscribers: bkramer, llvm-commits
Differential Revision: https://reviews.llvm.org/D42946
llvm-svn: 324543
Richard Smith [Wed, 7 Feb 2018 23:23:23 +0000 (23:23 +0000)]
Fix compilation in C++17 mode.
C++17 removes `std::unexpected_handler`, but libc++abi needs it to define
`__cxa_exception`. When building against libc++, this is easily rectified by
telling libc++ we're building the library. We already do this in the other
places where we need these symbols.
Differential Revision: https://reviews.llvm.org/D42987
llvm-svn: 324542
Rafael Espindola [Wed, 7 Feb 2018 23:13:57 +0000 (23:13 +0000)]
Update for llvm change.
llvm-svn: 324541
Erich Keane [Wed, 7 Feb 2018 23:04:38 +0000 (23:04 +0000)]
[NFCi] Replace a couple of usages of const StringRef& with StringRef
No sense passing these by reference when a copy is about as free, and
saves on potential indirection later.
llvm-svn: 324540
Rafael Espindola [Wed, 7 Feb 2018 23:04:06 +0000 (23:04 +0000)]
Don't try to use copy relocations with tls variables.
Should fix the lldb bot.
llvm-svn: 324539
Craig Topper [Wed, 7 Feb 2018 22:45:38 +0000 (22:45 +0000)]
[X86] Prune some unreachable 'return SDValue()' paths from LowerSIGN_EXTEND/LowerZERO_EXTEND/LowerANY_EXTEND.
We were doing a lot of whitelisting of what we handle in these routines, but setOperationAction constrains what we can get here. So just add some asserts and prune the unreachable paths.
llvm-svn: 324538
Richard Smith [Wed, 7 Feb 2018 22:25:16 +0000 (22:25 +0000)]
PR36055: fix computation of *-dependence in nested initializer lists.
When we synthesize an implicit inner initializer list when analyzing an outer
initializer list, we add it to the outer list immediately, and then fill in the
inner list. This gives the outer list no chance to update its *-dependence bits
with those of the completed inner list. To fix this, re-add the inner list to
the outer list once it's completed.
Note that we do not recompute the *-dependence bits from scratch when we
complete an outer list; this would give the wrong result for the case where a
designated initializer overwrites a dependent initializer with a non-dependent
one. The resulting list in that case should still be dependent, even though all
traces of the dependence were removed from the semantic form.
llvm-svn: 324537
Craig Topper [Wed, 7 Feb 2018 22:19:26 +0000 (22:19 +0000)]
[X86] Remove dead code from EmitTest that looked for an i1 type which should have already been type legalized away. NFC
llvm-svn: 324536
Rafael Espindola [Wed, 7 Feb 2018 22:15:33 +0000 (22:15 +0000)]
Recommit r324107 again.
The difference from the previous try is that we no longer directly
access function declarations from position independent executables. It
should work, but currently doesn't with some linkers.
It now includes a fix to not mark available_externally definitions as
dso_local.
Original message:
Start setting dso_local in clang.
This starts adding dso_local to clang.
The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go
away. My objective for now is to move enough of it to clang to remove
the need for the TargetMachine one to handle PIE copy relocations and
-fno-plt. With that it should then be easy to implement a
-fno-copy-reloc in clang.
This patch just adds the cases where we assume a symbol to be local
based on the file being compiled for an executable or a shared
library.
llvm-svn: 324535
Dan Albert [Wed, 7 Feb 2018 21:58:48 +0000 (21:58 +0000)]
Stop using __strtonum_fallback on Android.
Fallback implementations are now provided by bionic when necessary,
which these may conflict with.
llvm-svn: 324534
Craig Topper [Wed, 7 Feb 2018 21:41:50 +0000 (21:41 +0000)]
[X86] When doing callee save/restore for k-registers make sure we don't use KMOVQ on non-BWI targets
If we are saving/restoring k-registers, the default behavior of getMinimalRegisterClass will find the VK64 class with a spill size of 64 bits. This will cause the KMOVQ opcode to be used for save/restore. If we don't have have BWI instructions we need to constrain the class returned to give us VK16 with a 16-bit spill size. We can do this by passing the either v16i1 or v64i1 into getMinimalRegisterClass.
Also add asserts to make sure BWI is enabled anytime we use KMOVD/KMOVQ. These are what caught this bug.
Fixes PR36256
Differential Revision: https://reviews.llvm.org/D42989
llvm-svn: 324533
Marshall Clow [Wed, 7 Feb 2018 21:30:17 +0000 (21:30 +0000)]
Fix PR#31454 - 'basic_string<T>::push_back() crashes if sizeof(T)>sizeof(long long)'. We were mishandling the small-string optimization calculations for very large 'characters'. This may be an ABI change (change the size of) strings of very large 'characters', but since they never worked, I'm not too concerned.
llvm-svn: 324531
Craig Topper [Wed, 7 Feb 2018 21:29:30 +0000 (21:29 +0000)]
[X86] Auto-generate complete checks. NFC
llvm-svn: 324530
Eric Fiselier [Wed, 7 Feb 2018 21:25:25 +0000 (21:25 +0000)]
Fix -verify static assert messages for older Clang versions
llvm-svn: 324529
Ed Maste [Wed, 7 Feb 2018 21:22:20 +0000 (21:22 +0000)]
Document --build-id=fast in ld.lld.1
Initial ld.lld.1 man page commit in r324512 crossed paths with r324502
which added --build-id=fast, allowing --build-id to be documented as a
synonym for --build-id=fast. Catch up with that change in the man page.
Differential Revision: https://reviews.llvm.org/D43039
llvm-svn: 324528
Vedant Kumar [Wed, 7 Feb 2018 21:17:22 +0000 (21:17 +0000)]
[clang-import-test] Run clang-format, NFC
I ran across clang-import-test while looking into testing for lldb.
There shouldn't be any harm in running clang-format over it.
llvm-svn: 324527
Eric Fiselier [Wed, 7 Feb 2018 21:06:13 +0000 (21:06 +0000)]
[libc++] Fix PR35491 - std::array of zero-size doesn't work with non-default constructible types.
Summary:
This patch fixes llvm.org/PR35491 and LWG2157 (https://cplusplus.github.io/LWG/issue2157)
The fix attempts to maintain ABI compatibility by replacing the array with a instance of `aligned_storage`.
Reviewers: mclow.lists, EricWF
Reviewed By: EricWF
Subscribers: lichray, cfe-commits
Differential Revision: https://reviews.llvm.org/D41223
llvm-svn: 324526
Alex Lorenz [Wed, 7 Feb 2018 20:45:39 +0000 (20:45 +0000)]
[PR36008] Avoid -Wsign-compare warning for enum constants in
typeof expressions
This commit looks through typeof type at the original expression when diagnosing
-Wsign-compare to avoid an unfriendly diagnostic.
rdar://
36588828
Differential Revision: https://reviews.llvm.org/D42561
llvm-svn: 324514
Ed Maste [Wed, 7 Feb 2018 20:38:18 +0000 (20:38 +0000)]
Add ld.lld.1 man page, describing lld's ELF linker
One of the FreeBSD requirements for enabling lld as the system linker is
that it has a man page. Other FreeBSD developers and I created one using
lld's --help output as a starting point. This is an expanded and
improved version of that.
This man page would benefit from additional content, but it provides
basic user-facing coverage of lld's options and serves as a good
starting point.
Differential Revision: https://reviews.llvm.org/D42963
llvm-svn: 324512
Momchil Velikov [Wed, 7 Feb 2018 20:28:47 +0000 (20:28 +0000)]
Revert "[DebugInfo] Improvements to representation of enumeration types (PR36168)"
Revert commit r324489, it broke LLDB tests.
llvm-svn: 324511
Alexey Bataev [Wed, 7 Feb 2018 20:11:37 +0000 (20:11 +0000)]
[SLP] Add a tests for PR36280, NFC.
llvm-svn: 324510
Jim Ingham [Wed, 7 Feb 2018 20:09:13 +0000 (20:09 +0000)]
Remove an errant ^S
(still can't get over those Emacs habits...)
llvm-svn: 324509
Momchil Velikov [Wed, 7 Feb 2018 19:57:04 +0000 (19:57 +0000)]
Revert [DebugInfo] Improvements to representation of enumeration types (PR36168)"
Revert due to breaking buildbots (LLDB tests)
llvm-svn: 324508
George Karpenkov [Wed, 7 Feb 2018 19:56:52 +0000 (19:56 +0000)]
[analyzer] [NFC] Factor out generating path diagnostics for a statement into a function
Differential Revision: https://reviews.llvm.org/D42558
llvm-svn: 324507
Rafael Espindola [Wed, 7 Feb 2018 19:44:15 +0000 (19:44 +0000)]
Revert "Recommit r324107."
This reverts commit r324500.
The bots found two failures:
ThreadSanitizer-x86_64 :: Linux/pie_no_aslr.cc
ThreadSanitizer-x86_64 :: pie_test.cc
when using gold. The issue is a limitation in gold when building pie
binaries. I will investigate how to work around it.
llvm-svn: 324505
Zachary Turner [Wed, 7 Feb 2018 19:37:52 +0000 (19:37 +0000)]
Generate PDB files for profiling even in Release build.
This patch enables PDB generation for Release build, which has
slightly different optimize option with RelWithDebInfo on windows.
This helps to know slow part of Release build when profiling.
Patch by Takuto Ikuta
Differential Revision: https://reviews.llvm.org/D42632
llvm-svn: 324504
Marshall Clow [Wed, 7 Feb 2018 19:24:37 +0000 (19:24 +0000)]
Comment on 'Review' issues
llvm-svn: 324503
Rui Ueyama [Wed, 7 Feb 2018 19:22:42 +0000 (19:22 +0000)]
Add --build-id=fast as a synonym for --build-id.
When you omit an argument, most options fall back to their defaults.
For example, --color-diagnostics is a synonym for --color-diagnostics=auto.
We don't have a way to specify the default choice for --build-id, so we
can't describe --build-id (without an argument) in that way.
This patch adds "fast" for the default build-id choice.
Differential Revision: https://reviews.llvm.org/D43032
llvm-svn: 324502
Eric Fiselier [Wed, 7 Feb 2018 19:17:03 +0000 (19:17 +0000)]
Fix r324498: the commit removed the '-' before the disable-llvm-verifier flag
llvm-svn: 324501
Rafael Espindola [Wed, 7 Feb 2018 19:16:49 +0000 (19:16 +0000)]
Recommit r324107.
It now includes a fix to not mark available_externally definitions as
dso_local.
Original message:
Start setting dso_local in clang.
This starts adding dso_local to clang.
The hope is to eventually have TargetMachine::shouldAssumeDsoLocal go
away. My objective for now is to move enough of it to clang to remove
the need for the TargetMachine one to handle PIE copy relocations and
-fno-plt. With that it should then be easy to implement a
-fno-copy-reloc in clang.
This patch just adds the cases where we assume a symbol to be local
based on the file being compiled for an executable or a shared
library.
llvm-svn: 324500
Rafael Espindola [Wed, 7 Feb 2018 19:04:41 +0000 (19:04 +0000)]
Don't pass ForDefinition_t in places it is redundant.
I found this while looking at the ppc failures caused by the dso_local
change.
The issue was that the patch would produce the wrong answer for
available_externally. Having ForDefinition_t available in places where
the code can just check the linkage is a bit of a foot gun.
This patch removes the ForDefiniton_t argument in places where the
linkage is already know.
llvm-svn: 324499
Eric Fiselier [Wed, 7 Feb 2018 18:36:51 +0000 (18:36 +0000)]
[Driver] Add option to manually control discarding value names in LLVM IR.
Summary:
Currently, assertion-disabled Clang builds emit value names when generating LLVM IR. This is controlled by the `NDEBUG` macro, and is not easily overridable. In order to get IR output containing names from a release build of Clang, the user must manually construct the CC1 invocation w/o the `-discard-value-names` option. This is less than ideal.
For example, Godbolt uses a release build of Clang, and so when asked to emit LLVM IR the result lacks names, making it harder to read. Manually invoking CC1 on Compiler Explorer is not feasible.
This patch adds the driver options `-fdiscard-value-names` and `-fno-discard-value-names` which allow the user to override the default behavior. If neither is specified, the old behavior remains.
Reviewers: erichkeane, aaron.ballman, lebedev.ri
Reviewed By: aaron.ballman
Subscribers: bogner, cfe-commits
Differential Revision: https://reviews.llvm.org/D42887
llvm-svn: 324498
Craig Topper [Wed, 7 Feb 2018 18:32:15 +0000 (18:32 +0000)]
[X86] Regenerate test using update_mir_test_checks.py. NFC
llvm-svn: 324497
Yvan Roux [Wed, 7 Feb 2018 18:27:25 +0000 (18:27 +0000)]
[asan] Fix filename size on linux platforms.
This is a a fix for:
https://bugs.llvm.org/show_bug.cgi?id=35996
Use filename limits from system headers to be synchronized with what
LD_PRELOAD can handle.
Differential Revision: https://reviews.llvm.org/D42900
llvm-svn: 324496
Gheorghe-Teodor Bercea [Wed, 7 Feb 2018 18:21:55 +0000 (18:21 +0000)]
[OpenMP][libomptarget] Add data sharing support in libomptarget
Summary: This patch extends the libomptarget functionality in patch D14254 with support for the data sharing scheme for supporting implicitly shared variables. The runtime therefore maintains a list of references to shared variables.
Reviewers: carlo.bertolli, ABataev, Hahnfeld, grokos, caomhin, hfinkel
Reviewed By: Hahnfeld, grokos
Subscribers: guansong, llvm-commits, openmp-commits
Differential Revision: https://reviews.llvm.org/D41485
llvm-svn: 324495
Rafael Espindola [Wed, 7 Feb 2018 18:09:35 +0000 (18:09 +0000)]
Revert "AMDGPU: Add 32-bit constant address space"
This reverts commit r324487.
It broke clang tests.
llvm-svn: 324494
Jonas Devlieghere [Wed, 7 Feb 2018 17:35:27 +0000 (17:35 +0000)]
Revert dsymutil -update commits
Revert "[dsymutil][test] Check the updated dSYM instead of companion file."
Revert "[dsymutil] Upstream update feature."
llvm-svn: 324493
Jonas Devlieghere [Wed, 7 Feb 2018 17:34:46 +0000 (17:34 +0000)]
[test] Don't drop existing categories for methods.
The change in r324488 dropped the existing category attribute in for
instance methods. This patch corrects that.
Differential revision: https://reviews.llvm.org/D43024
llvm-svn: 324492
Nirav Dave [Wed, 7 Feb 2018 17:12:34 +0000 (17:12 +0000)]
[SelectionDAG] More Aggressibly prune nodes in AddChains. NFCI.
Travel all chains paths to first non-tokenfactor node can be
exponential work. Add simple redundency check to avoid this.
Fixes PR36264.
llvm-svn: 324491
Momchil Velikov [Wed, 7 Feb 2018 16:52:02 +0000 (16:52 +0000)]
[DebugInfo] Improvements to representation of enumeration types (PR36168)
This patch:
* fixes an incorrect sign-extension of unsigned values, when emitting
debug info metadata for enumerators
* the enumerators metadata is created with a flag, which determines
interpretation of the value bits (signed or unsigned)
* the enumerations metadata contains the underlying integer type and a
flag, indicating whether this is a C++ "fixed enum"
Differential Revision: https://reviews.llvm.org/D42736
llvm-svn: 324490
Momchil Velikov [Wed, 7 Feb 2018 16:46:33 +0000 (16:46 +0000)]
[DebugInfo] Improvements to representation of enumeration types (PR36168)
This patch is the LLVM part of fixing the issues, described in
https://bugs.llvm.org/show_bug.cgi?id=36168
* The representation of enumerator values in the debug info metadata now
contains a boolean flag isUnsigned, which determines how the bits of
the value are interpreted.
* The DW_TAG_enumeration type DIE now always (for DWARF version >= 3)
includes a DW_AT_type attribute, which refers to the underlying
integer type, as suggested in DWARFv4 (5.7 Enumeration Type Entries).
* The debug info metadata for enumeration type contains (in flags)
indication whether this is a C++11 "fixed enum".
* For C++11 enumeration with a fixed underlying type, the DIE also
includes the DW_AT_enum_class attribute (for DWARF version >= 4).
* Encoding of enumerator constants uses DW_FORM_sdata for signed values
and DW_FORM_udata for unsigned values, as suggested by DWARFv4 (7.5.4
Attribute Encodings).
The changes should be backwards compatible:
* the isUnsigned attribute is optional and defaults to false.
* if the underlying type for the enumeration is not available, the
enumerator values are considered signed.
* the FixedEnum flag defaults to clear.
* the bitcode format for DIEnumerator stores the unsigned flag bit #1 of
the first record element, so the format does not change and the zero
previously stored there is consistent with the false default for
IsUnsigned.
Differential Revision: https://reviews.llvm.org/D42734
llvm-svn: 324489
Jonas Devlieghere [Wed, 7 Feb 2018 16:10:59 +0000 (16:10 +0000)]
[test] Enable setting category for inline tests.
Inlined tests have a test function that is actually an instance method,
which requires a slightly different approach when it comes to setting
the category attribute. The attribute must be set on the actual
function, rather than on a particular instance.
llvm-svn: 324488
Marek Olsak [Wed, 7 Feb 2018 16:01:00 +0000 (16:01 +0000)]
AMDGPU: Add 32-bit constant address space
Note: This is a candidate for LLVM 6.0, because it was planned to be
in that release but was delayed due to a long review period.
Merge conflict in release_60 - resolution:
Add "-p6:32:32" into the second (non-amdgiz) string.
Only scalar loads support 32-bit pointers. An address in a VGPR will
fail to compile. That's OK because the results of loads will only be used
in places where VGPRs are forbidden.
Updated AMDGPUAliasAnalysis and used SReg_64_XEXEC.
The tests cover all uses cases we need for Mesa.
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D41651
llvm-svn: 324487
Marek Olsak [Wed, 7 Feb 2018 16:00:40 +0000 (16:00 +0000)]
AMDGPU: Remove the s_buffer workaround for GFX9 chips
Summary:
I checked the AMD closed source compiler and the workaround is only
needed when x3 is emulated as x4, which we don't do in LLVM.
SMEM x3 opcodes don't exist, and instead there is a possibility to use x4
with the last component being unused. If the last component is out of
buffer bounds and falls on the next 4K page, the hw hangs.
Reviewers: arsenm, nhaehnle
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D42756
llvm-svn: 324486
Simon Pilgrim [Wed, 7 Feb 2018 15:48:44 +0000 (15:48 +0000)]
[X86][AVX] Add PACKSSDW/PACKUSDW support for truncation of clamped values
SSE and shorter vector sizes will have to wait until we can add support for general SMIN/SMAX matching.
llvm-svn: 324485
Jonas Devlieghere [Wed, 7 Feb 2018 15:18:21 +0000 (15:18 +0000)]
[dsymutil][test] Check the updated dSYM instead of companion file.
This patch has llvm-dwarfdump check the whole dSYM, rather than the
hard-coded path to the Mach-O companion file. This might be what's
causing the Windows bot to fail.
llvm-svn: 324483
Clement Courbet [Wed, 7 Feb 2018 14:26:43 +0000 (14:26 +0000)]
[SLPVectorizer][NFC] Make a loop more readable.
llvm-svn: 324482
Kamil Rytarowski [Wed, 7 Feb 2018 14:05:57 +0000 (14:05 +0000)]
Correct a bug in GetArgsAndEnv() for NetBSD
Fix setting envp.
llvm-svn: 324481
Jonas Devlieghere [Wed, 7 Feb 2018 13:51:29 +0000 (13:51 +0000)]
[dsymutil] Upstream update feature.
Now that dsymutil can generate accelerator tables, we can upstream the
update logic that, as the name implies, updates the accelerator tables
in an existing dSYM bundle. In combination with `-minimize` this can be
used to remove redundant .debug_(inlines|pubtypes|pubnames).
Differential revision: https://reviews.llvm.org/D42880
llvm-svn: 324480
Simon Pilgrim [Wed, 7 Feb 2018 13:28:23 +0000 (13:28 +0000)]
[X86] Regenerate atomic i32 tests
llvm-svn: 324479
Benjamin Kramer [Wed, 7 Feb 2018 12:55:01 +0000 (12:55 +0000)]
[Orc] Pacify -pedantic.
llvm-svn: 324478
Simon Atanasyan [Wed, 7 Feb 2018 12:36:39 +0000 (12:36 +0000)]
[mips] Support 'y' operand code to print exact log2 of the operand
llvm-svn: 324477
Simon Atanasyan [Wed, 7 Feb 2018 12:36:33 +0000 (12:36 +0000)]
[mips] Handle 'M' and 'L' operand codes for memory operands
Both operand codes now work the same way in case of register or memory
operands. It print high-order or low-order word in a double-word
register or memory location.
llvm-svn: 324476
Eric Liu [Wed, 7 Feb 2018 12:12:06 +0000 (12:12 +0000)]
[clangd] Do not precent-encode numbers in URI.
Reviewers: ilya-biryukov
Subscribers: klimek, jkorous-apple, cfe-commits, sammccall
Differential Revision: https://reviews.llvm.org/D43009
llvm-svn: 324475
Pavel Labath [Wed, 7 Feb 2018 11:19:29 +0000 (11:19 +0000)]
[BinaryFormat] Remove dangling declaration of DiscriminantString
The implementation of the function was deleted in r324426. This also
removes the declaration.
llvm-svn: 324474
Max Kazantsev [Wed, 7 Feb 2018 11:16:29 +0000 (11:16 +0000)]
Re-enable "[SCEV] Make isLoopEntryGuardedByCond a bit smarter"
The failures happened because of assert which was overconfident about
SCEV's proving capabilities and is generally not valid.
Differential Revision: https://reviews.llvm.org/D42835
llvm-svn: 324473
Pavel Labath [Wed, 7 Feb 2018 11:13:21 +0000 (11:13 +0000)]
Remove function DW_DSC_value_to_name
It is unused, and the underlying llvm function has been removed as well.
llvm-svn: 324472
Jacek Olesiak [Wed, 7 Feb 2018 10:35:08 +0000 (10:35 +0000)]
[clang-format] Fix ObjC message arguments formatting.
Summary:
Fixes formatting of ObjC message arguments when inline block is a first
argument.
Having inline block as a first argument when method has multiple parameters is
discouraged by Apple:
"It’s best practice to use only one block argument to a method. If the
method also needs other non-block arguments, the block should come last"
(https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html#//apple_ref/doc/uid/TP40011210-CH8-SW7),
it should be correctly formatted nevertheless.
Current formatting:
```
[object blockArgument:^{
a = 42;
}
anotherArg:42];
```
Fixed (colon alignment):
```
[object
blockArgument:^{
a = 42;
}
anotherArg:42];
```
Test Plan: make -j12 FormatTests && tools/clang/unittests/Format/FormatTests
Reviewers: krasimir, benhamilton
Reviewed By: krasimir, benhamilton
Subscribers: benhamilton, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D42493
llvm-svn: 324469
Simon Atanasyan [Wed, 7 Feb 2018 10:14:22 +0000 (10:14 +0000)]
[ELF][MIPS] Mark the test as required MIPS target support. NFC
llvm-svn: 324468
Simon Atanasyan [Wed, 7 Feb 2018 10:02:49 +0000 (10:02 +0000)]
[ELF][MIPS] Ignore incorrect version definition index for _gp_disp symbol
MIPS BFD linker puts _gp_disp symbol into DSO files and assigns zero
version definition index to it. This value means 'unversioned local
symbol' while _gp_disp is a section global symbol. We have to handle
this bug in the LLD because BFD linker is used for building MIPS
toolchain libraries.
Differential revision: https://reviews.llvm.org/D42486
llvm-svn: 324467
Clement Courbet [Wed, 7 Feb 2018 09:58:55 +0000 (09:58 +0000)]
[MergeICmps] Re-commit rL324317 "Enable the MergeICmps Pass by default."
With fixes from rL324341.
Original commit message:
[MergeICmps] Enable the MergeICmps Pass by default.
Summary: Now that PR33325 is fixed, this should always improve the generated code.
Reviewers: spatel
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42793
llvm-svn: 324465
George Rimar [Wed, 7 Feb 2018 09:41:14 +0000 (09:41 +0000)]
[ELF] - Fix BB after r324463.
Test requires arm, but specified x86.
llvm-svn: 324464
George Rimar [Wed, 7 Feb 2018 09:11:07 +0000 (09:11 +0000)]
[ELF] - Remove unused synthetic sections correctly.
This is PR35740 which now crashes
because we remove unused synthetic sections incorrectly.
We can keep input section description and corresponding output
section live even if it must be empty and dead.
This results in a crash because SHF_LINK_ORDER handling code
tries to access first section which is nullptr in this case.
Patch fixes the issue.
Differential revision: https://reviews.llvm.org/D42681
llvm-svn: 324463
Serguei Katkov [Wed, 7 Feb 2018 09:10:08 +0000 (09:10 +0000)]
Revert [SCEV] Make isLoopEntryGuardedByCond a bit smarter
Revert rL324453 commit which causes buildbot failures.
Differential Revision: https://reviews.llvm.org/D42835
llvm-svn: 324462
George Rimar [Wed, 7 Feb 2018 09:00:34 +0000 (09:00 +0000)]
[ELF] - Make defsym to work correctly with reserved symbols.
Previously --defsym=foo2=etext+2 would produce incorrect value
for foo2 because expressions did not work correctly with
reserved symbols, section offset was calculated wrong for them.
Fixes PR35744.
Differential revision: https://reviews.llvm.org/D42911
llvm-svn: 324461
George Rimar [Wed, 7 Feb 2018 08:50:36 +0000 (08:50 +0000)]
[ELF] - Allow set CPU string with -plugin-opt=mcpu=<xxx>
Previously we ignored -plugin-opt=mcpu=<xxx>
and the only way to set CPU string was to pass
-mllvm -mcpu=<xxx>
Though clang may pass it with use of plugin options:
-plugin-opt=mcpu=x86-64
Since we are trying to be compatible in command line
with gold plugin, seems we should support it too.
Differential revision: https://reviews.llvm.org/D42956
llvm-svn: 324459
George Rimar [Wed, 7 Feb 2018 08:46:36 +0000 (08:46 +0000)]
Revert r324455 "[ThinLTO] - Simplify code in ThinLTOBitcodeWriter."
It broke BB:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/23721
llvm-svn: 324458
George Rimar [Wed, 7 Feb 2018 08:43:19 +0000 (08:43 +0000)]
[ELF] - Add testcase for -debugger-tune=<value>
In D42733 we supported different LTO command line
options, including -debugger-tune=<value>.
Initially debugger-tune support was needed to fix PR36035.
Patch adds testcase for this option to check we
don't simply ignore it.
Differential revision: https://reviews.llvm.org/D42961
llvm-svn: 324457
Sjoerd Meijer [Wed, 7 Feb 2018 08:37:17 +0000 (08:37 +0000)]
[ARM] FP16 mov imm pattern
This is a follow up of r324321, adding a match pattern for mov with a FP16
immediate (also fixing operand vfp_f16imm that wasn't even compiling).
Differential Revision: https://reviews.llvm.org/D42973
llvm-svn: 324456
George Rimar [Wed, 7 Feb 2018 08:32:35 +0000 (08:32 +0000)]
[ThinLTO] - Simplify code in ThinLTOBitcodeWriter.
Recently introduced convertToDeclaration is very similar
to code used in filterModule function.
Patch reuses it to reduce duplication.
Differential revision: https://reviews.llvm.org/D42971
llvm-svn: 324455
Petr Hosek [Wed, 7 Feb 2018 08:22:58 +0000 (08:22 +0000)]
[Fuzzer] Use Zircon's public API on Fuchsia
The original libFuzzer Fuchsia port relied on convenience libraries,
but these are not exported as part of Fuchsia sysroot. This change
eliminates the use of these libraries and relies on public API only.
Differential Revision: https://reviews.llvm.org/D42996
llvm-svn: 324454
Max Kazantsev [Wed, 7 Feb 2018 07:56:26 +0000 (07:56 +0000)]
[SCEV] Make isLoopEntryGuardedByCond a bit smarter
Sometimes `isLoopEntryGuardedByCond` cannot prove predicate `a > b` directly.
But it is a common situation when `a >= b` is known from ranges and `a != b` is
known from a dominating condition. Thia patch teaches SCEV to sum these facts
together and prove strict comparison via non-strict one.
Differential Revision: https://reviews.llvm.org/D42835
llvm-svn: 324453
Michael Zolotukhin [Wed, 7 Feb 2018 06:54:11 +0000 (06:54 +0000)]
The xfailed test from r324448 passed on one of the bots: remove it entirely for now.
llvm-svn: 324451
Serguei Katkov [Wed, 7 Feb 2018 06:53:37 +0000 (06:53 +0000)]
[LoopPrediction] Introduce utility function getLatchPredicateForGuard. NFC.
Factor out getting the predicate for latch condition in a guard to
utility function getLatchPredicateForGuard.
llvm-svn: 324450
Chandler Carruth [Wed, 7 Feb 2018 06:16:24 +0000 (06:16 +0000)]
[x86/retpoline] Make the external thunk names exactly match the names
that happened to end up in GCC.
This is really unfortunate, as the names don't have much rhyme or reason
to them. Originally in the discussions it seemed fine to rely on aliases
to map different names to whatever external thunk code developers wished
to use but there are practical problems with that in the kernel it turns
out. And since we're discovering this practical problems late and since
GCC has already shipped a release with one set of names, we are forced,
yet again, to blindly match what is there.
Somewhat rushing this patch out for the Linux kernel folks to test and
so we can get it patched into our releases.
Differential Revision: https://reviews.llvm.org/D42998
llvm-svn: 324449
Michael Zolotukhin [Wed, 7 Feb 2018 06:11:50 +0000 (06:11 +0000)]
Xfail the test added in r324445 until the underlying issue in LoopSink is fixed.
llvm-svn: 324448