Florian Hahn [Mon, 30 Oct 2017 10:07:42 +0000 (10:07 +0000)]
Recommit r315288: [SCCP] Propagate integer range info for parameters in IPSCCP.
This version of the patch includes a fix addressing a stage2 LTO buildbot
failure and addressed some additional nits.
Original commit message:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.
For the following function, f() can be optimized to ret i32 2 with
this change
source_filename = "sccp.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call fastcc i32 @f(i32 1)
%call1 = tail call fastcc i32 @f(i32 47)
%add3 = add nsw i32 %call, %call1
ret i32 %add3
}
; Function Attrs: noinline norecurse nounwind readnone uwtable
define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
entry:
%c1 = icmp sle i32 %x, 100
%cmp = icmp sgt i32 %x, 300
%. = select i1 %cmp, i32 1, i32 2
ret i32 %.
}
attributes #1 = { noinline }
Reviewers: davide, sanjoy, efriedma, dberlin
Reviewed By: davide, dberlin
Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D36656
llvm-svn: 316891
Jina Nahias [Mon, 30 Oct 2017 09:59:52 +0000 (09:59 +0000)]
[X86][AVX512] Adding a pattern for broadcastm intrinsic.
Differential Revision: https://reviews.llvm.org/D38312
Change-Id: I6551fb13879e098aed74de410e29815cf37d9ab5
llvm-svn: 316890
Max Kazantsev [Mon, 30 Oct 2017 09:35:16 +0000 (09:35 +0000)]
[IRCE][NFC] Store Length as SCEV in RangeCheck instead of Value
llvm-svn: 316889
Florian Hahn [Mon, 30 Oct 2017 09:21:50 +0000 (09:21 +0000)]
Revert r316887 to fix buildbot failures.
llvm-svn: 316888
Florian Hahn [Mon, 30 Oct 2017 09:04:18 +0000 (09:04 +0000)]
Recommit r315288: [SCCP] Propagate integer range info for parameters in IPSCCP.
This version of the patch includes a fix addressing a stage2 LTO buildbot
failure and addressed some additional nits.
Original commit message:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.
For the following function, f() can be optimized to ret i32 2 with
this change
source_filename = "sccp.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse nounwind readnone uwtable
define i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call fastcc i32 @f(i32 1)
%call1 = tail call fastcc i32 @f(i32 47)
%add3 = add nsw i32 %call, %call1
ret i32 %add3
}
; Function Attrs: noinline norecurse nounwind readnone uwtable
define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
entry:
%c1 = icmp sle i32 %x, 100
%cmp = icmp sgt i32 %x, 300
%. = select i1 %cmp, i32 1, i32 2
ret i32 %.
}
attributes #1 = { noinline }
Reviewers: davide, sanjoy, efriedma, dberlin
Reviewed By: davide, dberlin
Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D36656
llvm-svn: 316887
Gabor Horvath [Mon, 30 Oct 2017 09:01:48 +0000 (09:01 +0000)]
Add missing expected-no-diagnostics comment to test.
llvm-svn: 316886
Gabor Horvath [Mon, 30 Oct 2017 08:47:13 +0000 (08:47 +0000)]
[analyzer] Handle ObjC messages conservatively in CallDescription
Differential Revision: https://reviews.llvm.org/D37470
llvm-svn: 316885
Max Kazantsev [Mon, 30 Oct 2017 04:48:34 +0000 (04:48 +0000)]
[GVN][NFC] Mark instruction for deletion instead of immediate erasing in LoadPRE
It is done to uniformly handle instructions removal.
Differential Revision: https://reviews.llvm.org/D39369
llvm-svn: 316884
Craig Topper [Mon, 30 Oct 2017 04:39:18 +0000 (04:39 +0000)]
[X86] Rearrange code in X86InstrInfo.cpp to put all the foldMemoryOperandImpl methods together without partial/undef register handling in the middle. NFC
I have a future patch that wants to make use of the one of the partial functions in one of the earlier memory folding methods and the current ordering prevents that.
llvm-svn: 316883
Craig Topper [Mon, 30 Oct 2017 03:35:44 +0000 (03:35 +0000)]
[X86] Simplify code by removing an unnecessary temporary variable. NFC
llvm-svn: 316882
Craig Topper [Mon, 30 Oct 2017 03:35:43 +0000 (03:35 +0000)]
[X86] Move some EVEX->VEX code to a helper function to prepare for a future patch. NFC
llvm-svn: 316881
Rui Ueyama [Sun, 29 Oct 2017 23:41:16 +0000 (23:41 +0000)]
Remove unnecessary code.
Discarded section's Repl always points to itself, so returning
Sec is not different from returning Sec->Repl.
llvm-svn: 316880
Rui Ueyama [Sun, 29 Oct 2017 23:32:23 +0000 (23:32 +0000)]
Move "Assigned" bit from SectionBase to InputSectionBase.
This bit is to manage whether an input section has already been assigned
to some output section by linker scripts or not. So it logically belongs
to InputSectionBase. SectionBase is a common base class for input and
output sections, so that wasn't the right place to define the bit.
llvm-svn: 316879
Rui Ueyama [Sun, 29 Oct 2017 22:38:00 +0000 (22:38 +0000)]
Remove an obscure comment.
llvm-svn: 316878
Peter Collingbourne [Sun, 29 Oct 2017 22:31:48 +0000 (22:31 +0000)]
ELF: Correctly set edata if there are no .bss sections.
edata needs to be set to the end of the last mapped initialized
section. We were previously mishandling the case where there were no
non-mapped sections by setting it to the end of the last section in
the output file.
Differential Revision: https://reviews.llvm.org/D39399
llvm-svn: 316877
Rui Ueyama [Sun, 29 Oct 2017 22:26:52 +0000 (22:26 +0000)]
Initialize members not by assignment but by the member initializer list.
llvm-svn: 316876
Simon Pilgrim [Sun, 29 Oct 2017 22:03:37 +0000 (22:03 +0000)]
[SelectionDAG] Add SEXT/AND/XOR/Or demanded elts support to ComputeNumSignBits
llvm-svn: 316875
Marshall Clow [Sun, 29 Oct 2017 21:57:58 +0000 (21:57 +0000)]
Initial triage
llvm-svn: 316874
Marshall Clow [Sun, 29 Oct 2017 21:43:30 +0000 (21:43 +0000)]
Update status of 2950
llvm-svn: 316873
Philip Pfaffe [Sun, 29 Oct 2017 21:36:34 +0000 (21:36 +0000)]
[Acc] Do not statically dispatch into IslNodeBuilder's createFor
Summary:
When GPUNodeBuilder creates loops inside the kernel, it dispatches to
IslNodeBuilder. This however is surprisingly dangerous, since it accesses the
AST Node's user through the wrong type. This patch fixes this problem by
overriding createFor correctly.
This fixes PR35010.
Reviewers: grosser, bollu, Meinersbur
Reviewed By: Meinersbur
Subscribers: Meinersbur, nemanjai, pollydev, llvm-commits, kbarton
Differential Revision: https://reviews.llvm.org/D39364
llvm-svn: 316872
Simon Pilgrim [Sun, 29 Oct 2017 21:35:28 +0000 (21:35 +0000)]
[X86][SSE] Split ComputeNumSignBits SEXT/AND/XOR/OR demandedelts test
Max depth was being exceeded which could prevent some combines working
llvm-svn: 316871
Philip Pfaffe [Sun, 29 Oct 2017 21:00:48 +0000 (21:00 +0000)]
Fix two testcases. NFC intended.
Add missing %loadPolly directive to support out of tree builds. One of
the changes is somewhat bigger, because the directive turns on LLVM
names, and the testcase deosn't use those.
llvm-svn: 316870
Sanjay Patel [Sun, 29 Oct 2017 20:49:31 +0000 (20:49 +0000)]
[(new) Pass Manager] instantiate SimplifyCFG with the same options as the old PM
The old PM sets the options of what used to be known as "latesimplifycfg" on the
instantiation after the vectorizers have run, so that's what we'redoing here.
FWIW, there's a later SimplifyCFGPass instantiation in both PMs where we do not
set the "late" options. I'm not sure if that's intentional or not.
Differential Revision: https://reviews.llvm.org/D39407
llvm-svn: 316869
Simon Pilgrim [Sun, 29 Oct 2017 20:49:27 +0000 (20:49 +0000)]
[X86][SSE] ComputeNumSignBits tests showing missing SEXT/AND/XOR/OR demandedelts support
llvm-svn: 316868
Marshall Clow [Sun, 29 Oct 2017 19:02:00 +0000 (19:02 +0000)]
Issues to be voted on in ABQ
llvm-svn: 316867
Simon Pilgrim [Sun, 29 Oct 2017 18:19:37 +0000 (18:19 +0000)]
[SelectionDAG] Add SRA/SHL demanded elts support to ComputeNumSignBits
Introduce a isConstOrDemandedConstSplat helper function that can recognise a constant splat build vector for at least the demanded elts we care about.
llvm-svn: 316866
Simon Pilgrim [Sun, 29 Oct 2017 18:01:31 +0000 (18:01 +0000)]
[X86][SSE] ComputeNumSignBits tests showing missing SHL/SRA demandedelts support
llvm-svn: 316865
Craig Topper [Sun, 29 Oct 2017 17:15:09 +0000 (17:15 +0000)]
[X86] Add a slow-incdec command line to atomic-eflags-reuse.ll
I believe the test_sub_1_cmp_1_setcc_ugt test case is being miscompiled in the fast inc/dec case.
llvm-svn: 316864
Rui Ueyama [Sun, 29 Oct 2017 16:49:42 +0000 (16:49 +0000)]
Fix ubsan error that shift amount 64 is too large.
llvm-svn: 316863
Rui Ueyama [Sun, 29 Oct 2017 16:46:39 +0000 (16:46 +0000)]
Remove a redundant temporary variable.
llvm-svn: 316862
Craig Topper [Sun, 29 Oct 2017 06:51:04 +0000 (06:51 +0000)]
[X86] Remove combine that turns X86ISD::LSUB into X86ISD::LADD. Update patterns that depended on this.
If the carry flag is being used, this transformation isn't safe.
This does prevent some test cases from using DEC now, but I'll try to look into that separately.
Fixes PR35068.
llvm-svn: 316860
Craig Topper [Sun, 29 Oct 2017 06:51:02 +0000 (06:51 +0000)]
[X86] Fix typo in comment. NFC
llvm-svn: 316859
Saleem Abdulrasool [Sun, 29 Oct 2017 06:01:14 +0000 (06:01 +0000)]
Driver: default to `unsigned int` `wchar_t` for ARM
AAPCS and AAPCS64 mandate that `wchar_t` with `-fno-short-wchar` is an
`unsigned int` rather than a `signed int`. Ensure that the driver does
not flip the signedness of `wchar_t` for those targets.
Add additional tests to ensure that this does not regress.
llvm-svn: 316858
Craig Topper [Sun, 29 Oct 2017 05:14:26 +0000 (05:14 +0000)]
[X86] Use the extended vector register classes in fast isel with AVX512F/VL.
llvm-svn: 316857
Craig Topper [Sun, 29 Oct 2017 02:50:31 +0000 (02:50 +0000)]
[X86] Add AVX512 support to X86FastISel::X86SelectFPExt and X86FastISel::X86SelectFPTrunc.
llvm-svn: 316856
Craig Topper [Sun, 29 Oct 2017 02:25:48 +0000 (02:25 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-int-float-conversion.ll
llvm-svn: 316855
Craig Topper [Sun, 29 Oct 2017 02:18:43 +0000 (02:18 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-fptrunc-fpext.ll
llvm-svn: 316854
Craig Topper [Sun, 29 Oct 2017 02:18:41 +0000 (02:18 +0000)]
[X86] Add AVX512 support to X86FastISel::X86MaterializeFP
llvm-svn: 316853
Peter Szecsi [Sat, 28 Oct 2017 23:24:00 +0000 (23:24 +0000)]
[analyzer] MisusedMovedObjectChecker: More precise warning message
Added new enum in order to differentiate the warning messages on "misusing" into
3 categories: function calls, moving an object, copying an object. (At the
moment the checker gives the same message in case of copying and moving.)
Additional test cases added as well.
Differential Revision: https://reviews.llvm.org/D38674
llvm-svn: 316852
Craig Topper [Sat, 28 Oct 2017 23:10:13 +0000 (23:10 +0000)]
[X86] Remove invalid code from LowerVSELECT.
This code attempted to say that v8i16/v16i16 VSELECT is legal if BWI and VLX are enabled, but the only way we could reach this point is if the condition was not a vXi1 type. Which means it really wasn't legal.
We don't have any tests that exercise this code. So I'm hoping it wasn't really reachable.
llvm-svn: 316851
Peter Szecsi [Sat, 28 Oct 2017 23:09:37 +0000 (23:09 +0000)]
[analyzer] MisusedMovedObjectChecker: Fix false positive on state-resetting, handling method calls on base-class sub-objects
An earlier solution from Artem r315301 solves the reset problem, however, the
reports should be handled the same way in case of method calls. We should not
just report the base class of the object where the method was defined but the
whole object.
Fixed false positive which came from not removing the subobjects in case of a
state-resetting function. (Just replaced the State->remove(...) call to
removeFromState(..) which was defined exactly for that purpose.)
Some minor typos fixed in this patch as well which did not worth a whole new
patch in my opinion, so included them here.
Differential Revision: https://reviews.llvm.org/D31538
llvm-svn: 316850
Rui Ueyama [Sat, 28 Oct 2017 22:18:29 +0000 (22:18 +0000)]
Fix ubsan error.
This patch fixes ubsan's "shift exponent 64 is too large for 32-bit type
'int'" error.
llvm-svn: 316849
Rui Ueyama [Sat, 28 Oct 2017 22:18:17 +0000 (22:18 +0000)]
Reduce sizeof(Symbol) from 104 bytes to 88 bytes.
Finding aliases for shared symbols doesn't need st_shndx because
we can just compare st_value.
llvm-svn: 316848
Simon Pilgrim [Sat, 28 Oct 2017 22:10:40 +0000 (22:10 +0000)]
[SelectionDAG] Add support for INSERT_SUBVECTOR to computeKnownBits
llvm-svn: 316847
Rui Ueyama [Sat, 28 Oct 2017 21:11:38 +0000 (21:11 +0000)]
Do not handle DefinedCommon symbols in the MapFile writer.
Because of r314495 which converts DefinedCommon symbols to DefinedRegular
symbols, common symbols are no longer reachable to the MapFile writer.
So the code to handle common symbols is now dead.
llvm-svn: 316846
Simon Pilgrim [Sat, 28 Oct 2017 20:51:27 +0000 (20:51 +0000)]
[X86][SSE] Combine 128-bit target shuffles to PACKSS/PACKUS.
llvm-svn: 316845
Simon Pilgrim [Sat, 28 Oct 2017 20:27:22 +0000 (20:27 +0000)]
[X86][SSE] Split off matchVectorShuffleWithPACK. NFCI.
Split matchVectorShuffleWithPACK from lowerVectorShuffleWithPACK so that we can reuse it for target shuffle combines
llvm-svn: 316844
Martin Storsjo [Sat, 28 Oct 2017 20:19:49 +0000 (20:19 +0000)]
Restore arch specific lastDwarfRegNum in builds without _LIBUNWIND_IS_NATIVE_ONLY
This restores the previous behaviour of the Registers_* classes
after SVN r316745.
Differential Revision: https://reviews.llvm.org/D39382
llvm-svn: 316843
Rui Ueyama [Sat, 28 Oct 2017 20:16:11 +0000 (20:16 +0000)]
Rename V -> Ver for readability.
llvm-svn: 316842
Rui Ueyama [Sat, 28 Oct 2017 20:15:56 +0000 (20:15 +0000)]
Pass symbol attributes instead of ElfSym to Shared symbol ctor.
This change allows us to use less templates for Shared symbol and
the functions that deals with shared symbols.
llvm-svn: 316841
Craig Topper [Sat, 28 Oct 2017 19:56:57 +0000 (19:56 +0000)]
[X86] Fix a mistake in the X86ISelDAGToDAG.cpp code for MUL8r/IMUL8r.
I think this code is unreachable due to some promotions that occur elsewhere. I'll look into that to be sure, but for now I thought I should at least fix the obvious typo.
llvm-svn: 316840
Craig Topper [Sat, 28 Oct 2017 19:56:56 +0000 (19:56 +0000)]
[X86] Replace some default cases in X86SelectShift with llvm_unreachable.
llvm-svn: 316839
Saleem Abdulrasool [Sat, 28 Oct 2017 19:15:05 +0000 (19:15 +0000)]
ADT: add a helper to check if the Triple is ARM64
Add a trivial helper for checking if the architecture is AArch64 Little
Endian or Big Endian.
llvm-svn: 316837
Richard Smith [Sat, 28 Oct 2017 18:59:51 +0000 (18:59 +0000)]
PR35039: Materialize temporary objects before wrapping them in an
OpaqueValueExpr in a GNU binary conditional expression.
It's not meaningful for a non-materialized temporary object to be used as a
common subexpression of multiple expressions.
llvm-svn: 316836
Sanjay Patel [Sat, 28 Oct 2017 18:43:07 +0000 (18:43 +0000)]
[SimplifyCFG] use pass options and remove the latesimplifycfg pass
This is no-functional-change-intended.
This is repackaging the functionality of D30333 (defer switch-to-lookup-tables) and
D35411 (defer folding unconditional branches) with pass parameters rather than a named
"latesimplifycfg" pass. Now that we have individual options to control the functionality,
we could decouple when these fire (but that's an independent patch if desired).
The next planned step would be to add another option bit to disable the sinking transform
mentioned in D38566. This should also make it clear that the new pass manager needs to
be updated to limit simplifycfg in the same way as the old pass manager.
Differential Revision: https://reviews.llvm.org/D38631
llvm-svn: 316835
Simon Pilgrim [Sat, 28 Oct 2017 17:59:56 +0000 (17:59 +0000)]
[X86][SSE] Rename truncateVectorCompareWithPACKSS to truncateVectorWithPACKSS. NFC.
We no longer rely on the vector source being a comparison result, just have sufficient sign bits.
llvm-svn: 316834
Craig Topper [Sat, 28 Oct 2017 17:37:51 +0000 (17:37 +0000)]
[X86] Correct the alignments on the aligned test cases in fast-isel-vecload.ll to make sure they test selection of aligned loads.
llvm-svn: 316833
Benjamin Kramer [Sat, 28 Oct 2017 17:32:56 +0000 (17:32 +0000)]
[clangd] Fix clang-tidy warnings.
No functionality change intended.
llvm-svn: 316832
Simon Pilgrim [Sat, 28 Oct 2017 14:27:53 +0000 (14:27 +0000)]
[SelectionDAG] Support 'bit preserving' floating points bitcasts on computeKnownBits/ComputeNumSignBits
For cases where we know the floating point representations match the bitcasted integer equivalent, allow bitcasting to these types.
This is especially useful for the X86 floating point compare results which return all/zero bits but as a floating point type.
Differential Revision: https://reviews.llvm.org/D39289
llvm-svn: 316831
Peter Szecsi [Sat, 28 Oct 2017 12:19:08 +0000 (12:19 +0000)]
[analyzer] LoopUnrolling: check the bitwidth of the used numbers (pr34943)
The loop unrolling feature aims to track the maximum possible steps a loop can
make. In order to implement this, it investigates the initial value of the
counter variable and the bound number. (It has to be known.)
These numbers are used as llvm::APInts, however, it was not checked if their
bitwidths are the same which lead to some crashes.
This revision solves this problem by extending the "shorter" one (to the length
of the "longer" one).
For the detailed bug report, see: https://bugs.llvm.org/show_bug.cgi?id=34943
Differential Revision: https://reviews.llvm.org/D38922
llvm-svn: 316830
Craig Topper [Sat, 28 Oct 2017 06:31:48 +0000 (06:31 +0000)]
[X86] Add avx command lines to fast-isel-constpool.ll to improve coverage.
llvm-svn: 316829
Craig Topper [Sat, 28 Oct 2017 06:31:46 +0000 (06:31 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-constpool.ll
llvm-svn: 316828
Craig Topper [Sat, 28 Oct 2017 06:10:03 +0000 (06:10 +0000)]
[X86] Add a fast-isel test for the i8 pseudo cmov.
llvm-svn: 316827
Saleem Abdulrasool [Sat, 28 Oct 2017 06:00:43 +0000 (06:00 +0000)]
Basic: improve coverage for Darwin targets and fix ABI
The existing coverage for the Darwin targets wasn't enough to catch all
the variations. Improve the coverage a bit further and fix a few cases
for Darwin targets.
llvm-svn: 316826
Craig Topper [Sat, 28 Oct 2017 05:52:23 +0000 (05:52 +0000)]
[X86] Remove unneeded MVT::i1 related code from fast isel.
llvm-svn: 316825
Haicheng Wu [Sat, 28 Oct 2017 02:27:14 +0000 (02:27 +0000)]
[ConstantFold] Fix a crash when folding a GEP that has vector index
LLVM crashes when factoring out an out-of-bound index into preceding dimension
and the preceding dimension uses vector index. Simply bail out now when this
case happens.
Differential Revision: https://reviews.llvm.org/D38677
llvm-svn: 316824
Craig Topper [Sat, 28 Oct 2017 02:03:59 +0000 (02:03 +0000)]
[X86] Add avx command lines to two fast-isel tests to get coverage of selecting vucomiss/vucomisd.
The selection of these shows up as a code coverage hole when looking at the llvm-cov link on llvm.org
llvm-svn: 316823
Craig Topper [Sat, 28 Oct 2017 02:03:58 +0000 (02:03 +0000)]
[X86] Use update_llc_test_checks.py to regenerate fast-isel-select-cmov2.ll
llvm-svn: 316822
Martin Pelikan [Sat, 28 Oct 2017 01:35:07 +0000 (01:35 +0000)]
[XRay] [compiler-rt] fix build by including errno.h into FDR mode
The build got broken after D39277 (and rL316816) deleted <cerrno>.
llvm-svn: 316821
Richard Smith [Sat, 28 Oct 2017 01:15:00 +0000 (01:15 +0000)]
Never try to instantiate a deduction guide's "definition". Fixes bogus warning when there inevitably isn't one.
llvm-svn: 316820
Craig Topper [Sat, 28 Oct 2017 00:36:58 +0000 (00:36 +0000)]
[PartialInlineLibCalls] Teach PartialInlineLibCalls to honor nobuiltin, properly check the function signature, and check TLI::has
Summary:
We shouldn't do this transformation if the function is marked nobuitlin.
We were only checking that the return type is floating point, we really should be checking the argument types and argument count as well. This can be accomplished by using the other version of getLibFunc that takes the Function and not just the name.
We should also be checking TLI::has since sqrtf is a macro on Windows.
Fixes PR32559.
Reviewers: hfinkel, spatel, davide, efriedma
Reviewed By: davide, efriedma
Subscribers: efriedma, llvm-commits, eraman
Differential Revision: https://reviews.llvm.org/D39381
llvm-svn: 316819
Eugene Zelenko [Sat, 28 Oct 2017 00:24:26 +0000 (00:24 +0000)]
[ADT] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 316818
Rui Ueyama [Sat, 28 Oct 2017 00:05:12 +0000 (00:05 +0000)]
Simplify error handling.
I don't think we have to aim for precise bug compatibility.
We can return a nullptr if a section is consumed by the linker, and
the rest should naturally work.
llvm-svn: 316817
Dean Michael Berris [Fri, 27 Oct 2017 23:59:41 +0000 (23:59 +0000)]
[XRay][compiler-rt] Remove more STL dependenices from FDR mode
Summary:
This change removes dependencies on STL types:
- std::aligned_storage -- we're using manually-aligned character
buffers instead for metadata and function records.
- std::tuple -- use a plain old struct instead.
This is an incremental step in removing all STL references from the
compiler-rt implementation of XRay (llvm.org/PR32274).
Reviewers: dblaikie, pelikan, kpw
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39277
llvm-svn: 316816
Tom Stellard [Fri, 27 Oct 2017 23:57:41 +0000 (23:57 +0000)]
AMDGPU/GlobalISel: Mark 32-bit G_FADD as legal
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D38439
llvm-svn: 316815
Bob Haarman [Fri, 27 Oct 2017 23:41:17 +0000 (23:41 +0000)]
[support] remove tautological comparison in Support/Windows/Path.inc
Summary:
The removed code checks that we are able to handle a 64-bit number, but
the code we're calling takes two dwords (for a total of 64 bits), so this
is always true.
Reviewers: zturner, rnk, majnemer, compnerd
Reviewed By: zturner
Subscribers: amccarth, hiraditya, lebedev.ri, llvm-commits
Differential Revision: https://reviews.llvm.org/D39263
llvm-svn: 316814
Jake Ehrlich [Fri, 27 Oct 2017 23:39:31 +0000 (23:39 +0000)]
Revert "Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit"
This reverts commit r316805.
llvm-svn: 316813
Rui Ueyama [Fri, 27 Oct 2017 23:29:58 +0000 (23:29 +0000)]
Remove unnecessary namespace specifiers.
llvm-svn: 316812
Rui Ueyama [Fri, 27 Oct 2017 23:26:46 +0000 (23:26 +0000)]
Inline trivial symbol constructors.
llvm-svn: 316811
Saleem Abdulrasool [Fri, 27 Oct 2017 23:04:27 +0000 (23:04 +0000)]
ARM: centralise SizeType, PtrDiffType, and IntPtrType
Centralise the definitions of these compiler vended types to aid
inspection to ensure that they are defined similarly. The one case that
stands out is the Darwin case where the types do not match up. This
fixes the API conformance for APCS-GNU as well.
llvm-svn: 316810
Rui Ueyama [Fri, 27 Oct 2017 22:54:16 +0000 (22:54 +0000)]
Rename isInCurrentDSO -> isInCurrentOutput.
DSO is short for dynamic shared object, so the function name was a
little confusing because it sounded like it didn't work when we were
a creating statically-linked executable or something.
What we mean by "DSO" here is the current output file that we are
creating. Thus the new name. Alternatively, we could call it the current
ELF module, but "module" is a overloaded word, so I avoided that.
llvm-svn: 316809
George Karpenkov [Fri, 27 Oct 2017 22:52:36 +0000 (22:52 +0000)]
[Analyzer] [Tests] Fixing typo from the previous commit.
Can not open a non-existent file with r+.
llvm-svn: 316808
Reid Kleckner [Fri, 27 Oct 2017 22:48:41 +0000 (22:48 +0000)]
[MS] Allow access to ambiguous, inaccessible direct bases
Summary:
Clang typically warns that in the following class hierarchy, 'A' is
inaccessible because there is no series of casts that the user can
write to access it unambiguously:
struct A { };
struct B : A { };
struct C : A, B { };
MSVC allows the user to convert from C* to A*, though, and we've
encountered this issue in the latest Windows SDK headers.
This patch allows this conversion when -fms-compatibility is set and
adds a warning for it under -Wmicrosoft-inaccessible-base.
Reviewers: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D39389
llvm-svn: 316807
George Karpenkov [Fri, 27 Oct 2017 22:39:54 +0000 (22:39 +0000)]
[Analyzer] [Tests] Dump the output of scan-build to stdout on failure.
Eliminates extra lookup step during debugging.
llvm-svn: 316806
Jake Ehrlich [Fri, 27 Oct 2017 22:26:37 +0000 (22:26 +0000)]
Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit
This should fix https://bugs.llvm.org//show_bug.cgi?id=34189
This change makes it so that if writing a K_GNU style archive, you need
to output a > 32-bit offset it should output in K_GNU64 style instead.
Differential Revision: https://reviews.llvm.org/D36812
llvm-svn: 316805
Krzysztof Parzyszek [Fri, 27 Oct 2017 22:24:49 +0000 (22:24 +0000)]
[Hexagon] Adjust patterns to reflect instruction selection preferences
llvm-svn: 316804
David Blaikie [Fri, 27 Oct 2017 22:12:46 +0000 (22:12 +0000)]
Add a few missing headers for modularization/IWYU/etc
Several cases where class definitions are required for DenseMap pointer
traits handling.
llvm-svn: 316803
Guozhi Wei [Fri, 27 Oct 2017 21:54:24 +0000 (21:54 +0000)]
[DAGCombine] Don't combine sext with extload if sextload is not supported and extload has multi users
In function DAGCombiner::visitSIGN_EXTEND_INREG, sext can be combined with extload even if sextload is not supported by target, then
if sext is the only user of extload, there is no big difference, no harm no benefit.
if extload has more than one user, the combined sextload may block extload from combining with other zext, causes extra zext instructions generated. As demonstrated by the attached test case.
This patch add the constraint that when sextload is not supported by target, sext can only be combined with extload if it is the only user of extload.
Differential Revision: https://reviews.llvm.org/D39108
llvm-svn: 316802
Jake Ehrlich [Fri, 27 Oct 2017 21:47:38 +0000 (21:47 +0000)]
Make 32-bit member offset in Archive::Symbol::getMember 64-bit
When accessing a member for a symbol with an offset greater than 2^32 -
1 the current Archive::Symbol::getMember implementation will overflow
and cause unexpected behavior. This change simply fixes that. In
particular if you call "llvm-nm --print-armap" on an archive that has
this behavior you'll get an error.
Differential Revision: https://reviews.llvm.org/D39379
llvm-svn: 316801
Davide Italiano [Fri, 27 Oct 2017 21:22:57 +0000 (21:22 +0000)]
[CMake] Build clang as dependency when using in-tree clang for tests.
Discussed with Zachary Turner and Pavel Labath on lldb-dev.
Let's hope this doesn't break anything :)
llvm-svn: 316800
Rafael Espindola [Fri, 27 Oct 2017 21:18:48 +0000 (21:18 +0000)]
Handle undefined weak hidden symbols on all architectures.
We were handling the non-hidden case in lib/Target/TargetMachine.cpp,
but the hidden case was handled in architecture dependent code and
only X86_64 and AArch64 were covered.
While it is true that some code sequences in some ABIs might be able
to produce the correct value at runtime, that doesn't seem to be the
common case.
I left the AArch64 code in place since it also forces a got access for
non-pic code. It is not clear if that is needed, but it is probably
better to change that in another commit.
llvm-svn: 316799
Zachary Turner [Fri, 27 Oct 2017 21:12:28 +0000 (21:12 +0000)]
Force #define GTEST_LANG_CXX11.
gtest depends on this #define to determine whether it can
use various classes like std::tuple, or whether it has to fall
back to experimental classes in the std::tr1 namespace. The
check in the current version of gtest relies on the value of
the `__cplusplus` macro, but MSVC provides a non-conformant
value of this macro, making it effectively impossible to detect
C++11. In short, LLVM compiled with MSVC has been silently
using the tr1 versions of several classes since the beginning of
time.
This would normally be pretty benign, except that in the latest
preview of MSVC they have marked all of the tr1 classes
deprecated, so it spews thousands of warnings.
llvm-svn: 316798
Craig Topper [Fri, 27 Oct 2017 21:00:59 +0000 (21:00 +0000)]
[X86] Remove fast-isel code for handling i8 shifts. This is handled by auto generated code.
llvm-svn: 316797
Craig Topper [Fri, 27 Oct 2017 21:00:56 +0000 (21:00 +0000)]
[X86] Add fast-isel tests for integer shifts. We definitely had no coverage of i16 and i32/i64 are only tested by larger tests.
llvm-svn: 316796
Artur Gainullin [Fri, 27 Oct 2017 20:53:41 +0000 (20:53 +0000)]
Improve clamp recognition in ValueTracking.
Summary:
ValueTracking was recognizing not all variations of clamp. Swapping of
true value and false value of select was added to fix this problem. The
first patch was reverted because it caused miscompile in NVPTX target.
Added corresponding test cases.
Reviewers: spatel, majnemer, efriedma, reames
Subscribers: llvm-commits, jholewinski
Differential Revision: https://reviews.llvm.org/D39240
llvm-svn: 316795
David Blaikie [Fri, 27 Oct 2017 20:40:46 +0000 (20:40 +0000)]
StaticAnalyzer: Modularize/fix ODR violations making functions inline but non-static in headers
Also move these out of the llvm namespace & rely on ADL as is
appropriate for these op<< overloads.
llvm-svn: 316794
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
Sanitizers.h: Modularize/Fix ODR violations by making inline functions non-static
llvm-svn: 316793
David Blaikie [Fri, 27 Oct 2017 20:40:45 +0000 (20:40 +0000)]
CharInfo.h: Modularize/fix ODR violations by making inline functions in header not static
llvm-svn: 316792
David Blaikie [Fri, 27 Oct 2017 20:40:44 +0000 (20:40 +0000)]
ASTContext.h: Modularize/fix ODR violations by removing 'static' from inline functions in headers
llvm-svn: 316791
Craig Topper [Fri, 27 Oct 2017 20:13:10 +0000 (20:13 +0000)]
[X86] Teach fastisel to use VLX VMOVNTDQA for v4f64 and 256-bit integers when available.
This looks to have been missed from r280682.
llvm-svn: 316790