OSDN Git Service
Simon Pilgrim [Mon, 5 Jun 2017 16:02:01 +0000 (16:02 +0000)]
[X86][AVX1] Split 256-bit vector non-temporal loads to keep it non-temporal (PR32744)
Differential Revision: https://reviews.llvm.org/D33728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304718
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 5 Jun 2017 15:43:03 +0000 (15:43 +0000)]
[X86][SSE] Non-temporal loads shouldn't be folded if it can be avoided (PR32743)
Differential Revision: https://reviews.llvm.org/D33728
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304717
91177308-0d34-0410-b5e6-
96231b3b80d8
Dimitry Andric [Mon, 5 Jun 2017 13:52:31 +0000 (13:52 +0000)]
Remove duplicate LLVM_NATIVE_ from llvm's config.h
Summary:
Since LLVM_NATIVE_ARCH, LLVM_NATIVE_ASMPARSER, LLVM_NATIVE_ASMPRINTER,
LLVM_NATIVE_DISASSEMBLER, LLVM_NATIVE_TARGET, LLVM_NATIVE_TARGETINFO and
LLVM_NATIVE_TARGETMC are already defined in llvm-config.h, there seems
to be no reason to also define them in config.h. Also, I can only find
usage of these macros in files that include llvm-config.h.
So let's remove the duplicated macros from config.h.
Reviewers: chandlerc, rnk, mehdi_amini, joerg
Reviewed By: rnk
Subscribers: chapuni, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D33881
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304714
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Mon, 5 Jun 2017 12:54:53 +0000 (12:54 +0000)]
[ARM] GlobalISel: Constrain callee register on indirect calls
When lowering calls, we generate instructions with machine opcodes
rather than generic ones. Therefore, we need to constrain the register
classes of the operands.
Also enable the machine verifier on the arm-irtranslator.ll test, since
that would've caught this issue.
Fixes (part of) PR32146.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304712
91177308-0d34-0410-b5e6-
96231b3b80d8
whitequark [Mon, 5 Jun 2017 11:49:52 +0000 (11:49 +0000)]
[LLVM-C] [OCaml] Expose Type::subtypes.
The C functions added are LLVMGetNumContainedTypes and
LLVMGetSubtypes.
The OCaml function added is Llvm.subtypes.
Patch by Ekaterina Vaartis.
Differential Revision: https://reviews.llvm.org/D33677
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304709
91177308-0d34-0410-b5e6-
96231b3b80d8
Dimitry Andric [Mon, 5 Jun 2017 11:22:18 +0000 (11:22 +0000)]
Fix building DynamicLibrary.cpp with musl libc
Summary:
The workaround added in rL301240 for stderr/out/in symbols being both
macros and globals is only necessary for glibc, and it does not compile
with musl libc. Alpine Linux has had the following fix for it:
https://git.alpinelinux.org/cgit/aports/plain/main/llvm4/llvm-fix-DynamicLibrary-to-build-with-musl-libc.patch
Adapt the fix in our DynamicLibrary.inc for Unix.
Reviewers: marsupial, chandlerc, krytarowski
Reviewed By: krytarowski
Subscribers: srhines, krytarowski, llvm-commits
Differential Revision: https://reviews.llvm.org/D33883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304707
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Mon, 5 Jun 2017 10:53:26 +0000 (10:53 +0000)]
Move ARM specific test to ELF/ARM dir
Moving ARM specific test clang-section.s
from MC/ELF to MC/ELF/ARM
Buildbots reported failures on
commit https://reviews.llvm.org/rL304705
Full details are available at:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/10333
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304706
91177308-0d34-0410-b5e6-
96231b3b80d8
Javed Absar [Mon, 5 Jun 2017 10:09:13 +0000 (10:09 +0000)]
Add support for #pragma clang section
This patch provides a means to specify section-names for global variables,
functions and static variables, using #pragma directives.
This feature is only defined to work sensibly for ELF targets.
One can specify section names as:
#pragma clang section bss="myBSS" data="myData" rodata="myRodata" text="myText"
One can "unspecify" a section name with empty string e.g.
#pragma clang section bss="" data="" text="" rodata=""
Reviewers: Roger Ferrer, Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D33413
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304704
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Smith [Mon, 5 Jun 2017 09:37:12 +0000 (09:37 +0000)]
[ARM] Support fixup for Thumb2 modified immediate
This change adds a new fixup fixup_t2_so_imm for the t2_so_imm_asmoperand
"T2SOImm". The fixup permits code such as:
.L1:
sub r3, r3, #.L2 - .L1
.L2:
to assemble in Thumb2 as well as in ARM state.
The operand predicate isT2SOImm() explicitly doesn't match expressions
containing :upper16: and :lower16: as expressions with these operators
must match the movt and movw instructions.
The test mov r0, foo2 in thumb2-diagnostics is moved to a new file as the
fixup delays the error message till after the assembler has quit due to
the other errors.
As the mov instruction shares the t2_so_imm_asmoperand mov instructions
with a non constant expression now match t2MOVi rather than t2MOVi16 so the
error message is slightly different.
Fixes PR28647
Differential Revision: https://reviews.llvm.org/D33492
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304702
91177308-0d34-0410-b5e6-
96231b3b80d8
Sven van Haastregt [Mon, 5 Jun 2017 09:18:10 +0000 (09:18 +0000)]
[InstCombine] Fix extractelement use before def
This fixes a bug that can cause extractelements with operands that
haven't been defined yet to be inserted at a wrong point when
optimising insertelements.
Patch by Karl Hylen.
Differential Revision: https://reviews.llvm.org/D33449
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304701
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Mon, 5 Jun 2017 07:35:52 +0000 (07:35 +0000)]
Revert "[sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet."
This reverts commit r304630, as it broke ARM/AArch64 bots for 2 days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304698
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Mon, 5 Jun 2017 01:03:04 +0000 (01:03 +0000)]
[AMDGPU] Fix SIFoldOperands crash with clamp
Fixes bug #33302. Pass did not account that Src1 of max instruction
can be an immediate.
Differential Revision: https://reviews.llvm.org/D33884
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304696
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 23:07:53 +0000 (23:07 +0000)]
[ConstantRange] Add another truncate unittest for wrapped set staying a wrapped set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304695
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 23:03:54 +0000 (23:03 +0000)]
[ConstantRange] Add a few more truncate unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304694
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 23:03:52 +0000 (23:03 +0000)]
[ConstantRange] Add missing result check to the ConstantRange::truncate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304693
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 22:41:56 +0000 (22:41 +0000)]
[InstSimplify] Use llvm::all_of instead of a manual loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304692
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sun, 4 Jun 2017 22:18:57 +0000 (22:18 +0000)]
git-llvm: Update the project list for the llvm-project-
20170507 monorepo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304691
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Sun, 4 Jun 2017 22:12:03 +0000 (22:12 +0000)]
IR: When creating a global variable, assert that its type is valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304690
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 4 Jun 2017 20:12:04 +0000 (20:12 +0000)]
[X86][SSE] Change BUILD_VECTOR interleaving ordering to improve coalescing/combine opportunities
We currently generate BUILD_VECTOR as a tree of UNPCKL shuffles of the same type:
e.g. for v4f32:
Step 1: unpcklps 0, 2 ==> X: <?, ?, 2, 0>
: unpcklps 1, 3 ==> Y: <?, ?, 3, 1>
Step 2: unpcklps X, Y ==> <3, 2, 1, 0>
The issue is because we are not placing sequential vector elements together early enough, we fail to recognise many combinable patterns - consecutive scalar loads, extractions etc.
Instead, this patch unpacks progressively larger sequential vector elements together:
e.g. for v4f32:
Step 1: unpcklps 0, 2 ==> X: <?, ?, 1, 0>
: unpcklps 1, 3 ==> Y: <?, ?, 3, 2>
Step 2: unpcklpd X, Y ==> <3, 2, 1, 0>
This does mean that we are creating UNPCKL shuffle of different value types, but the relevant combines that benefit from this are quite capable of handling the additional BITCASTs that are now included in the shuffle tree.
Differential Revision: https://reviews.llvm.org/D33864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304688
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayal Zaks [Sun, 4 Jun 2017 13:29:51 +0000 (13:29 +0000)]
[LV] Make scalarizeInstruction() non-virtual. NFC.
Following the request made in https://reviews.llvm.org/D32871,
scalarizeInstruction() which is no longer overridden by InnerLoopUnroller is
hereby made non-virtual in InnerLoopVectorizer.
Should have been part of r297580 originally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304685
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 4 Jun 2017 12:41:10 +0000 (12:41 +0000)]
[GlobalISel][X86] merge irtranslator-call test files. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304683
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 08:21:58 +0000 (08:21 +0000)]
[X86] Replace 'REQUIRES: x86' in tests with 'REQUIRES: x86-registered-target' which seems to be the correct way to make them run on an x86 build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304682
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 08:21:53 +0000 (08:21 +0000)]
[ConstantFolding] Combine an if statement into an earlier one that checked the same condition. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304681
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 08:21:51 +0000 (08:21 +0000)]
[ConstantFolding][X86] Replace an LLVM_FALLTHROUGH with a break because it really shouldn't fallthrough.
This is actually NFC because the next case starts with the same if statement as this case did. So the result will be the same and it will fallthrough to the end of the switch. But there's no reason to rely on that so we should just break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304680
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 07:30:28 +0000 (07:30 +0000)]
[ConstantFolding] Properly support constant folding of vector powi intrinsic. The second argument is not a vector so needs special treatment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304679
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 4 Jun 2017 07:30:23 +0000 (07:30 +0000)]
[InstSimplify] Add test case demonstrating that we fail to constant fold vector llvm.powi intrinsics due to the second argument not being a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304678
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sun, 4 Jun 2017 05:31:03 +0000 (05:31 +0000)]
Fixed warning: must specify at least one argument for '...' parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304677
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sun, 4 Jun 2017 05:30:26 +0000 (05:30 +0000)]
Fixed warning: must specify at least one argument for '...' parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304676
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 4 Jun 2017 03:27:12 +0000 (03:27 +0000)]
Make the Twine pretty-printer work with GDB 7.11
Apparently ::NodeKind is sometimes part of the name in GDB.
Without this patch I get the following error message from GDB:
`Unhandled NodeKind llvm::Twine::NodeKind::EmptyKind`.
Patch by Alexander Richardson!
Differential Revision: https://reviews.llvm.org/D32795
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304675
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 3 Jun 2017 23:18:29 +0000 (23:18 +0000)]
[PM] Add GVNSink to the pipeline.
With this, the two pipelines should be in sync again (modulo
LoopUnswitch, but Chandler is actively working on that).
Differential Revision: https://reviews.llvm.org/D33810
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304671
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 3 Jun 2017 22:31:06 +0000 (22:31 +0000)]
ADT: handle special case of ARM environment for SUSE
SUSE treats "gnueabi" as "gnueabihf" so make sure that we normalise the
environment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304670
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 18:50:32 +0000 (18:50 +0000)]
[InstCombine] Add support for simplifying ctlz/cttz intrinsics based on known bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304669
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 18:50:29 +0000 (18:50 +0000)]
[ConstantFolding] Fix constant folding for vector cttz and ctlz intrinsics to understand that the second argument is still a scalar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304668
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 18:50:26 +0000 (18:50 +0000)]
[InstCombine][InstSimplify] Add various tests for ctlz/cttz with vectors, some showing missed optimizations. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304667
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 18:50:23 +0000 (18:50 +0000)]
[InstCombine] Use cttz instead of ctlz in the cttz_cmp_vec test case. Looks like a copy paste mistake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304666
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Sat, 3 Jun 2017 17:39:47 +0000 (17:39 +0000)]
[AMDGPU] Untangle SDWA pass from SIShrinkInstructions
Remove dependency of SDWA pass on SIShrinkInstructions.
The goal is to move SDWA even higher in the stack to avoid second run
of MachineLICM, MachineCSE and SIFoldOperands.
Also added handling to preserve original src modifiers.
Differential Revision: https://reviews.llvm.org/D33860
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304665
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Sat, 3 Jun 2017 11:35:40 +0000 (11:35 +0000)]
Regenerate expectations for trunc-to-bool.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304660
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 3 Jun 2017 11:12:57 +0000 (11:12 +0000)]
[X86][SSE] Add SCALAR_TO_VECTOR(PEXTRW/PEXTRB) support to faux shuffle combining
Generalized existing SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT) code to support AssertZext + PEXTRW/PEXTRB cases as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304659
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 07:47:14 +0000 (07:47 +0000)]
[LazyValueInfo] Use Type::getIntegerBitWidth instead of casting to IntegerType to call getBitWidth. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304656
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 3 Jun 2017 07:47:08 +0000 (07:47 +0000)]
[LazyValueInfo] Make solveBlockValueCast take a CastInst* instead of Instruction*. Makes getOpcode return the appropriate enum without a cast. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304655
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 3 Jun 2017 05:21:08 +0000 (05:21 +0000)]
Initialized BackedgeTakenInfo.MaxOrZero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304639
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 3 Jun 2017 05:19:32 +0000 (05:19 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304638
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 3 Jun 2017 05:19:10 +0000 (05:19 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304637
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 3 Jun 2017 05:18:46 +0000 (05:18 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304636
91177308-0d34-0410-b5e6-
96231b3b80d8
Galina Kistanova [Sat, 3 Jun 2017 05:11:14 +0000 (05:11 +0000)]
Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304635
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Sat, 3 Jun 2017 02:01:24 +0000 (02:01 +0000)]
[WebAssembly] Refactor WasmObjectWriter::writeObject
The size of this function was getting a little out of.
control. Split code for writing each section type into
seperate functions.
Differential Revision: https://reviews.llvm.org/D33792
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304634
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 3 Jun 2017 01:35:47 +0000 (01:35 +0000)]
[sanitizer-coverage] one more flavor of coverage: -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304630
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 3 Jun 2017 01:13:33 +0000 (01:13 +0000)]
AMDGPU/GlobalISel: Mark 1-bit integer constants as legal
Summary:
These are mostly legal, but will probably need special lowering for some
cases.
Reviewers: arsenm
Reviewed By: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, igorb, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D33791
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304628
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Sat, 3 Jun 2017 01:04:06 +0000 (01:04 +0000)]
[CodeGen] Fix Windows builds which treat warnings as errors, broken in r304621.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304627
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Sat, 3 Jun 2017 00:46:27 +0000 (00:46 +0000)]
Revert "[CFI] Remove LinkerSubsectionsViaSymbols."
This reverts commit r304582: breaks cfi-devirt :: anon-namespace.cpp on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304626
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Sat, 3 Jun 2017 00:41:52 +0000 (00:41 +0000)]
[AMDGPU] Preserve operand order in SIFoldOperands
SIFoldOperands can commute operands even if no folding was done.
This change is to preserve IR is no folding was done.
Differential Revision: https://reviews.llvm.org/D33802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304625
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Sat, 3 Jun 2017 00:39:36 +0000 (00:39 +0000)]
[CodeGen] Fix Windows builds broken in r304621.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304624
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 3 Jun 2017 00:33:35 +0000 (00:33 +0000)]
[PDB] Fix use after free.
Previously MappedBlockStream owned its own BumpPtrAllocator that
it would allocate from when a read crossed a block boundary. This
way it could still return the user a contiguous buffer of the
requested size. However, It's not uncommon to open a stream, read
some stuff, close it, and then save the information for later.
After all, since the entire file is mapped into memory, the data
should always be available as long as the file is open.
Of course, the exception to this is when the data isn't *in* the
file, but rather in some buffer that we temporarily allocated to
present this contiguous view. And this buffer would get destroyed
as soon as the strema was closed.
The fix here is to force the user to specify the allocator, this
way it can provide an allocator that has whatever lifetime it
chooses.
Differential Revision: https://reviews.llvm.org/D33858
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304623
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 3 Jun 2017 00:26:35 +0000 (00:26 +0000)]
LiveRegUnits: Port recent LivePhysRegs bugfixes
Adjust code to look more like the code in LivePhysRegs and port over the
fix for LivePhysRegs from r304001 and adapt to the new CSR management in
MachineRegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304622
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Sat, 3 Jun 2017 00:22:41 +0000 (00:22 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304621
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Sat, 3 Jun 2017 00:16:44 +0000 (00:16 +0000)]
[AMDGPU] V_DIV_FIXUP_F16 is not a commutable operation
Differential Revision: https://reviews.llvm.org/D33808
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304619
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Sat, 3 Jun 2017 00:08:21 +0000 (00:08 +0000)]
[SLP] Improve comments and naming of functions/variables/members, NFC.
Fixed some comments, added an additional description of the algorithms,
improved readability of the code.
Differential revision: https://reviews.llvm.org/D33320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304616
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 2 Jun 2017 23:40:58 +0000 (23:40 +0000)]
[SystemZ] Simplify test case. NFC
Remove useless successors information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304615
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 23:40:46 +0000 (23:40 +0000)]
[x86] fix over-specific triple; NFC
There's nothing darwin-specific in these tests, and using
that setting causes extra phantom diffs when the auto-generated
check lines are regenerated today.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304614
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 2 Jun 2017 23:27:36 +0000 (23:27 +0000)]
Canonicalize a test via utils/update_test_checks.py
Turns out I might not have further changes to make here, but with the way I'd written the tests, even I couldn't tell that. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304613
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 23:24:28 +0000 (23:24 +0000)]
[x86] add tests for unsigned vector compares with known signbits; NFC (PR33276)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304612
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 23:21:53 +0000 (23:21 +0000)]
[x86] simplify code for vector icmp pred transforms; NFCI
Organizing by transform is smaller and easier to read than a squashed switch with fall-throughs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304611
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 2 Jun 2017 23:13:44 +0000 (23:13 +0000)]
[sanitizer-coverage] refactor the code to make it easier to add more sections in future. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304610
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 2 Jun 2017 23:09:15 +0000 (23:09 +0000)]
Revert "[SLP] Improve comments and naming of functions/variables/members, NFC."
This reverts commit
6e311de8b907aa20da9a1a13ab07c3ce2ef4068a.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304609
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 2 Jun 2017 23:07:58 +0000 (23:07 +0000)]
Change code formatting to look like the surrounding code
clang-format decided differently and Matthias pointed out the
difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304608
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 2 Jun 2017 23:03:26 +0000 (23:03 +0000)]
[Statepoint] Be consistent about using deopt naming [NFCI]
We'd called this "vm state" in the early days, but have long since standardized on calling it "deopt" in line with the operand bundle tag. Fix a few cases we'd missed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304607
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 2 Jun 2017 23:01:42 +0000 (23:01 +0000)]
RegisterScavenging: Add ScavengerTest pass
This pass allows to run the register scavenging independently of
PrologEpilogInserter to allow targeted testing.
Also adds some basic register scavenging tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304606
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 2 Jun 2017 23:01:38 +0000 (23:01 +0000)]
InitializePasses: Sort initializer list (by ASCII)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304605
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 2 Jun 2017 22:46:31 +0000 (22:46 +0000)]
[RABasic] Properly update the LiveRegMatrix when LR splitting occur
Prior to this patch we used to not touch the LiveRegMatrix while doing
live-range splitting. In other words, when live-range splitting was
occurring, the LiveRegMatrix was not reflecting the changes.
This is generally fine because it means the query to the LiveRegMatrix
will be conservately correct. However, when decisions are taken based on
what is going to happen on the interferences (e.g., when we spill a
register and know that it is going to be available for another one), we
might hit an assertion that the color used for the assignment is still
in use.
This patch makes sure the changes on the live-ranges are properly
reflected in the LiveRegMatrix, so the assertions don't break.
An alternative could have been to remove the assertion, but it would
make the invariants of the code and the general reasoning more
complicated in my opnion.
http://llvm.org/PR33057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304603
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 2 Jun 2017 22:46:26 +0000 (22:46 +0000)]
[RABasic] Properly initialize the pass
Use the initializeXXX method to initialize the RABasic pass in the
pipeline. This enables us to take advantage of the .mir infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304602
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Fri, 2 Jun 2017 22:38:48 +0000 (22:38 +0000)]
Fix debug build test failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304600
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Fri, 2 Jun 2017 22:08:04 +0000 (22:08 +0000)]
[PartialInlining] Minor cost anaysis tuning
Also added a test option and 2 cost analysis related tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304599
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 2 Jun 2017 21:24:17 +0000 (21:24 +0000)]
FunctionAttrs: Skip it if the effective SCC (ignoring optnone functions) is empty
Minor optimization but mostly simplifies my debugging so I'm not dealing
with empty SCCNodeSets while investigating issues in this optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304597
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 2 Jun 2017 21:02:03 +0000 (21:02 +0000)]
RegisterScavenging: Move scavenging logic from PEI to RegisterScavenging; NFC
These parts do not depend on any PrologEpilogInserter logic and
therefore better fits RegisterScaveging.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304596
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 2 Jun 2017 21:00:22 +0000 (21:00 +0000)]
Fix build error on gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304595
91177308-0d34-0410-b5e6-
96231b3b80d8
Jun Bum Lim [Fri, 2 Jun 2017 20:42:54 +0000 (20:42 +0000)]
[InlineCost] Enable the new switch cost heuristic
Summary:
This is to enable the new switch inline cost heuristic (r301649) by removing the
old heuristic as well as the flag itself.
In my experiment for LLVM test suite and spec2000/2006, +17.82% performance and
8% code size reduce was observed in spec2000/vertex with O3 LTO in AArch64.
No significant code size / performance regression was found in O3/O2/Os. No
significant complain was reported from the llvm-dev thread.
Reviewers: hans, chandlerc, eraman, haicheng, mcrosier, bmakam, eastig, ddibyend, echristo
Reviewed By: echristo
Subscribers: javed.absar, kristof.beyls, echristo, aemerson, rengolin, mehdi_amini
Differential Revision: https://reviews.llvm.org/D32653
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304594
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Fri, 2 Jun 2017 20:39:27 +0000 (20:39 +0000)]
[SLP] Improve comments and naming of functions/variables/members, NFC.
Summary:
Fixed some comments, added an additional description of the algorithms,
improved readability of the code.
Reviewers: anemet
Subscribers: llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D33320
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304593
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Fri, 2 Jun 2017 20:02:59 +0000 (20:02 +0000)]
[X86] Correctly broadcast NaN-like integers as float on AVX.
Since r288804, we try to lower build_vectors on AVX using broadcasts of
float/double. However, when we broadcast integer values that happen to
have a NaN float bitpattern, we lose the NaN payload, thereby changing
the integer value being broadcast.
This is caused by ConstantFP::get, to which we pass the splat i32 as
a float (by bitcasting it using bitsToFloat). ConstantFP::get takes
a double parameter, so we end up lossily converting a single-precision
NaN to double-precision.
Instead, avoid any kinds of conversions by directly building an APFloat
from the splatted APInt.
Note that this also fixes another piece of code (broadcast of
subvectors), that currently isn't susceptible to the same problem.
Also note that we could really just use APInt and ConstantInt
throughout: the constant pool type doesn't matter much. Still, for
consistency, use the appropriate type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304590
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 2 Jun 2017 20:00:10 +0000 (20:00 +0000)]
Fix build error with clang and gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304589
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 2 Jun 2017 19:49:14 +0000 (19:49 +0000)]
[CodeView] Support CodeView subsections in any order.
Previously we would expect certain subsections to appear
in a certain order because some subsections would reference
other subsections, but in practice we need to support
arbitrary orderings since some object file and PDB file
producers generate them this way. This also paves the
way for supporting Yaml <-> Object File conversion of
CodeView, since Object Files typically have quite a
large number of subsections in their debug info.
Differential Revision: https://reviews.llvm.org/D33807
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304588
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Fri, 2 Jun 2017 19:38:11 +0000 (19:38 +0000)]
[CMake][runtimes] Add install target for runtimes builtins
This adds an install-builtins target to avoid having to list all
builtins targets explicitly.
Differential Revision: https://reviews.llvm.org/D32710
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304587
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Fri, 2 Jun 2017 19:15:04 +0000 (19:15 +0000)]
Regenerate expectation for wide-fma-contraction.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304586
91177308-0d34-0410-b5e6-
96231b3b80d8
Keno Fischer [Fri, 2 Jun 2017 19:04:17 +0000 (19:04 +0000)]
[SROA] Fix crash due to bad bitcast
Summary:
As shown in the test case, SROA was crashing when trying to split
stores (to the alloca) of loads (from anywhere), because it assumed
the pointer operand to the loads and stores had to have the same
address space. This isn't the case. Make sure to use the correct
pointer type for both the load and the store.
Reviewed By: yaxunl
Differential Revision: https://reviews.llvm.org/D32593
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304585
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 2 Jun 2017 18:45:14 +0000 (18:45 +0000)]
[CFI] Remove LinkerSubsectionsViaSymbols.
Since D17854 LinkerSubsectionsViaSymbols is unnecessary.
It is interfering with ThinLTO implementation of CFI-ICall, where
the aliases used on the !LinkerSubsectionsViaSymbols branch are
needed to export jump tables to ThinLTO backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304582
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 2 Jun 2017 18:25:29 +0000 (18:25 +0000)]
BitcodeWriter: Removing unnecessary std::function in favor of template
More cleanup from post-commit discussion on r304516
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304579
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 2 Jun 2017 18:24:23 +0000 (18:24 +0000)]
Skip CFI for dead functions.
Differential Revision: https://reviews.llvm.org/D33805
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304578
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Fri, 2 Jun 2017 18:24:17 +0000 (18:24 +0000)]
Move summary dead stripping before regular LTO.
This way dead stripping results are recorded in combined summary and
can be used in regular LTO passes.
Differential Revision: https://reviews.llvm.org/D33615
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304577
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 18:14:31 +0000 (18:14 +0000)]
[x86] fix formatting; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304576
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 2 Jun 2017 18:02:42 +0000 (18:02 +0000)]
AMDGPU: Register AMDGPUAlwaysInline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304574
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 2 Jun 2017 17:53:06 +0000 (17:53 +0000)]
Re-land "COFF: migrate def parser from LLD to LLVM"
This reverts commit r304561 and re-lands r303490 & co.
The fix was to use "SymbolName" when translating LLD's internal export
list to lib/Object's short export struct. The SymbolName reflects the
actual symbol name, which may include fastcall and stdcall mangling bits
not included in the /EXPORT or .def file EXPORTS name:
@@ -434,8 +434,7 @@ std::vector<COFFShortExport> createCOFFShortExportFromConfig() {
std::vector<COFFShortExport> Exports;
for (Export &E1 : Config->Exports) {
COFFShortExport E2;
- E2.Name = E1.Name;
+ // Use SymbolName, which will have any stdcall or fastcall qualifiers.
+ E2.Name = E1.SymbolName;
E2.ExtName = E1.ExtName;
E2.Ordinal = E1.Ordinal;
E2.Noname = E1.Noname;
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304573
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Fri, 2 Jun 2017 17:40:26 +0000 (17:40 +0000)]
AMDGPU: Make auto waitcnt before barrier a feature
Differential Revision: https://reviews.llvm.org/D33793
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304571
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 17:35:02 +0000 (17:35 +0000)]
[TargetLowering] fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304569
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 2 Jun 2017 17:28:12 +0000 (17:28 +0000)]
[LazyValueInfo] Fix formatting NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304567
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 2 Jun 2017 17:24:26 +0000 (17:24 +0000)]
Tidy up a bit of r304516, use SmallVector::assign rather than for loop
This might give a few better opportunities to optimize these to memcpy
rather than loops - also a few minor cleanups (StringRef-izing,
templating (to avoid std::function indirection), etc).
The SmallVector::assign(iter, iter) could be improved with the use of
SFINAE, but the (iter, iter) ctor and append(iter, iter) need it to and
don't have it - so, workaround it for now rather than bothering with the
added complexity.
(also, as noted in the added FIXME, these assign ops could potentially
be optimized better at least for non-trivially-copyable types)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304566
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 2 Jun 2017 17:02:33 +0000 (17:02 +0000)]
Verify a couple more fields in STATEPOINT instructions
While doing so, clarify the comments and update them to reflect current reality.
Note: I'm going to let this sit for a week or so before adding further verification. I want to give this time to cycle through bots and merge it into our downstream tree before pushing this further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304565
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Fri, 2 Jun 2017 16:36:37 +0000 (16:36 +0000)]
Add placeholder for more extensive verification of psuedo ops
This initial patch doesn't actually do much useful. It's just to show where the new code goes. Once this is in, I'll extend the verification logic to check more useful properties.
For those curious, the more complicated version of this patch already found one very suspicious thing.
Differential Revision: https://reviews.llvm.org/D33819
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304564
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 2 Jun 2017 16:33:13 +0000 (16:33 +0000)]
[LazyValueInfo] Make solveBlockValueBinaryOp take a BinaryOperator* instead of Instruction*. This removes a cast of getOpcode to BinaryOps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304563
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 2 Jun 2017 16:29:41 +0000 (16:29 +0000)]
[InstCombine] fix icmp with not op and constant to work with splat vector constant
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304562
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 2 Jun 2017 16:26:24 +0000 (16:26 +0000)]
Revert "COFF: migrate def parser from LLD to LLVM"
This reverts commits r303490, r303491, r303493, and r303494.
This caused http://crbug.com/728726. Essentially, exporting stdcall
functions doesn't appear to work after this change. Reduced test case
soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304561
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 2 Jun 2017 16:21:13 +0000 (16:21 +0000)]
[LazyValueInfo] Fix typo in comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304560
91177308-0d34-0410-b5e6-
96231b3b80d8