OSDN Git Service
Ilya Biryukov [Fri, 18 Aug 2017 09:37:23 +0000 (09:37 +0000)]
Addressed some security issues in Dockerfiles.
Summary:
- Removed --trust-server-cert from `svn checkout` invocations.
Installing 'ca-certificates' package on ubuntu adds required CAs to
the system and svn can do proper checkout using https.
- Added checksum verification when installing cmake from cmake.org.
Reviewers: mehdi_amini, klimek
Reviewed By: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36673
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311152
91177308-0d34-0410-b5e6-
96231b3b80d8
Diana Picus [Fri, 18 Aug 2017 09:31:21 +0000 (09:31 +0000)]
Revert "GlobalISel (AArch64): fix ABI at border between GPRs and SP."
This reverts commit
e8fd20964798ca6d46d2729dd3a789707a6416da in an
attempt to appease the GlobalISel buildbot, which fails in the
test-suite with errors like
fpcmp: files differ without tolerance allowance
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311151
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 18 Aug 2017 09:08:05 +0000 (09:08 +0000)]
[AArch64] Fix for buildbots, unused function
Removing function declaration, my previous commit broke the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311150
91177308-0d34-0410-b5e6-
96231b3b80d8
Victor Leschuk [Fri, 18 Aug 2017 09:02:06 +0000 (09:02 +0000)]
Remove useless default case in switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311149
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Fri, 18 Aug 2017 08:39:54 +0000 (08:39 +0000)]
[AArch64] Remove DecodeAuthLoadWriteback
The BaseAuthLoad instruction class was incorrectly passing an empty
constraint string to its parent, so I have corrected this. This makes
the DecodeAuthLoadWriteback function redundant, so I've also removed
it.
Differential Revision: https://reviews.llvm.org/D36741
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311148
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Fri, 18 Aug 2017 06:45:34 +0000 (06:45 +0000)]
Refine report_fatal_error guidance after post-commit review
Use text suggested by Justin Bogner in post-commit review of r311146
<http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20170814/479898.html>,
which makes it clear that report_fatal_error shouldn't be used when there is a
practicable alternative. Also make this clearer in CodingStandards.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311147
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Fri, 18 Aug 2017 05:29:21 +0000 (05:29 +0000)]
Give guidance on report_fatal_error in CodingStandards.rst and ProgrammersManual.rst
The current ProgrammersManual.rst document has a lot of well-written
documentation on error handling thanks to @lhames. It suggests errors can be
split cleanly into "programmatic" and "recoverable" errors. However, the
reality in current LLVM seems to be there are a number of cases where a
non-programmatic error is not easily recoverable. Therefore, add a note to
indicate the existence of report_fatal_error for these cases. I've also added
a reminder to CodingStandards.rst in the section on assertions, to indicate
that llvm_unreachable and assertions should not be relied upon to report
errors triggered by user input.
The ProgrammersManual is also silent on the use of LLVMContext::diagnose,
which is used in BPF+WebAssembly+AMDGPU to report some errors during
instruction selection. I don't address that in this patch, as it's not quite
clear how to fit in to the current error handling story
Differential Revision: https://reviews.llvm.org/D36826
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311146
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 18 Aug 2017 04:52:46 +0000 (04:52 +0000)]
[DAGCombiner] Fix bad comment that had immediate values swapped from the code and what they need to be to make sense. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311144
91177308-0d34-0410-b5e6-
96231b3b80d8
Jatin Bhateja [Fri, 18 Aug 2017 02:39:28 +0000 (02:39 +0000)]
Test commit access
Summary: Adding a blank line.
Differential Revision: https://reviews.llvm.org/D36859
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311143
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Fri, 18 Aug 2017 01:43:11 +0000 (01:43 +0000)]
Revert "[MachineCopyPropagation] Extend pass to do COPY source forwarding" round 2
This reverts commit r311135.
sanitizer-x86_64-linux-android buildbot is timing out with just this
patch applied.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311142
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 17 Aug 2017 23:38:41 +0000 (23:38 +0000)]
Increase tail dup threshold for -O3 from 3 to 4.
We see a modest performance improvement from this slightly higher tail dup threshold.
Differential Revision: https://reviews.llvm.org/D36775
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311139
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 23:20:57 +0000 (23:20 +0000)]
[X86] Remove SSE/AVX patterns for AND/XOR/OR/ANDN that checked for the inputs being bitcasted from floating point types.
There's really no reason to do this we should just let isel pick the integer version and let the execution dependency fixing pass take care of moving to FP if necessary.
It's not very reliable to look for bitcasts at the edges of patterns. If for some reason one input was bitcasted and the other wasn't, or if one was a v4f32 bitcast and one was a v2f64 bitcast, we would have fallen back to the integer pattern anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311138
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 17 Aug 2017 23:14:01 +0000 (23:14 +0000)]
GlobalISel (AArch64): fix ABI at border between GPRs and SP.
If a struct would end up half in GPRs and half on SP the ABI says it should
actually go entirely on the stack. We were getting this wrong in GlobalISel
before, causing compatibility issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311137
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Thu, 17 Aug 2017 23:06:55 +0000 (23:06 +0000)]
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Two issues identified by buildbots were addressed:
- The pass no longer forwards COPYs to physical register uses, since
doing so can break code that implicitly relies on the physical
register number of the use.
- The pass no longer forwards COPYs to undef uses, since doing so
can break the machine verifier by creating LiveRanges that don't
end on a use (since the undef operand is not considered a use).
[MachineCopyPropagation] Extend pass to do COPY source forwarding
This change extends MachineCopyPropagation to do COPY source forwarding.
This change also extends the MachineCopyPropagation pass to be able to
be run during register allocation, after physical registers have been
assigned, but before the virtual registers have been re-written, which
allows it to remove virtual register COPY LiveIntervals that become dead
through the forwarding of all of their uses.
Reviewers: qcolombet, javed.absar, MatzeB, jonpa
Subscribers: jyknight, nemanjai, llvm-commits, nhaehnle, mcrosier, mgorny
Differential Revision: https://reviews.llvm.org/D30751
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311135
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 17 Aug 2017 22:20:15 +0000 (22:20 +0000)]
Fix warning about covered switch default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311129
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 17 Aug 2017 22:20:04 +0000 (22:20 +0000)]
AMDGPU: Add R600InstPrinter class
Summary:
This is step towards separating the GCN and R600 tablegen'd code.
This is a little awkward for now, because the R600 functions won't have the
MCSubtargetInfo parameter, so we need to have AMDMGPUInstPrinter
delegate to R600InstPrinter, but once the tablegen'd code is split,
we will be able to drop the delegation and use R600InstPrinter directly.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D36444
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311128
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 17 Aug 2017 21:48:19 +0000 (21:48 +0000)]
[LoopRotate][Dominators] Use the incremental API to update DomTree
Summary: This patch teaches LoopRotate to use the new incremental API to update the DominatorTree.
Reviewers: dberlin, davide, grosser, sanjoy
Reviewed By: dberlin, davide
Subscribers: hiraditya, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D35581
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311125
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Thu, 17 Aug 2017 21:26:39 +0000 (21:26 +0000)]
[CodeGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311124
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 17 Aug 2017 20:18:36 +0000 (20:18 +0000)]
Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311119
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 17 Aug 2017 20:04:51 +0000 (20:04 +0000)]
[llvm-pdbutil] Fix some dumping issues.
When dumping, we were treating the S_INLINESITESYM as referring
to a type record, when it actually refers to an id record. We
had this correct in TypeIndexDiscovery, so our merging algorithm
should be fine, but we had it wrong in the dumper, which means it
would appear to work most of the time, unless the index was out
of bounds in the type stream, when it would fail. Fixed this, and
audited a few other cases to make them match the behavior in
TypeIndexDiscovery.
Also, I've now observed a new symbol record with kind 0x1168 which
I have no clue what it is, so to avoid crashing we have to just
print "Unknown Symbol Kind".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311117
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 17 Aug 2017 20:04:31 +0000 (20:04 +0000)]
Fix a few minor issues when dumping symbols.
1) We weren't handling symbol types that weren't able to parse,
even if we knew what the leaf type was. This was triggering
when trying to dump /DEBUG:FASTLINK PDBs, where we expect a
certain symbol to show up, but we just don't know how to parse
it.
2) We lost the code for dumping record bytes, so this was added
back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311116
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 17 Aug 2017 18:21:53 +0000 (18:21 +0000)]
[docs] Tweak phrasing of the varargs explanation in the command section of the
CMake primer.
This moves the introduction of the ARGV/ARGN variables up to immmediately follow
the introduction of the concept of variable argument functions, and explicitly
connects this concept to C varargs functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311113
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 17 Aug 2017 18:00:28 +0000 (18:00 +0000)]
[docs] Fix typo and tweak wording of special variable handling in CMake primer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311112
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 17 Aug 2017 17:58:33 +0000 (17:58 +0000)]
Revert "[Debug info] Transfer DI to fragment expressions for split integer values."
This reverts commit r311102.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311111
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Bataev [Thu, 17 Aug 2017 17:26:52 +0000 (17:26 +0000)]
[SimplifyCFG] Add a test for preserve store alignment, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311106
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 17 Aug 2017 17:07:37 +0000 (17:07 +0000)]
[x86] add tests for vector select-of-constants; NFC
We've discussed canonicalizing to this form in IR, so the backend
should be prepared to lower these in ways better than what we see
here in most cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311103
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 17 Aug 2017 17:06:48 +0000 (17:06 +0000)]
[Debug info] Transfer DI to fragment expressions for split integer values.
This patch teaches the SDag type legalizer how to split up debug info for
integer values that are split into a hi and lo part.
Differential Revision: https://reviews.llvm.org/D36805
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311102
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 17 Aug 2017 17:03:11 +0000 (17:03 +0000)]
[PowerPC] add tests for vector select-of-constants; NFC
We've discussed canonicalizing to this form in IR, so the backend
should be prepared to lower these in ways better than what we see
here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311099
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Thu, 17 Aug 2017 16:57:13 +0000 (16:57 +0000)]
Improve line debug info when translating a CaseBlock to SDNodes.
The SelectionDAGBuilder translates various conditional branches into
CaseBlocks which are then translated into SDNodes. If a conditional
branch results in multiple CaseBlocks only the first CaseBlock is
translated into SDNodes immediately, the rest of the CaseBlocks are
put in a queue and processed when all LLVM IR instructions in the
basic block have been processed.
When a CaseBlock is transformed into SDNodes the SelectionDAGBuilder
is queried for the current LLVM IR instruction and the resulting
SDNodes are annotated with the debug info of the current
instruction (if it exists and has debug metadata).
When the deferred CaseBlocks are processed, the SelectionDAGBuilder
does not have a current LLVM IR instruction, and the resulting SDNodes
will not have any debuginfo. As DwarfDebug::beginInstruction() outputs
a .loc directive for the first instruction in a labeled
block (typically the case for something coming from a CaseBlock) this
tends to produce a line-0 directive.
This patch changes the handling of CaseBlocks to store the current
instruction's debug info into the CaseBlock when it is created (and the
SelectionDAGBuilder knows the current instruction) and to always use
the stored debug info when translating a CaseBlock to SDNodes.
Patch by Frej Drejhammar!
Differential Revision: https://reviews.llvm.org/D36671
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311097
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 17 Aug 2017 16:45:35 +0000 (16:45 +0000)]
[Dominators] Teach LoopUnswitch to use the incremental API
Summary:
This patch makes LoopUnswitch use new incremental API for updating dominators.
It also updates SplitCriticalEdge, as it is called in LoopUnswitch.
There doesn't seem to be any noticeable performance difference when bootstrapping clang with this patch.
Reviewers: dberlin, davide, sanjoy, grosser, chandlerc
Reviewed By: davide, grosser
Subscribers: mzolotukhin, llvm-commits
Differential Revision: https://reviews.llvm.org/D35528
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311093
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 15:40:25 +0000 (15:40 +0000)]
[AVX512] Don't switch unmasked subvector insert/extract instructions when AVX512DQI is enabled.
There's no reason to switch instructions with and without DQI. It just creates extra isel patterns and test divergences.
There is however value in enabling the masked version of the instructions with DQI.
This required introducing some new multiclasses to enabling this splitting.
Differential Revision: https://reviews.llvm.org/D36661
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311091
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 15:25:05 +0000 (15:25 +0000)]
[X86] Remove memopmmx pattern fragment
Summary: Just like the FIXME says, there is no alignment requirement for MMX.
Reviewers: RKSimon, zvi, igorb
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36815
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311090
91177308-0d34-0410-b5e6-
96231b3b80d8
Victor Leschuk [Thu, 17 Aug 2017 15:07:03 +0000 (15:07 +0000)]
Mark Verifier/invalid-eh.ll as unsupported on windows
Mark this unsupported for now as it causes tests hangs on buildbot.
Will place it back when the problem is debugged.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311089
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Thu, 17 Aug 2017 14:14:25 +0000 (14:14 +0000)]
[dfsan] Add explicit zero extensions for shadow parameters in function wrappers.
In the case where dfsan provides a custom wrapper for a function,
shadow parameters are added for each parameter of the function.
These parameters are i16s. For targets which do not consider this
a legal type, the lack of sign extension information would cause
LLVM to generate anyexts around their usage with phi variables
and calling convention logic.
Address this by introducing zero exts for each shadow parameter.
Reviewers: pcc, slthakur
Differential Revision: https://reviews.llvm.org/D33349
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311087
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 17 Aug 2017 13:18:35 +0000 (13:18 +0000)]
[globalisel][tablegen] Generate TypeObject table. NFC
Summary:
Generate the type table from the types used by a target rather than hard-coding
the union of types used by all targets.
Depends on D36084
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Reviewed By: rovka
Subscribers: kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36085
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311084
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 17 Aug 2017 13:03:34 +0000 (13:03 +0000)]
[DAGCombiner] Add support for non-uniform constant vectors to (mul x, (1 << c)) -> x << c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311083
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Thu, 17 Aug 2017 12:12:30 +0000 (12:12 +0000)]
[X86] Refactoring of X86TargetLowering::EmitLoweredSelect. NFC.
Authored by aivchenk
Differential Revision: https://reviews.llvm.org/D35685
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311082
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 17 Aug 2017 11:32:21 +0000 (11:32 +0000)]
[Verifier] Avoid visiting DIGlobalVariables twice.
We currently visit them twice.
Once, through `visitMDNode()` -> (the code generated by)
`../include/llvm/IR/Metadata.def:109` -> `visitDIGlobalVariable()`
Then, through `visitMDNode()` -> `visitDIGlobalVariableExpression()`
-> `visitDIGlobalVariable()`
This results in verification failures printed twice, e.g.:
$ ./opt -verify ../../test/DebugInfo/pr34186.ll
missing global variable type
!4 = distinct !DIGlobalVariable(name: "pat", scope: !0,
file: !1, line: 27, isLocal: true, isDefinition: true)
missing global variable type
!4 = distinct !DIGlobalVariable(name: "pat", scope: !0,
file: !1, line: 27, isLocal: true, isDefinition: true)
./opt: ../../test/DebugInfo/pr34186.ll: error: input module is broken!
The patch removes one call so we ensure each GV is visited exactly once.
Differential Revision: https://reviews.llvm.org/D36797
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311081
91177308-0d34-0410-b5e6-
96231b3b80d8
Ayal Zaks [Thu, 17 Aug 2017 09:29:59 +0000 (09:29 +0000)]
[LV] Using VPlan to model the vectorized code and drive its transformation
VPlan is an ongoing effort to refactor and extend the Loop Vectorizer. This
patch introduces the VPlan model into LV and uses it to represent the vectorized
code and drive the generation of vectorized IR.
In this patch VPlan models the vectorized loop body: the vectorized control-flow
is represented using VPlan's Hierarchical CFG, with predication refactored from
being a post-vectorization-step into a vectorization planning step modeling
if-then VPRegionBlocks, and generating code inline with non-predicated code. The
vectorized code within each VPBasicBlock is represented as a sequence of
Recipes, each responsible for modelling and generating a sequence of IR
instructions. To keep the size of this commit manageable the Recipes in this
patch are coarse-grained and capture large chunks of LV's code-generation logic.
The constructed VPlans are dumped in dot format under -debug.
This commit retains current vectorizer output, except for minor instruction
reorderings; see associated modifications to lit tests.
For further details on the VPlan model see docs/Proposals/VectorizationPlan.rst
and its references.
Authors: Gil Rapaport and Ayal Zaks
Differential Revision: https://reviews.llvm.org/D32871
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311077
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 17 Aug 2017 09:26:14 +0000 (09:26 +0000)]
Re-commit: [globalisel][tablegen] Support zero-instruction emission.
Summary:
Support the case where an operand of a pattern is also the whole of the
result pattern. In this case the original result and all its uses must be
replaced by the operand. However, register class restrictions can require
a COPY. This patch handles both cases by always emitting the copy and
leaving it for the register allocator to optimize.
The previous commit failed on Windows machines due to a flaw in the sort
predicate which allowed both A < B < C and B == C to be satisfied
simultaneously. The cause of this was some sloppiness in the priority order of
G_CONSTANT instructions compared to other instructions. These had equal priority
because it makes no difference, however there were operands had higher priority
than G_CONSTANT but lower priority than any other instruction. As a result, a
priority order between G_CONSTANT and other instructions must be enforced to
ensure the predicate defines a strict weak order.
Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar
Subscribers: javed.absar, kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D36084
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311076
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Thu, 17 Aug 2017 09:18:02 +0000 (09:18 +0000)]
[SystemZ] Also wrap TII with #ifndef NDEBUG in constructor initilizer list.
TII needs to be wrapped with #ifndef NDEBUG to silece compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311075
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Thu, 17 Aug 2017 08:56:09 +0000 (08:56 +0000)]
[SystemZ] Add a wrapping with #ifndef NDEBUG to silence warning.
SystemZHazardRecognizer::TII is only used for debug output, so it needs
also to be wrapped with #ifndef NDEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311074
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Thu, 17 Aug 2017 08:33:44 +0000 (08:33 +0000)]
[SystemZ, MachineScheduler] Improve post-RA scheduling.
The idea of this patch is to continue the scheduler state over an MBB boundary
in the case where the successor block has only one predecessor. This means
that the scheduler will continue in the successor block (after emitting any
branch instructions) with e.g. maintained processor resource counters.
Benchmarks have been confirmed to benefit from this.
The algorithm in MachineScheduler.cpp that extracts scheduling regions of an
MBB has been extended so that the strategy may optionally reverse the order
of processing the regions themselves. This is controlled by a new method
doMBBSchedRegionsTopDown(), which defaults to false.
Handling the top-most region of an MBB first also means that a top-down
scheduler can continue the scheduler state across any scheduling boundary
between to regions inside MBB.
Review: Ulrich Weigand, Matthias Braun, Andy Trick.
https://reviews.llvm.org/D35053
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311072
91177308-0d34-0410-b5e6-
96231b3b80d8
Elad Cohen [Thu, 17 Aug 2017 08:06:36 +0000 (08:06 +0000)]
[SelectionDAG] Teach the vector-types operand scalarizer about SETCC
When v1i1 is legal (e.g. AVX512) the legalizer can reach
a case where a v1i1 SETCC with an illgeal vector type operand
wasn't scalarized (since v1i1 is legal) but its operands does
have to be scalarized. This used to assert because SETCC was
missing from the vector operand scalarizer.
This patch attemps to teach the legalizer to handle these cases
by scalazring the operands, converting the node into a scalar
SETCC node.
Differential revision: https://reviews.llvm.org/D36651
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311071
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 17 Aug 2017 06:26:42 +0000 (06:26 +0000)]
[llvm-dlltool] Improve an error message when unable to open files. NFC.
Differential Revision: https://reviews.llvm.org/D36818
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311069
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Thu, 17 Aug 2017 05:58:27 +0000 (05:58 +0000)]
[llvm-dlltool] Don't crash if no def file is provided or it can't be opened
Differential Revision: https://reviews.llvm.org/D36780
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311068
91177308-0d34-0410-b5e6-
96231b3b80d8
Serguei Katkov [Thu, 17 Aug 2017 05:48:30 +0000 (05:48 +0000)]
[CGP] Fix the rematerialization of gc.relocates
If we want to substitute the relocation of derived pointer with gep of base then
we must ensure that relocation of base dominates the relocation of derived pointer.
Currently only check for basic block is present. However it is possible that both
relocation are in the same basic block but relocation of derived pointer is defined
earlier.
The patch moves the relocation of base pointer right before relocation of derived
pointer in this case.
Reviewers: sanjoy,artagnon,igor-laevsky,reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D36462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311067
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Thu, 17 Aug 2017 04:04:11 +0000 (04:04 +0000)]
Revert "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
This reverts commit r311038.
Several buildbots are breaking, and at least one appears to be due to
the forwarding of physical regs enabled by this change. Reverting while
I investigate further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311062
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Thu, 17 Aug 2017 02:42:24 +0000 (02:42 +0000)]
ARM: mark CPSR as clobbered for Windows VLAs
When lowering a VLA, we emit a __chstk call. However, this call can
internally clobber CPSR. We did not mark this register as an ImpDef,
which could potentially allow a comparison to be hoisted above the call
to `__chkstk`. In such a case, the CPSR could be clobbered, and the
check invalidated. When the support was initially added, it seemed that
the call would take care of preventing CPSR from being clobbered, but
this is not the case. Mark the register as clobbered to fix a possible
state corruption.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311061
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 02:34:35 +0000 (02:34 +0000)]
[X86] Exchange the memory op predicate for PALIGNR/VPALIGNR. I accidentally swapped them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311060
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 01:48:03 +0000 (01:48 +0000)]
[X86] Cleanup multiclasses for SSE/AVX2 PALIGNR. Add missing load patterns.
We used to have a separate multiclass for AVX2 and SSE/AVX. Now we have one multiclass and pass the relevant differences.
We were also missing load patterns, though we had them for the AVX-512 version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311059
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 17 Aug 2017 01:48:00 +0000 (01:48 +0000)]
[X86] Remove patterns for PALIGNR with non-vXi8 types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311058
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Thu, 17 Aug 2017 01:41:49 +0000 (01:41 +0000)]
Reapply: [ADCE][Dominators] Teach ADCE to preserve dominators
Summary:
This patch teaches ADCE to preserve both DominatorTrees and PostDominatorTrees.
I didn't notice any performance impact when bootstrapping clang with this patch.
The patch was originally committed in r311039 and reverted in r311049.
This revision fixes the problem with not adding a dependency on the
DominatorTreeWrapperPass for the LegacyPassManager.
Reviewers: dberlin, chandlerc, sanjoy, davide, grosser, brzycki
Reviewed By: davide
Subscribers: grandinj, zhendongsu, llvm-commits, david2050
Differential Revision: https://reviews.llvm.org/D35869
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311057
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 16 Aug 2017 23:38:25 +0000 (23:38 +0000)]
[X86] Put multiclass closer to its use and simplify slightly. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311055
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 16 Aug 2017 23:16:43 +0000 (23:16 +0000)]
[X86] Use a static array instead of a SmallVector for a small fixed size array. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311054
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 16 Aug 2017 22:50:11 +0000 (22:50 +0000)]
[x86] add cmov promotion tests for D36711; NFC
This way we can see what the current codegen looks like.
I've also explicitly added/removed the cmov attribute from the RUN lines,
so we know exactly what we're checking in the runs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311052
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Wed, 16 Aug 2017 22:42:38 +0000 (22:42 +0000)]
[InstCombine] Teach canEvaluateTruncated to handle arithmetic shift (including those with vector splat shift amount)
Differential Revision: https://reviews.llvm.org/D36784
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311050
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 16 Aug 2017 22:10:53 +0000 (22:10 +0000)]
Revert "[ADCE][Dominators] Teach ADCE to preserve dominators"
This reverts commit r311039. The patch caused the
`test/Bindings/OCaml/Output/scalar_opts.ml` to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311049
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Zelenko [Wed, 16 Aug 2017 22:07:40 +0000 (22:07 +0000)]
[Analysis] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311048
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 16 Aug 2017 21:52:07 +0000 (21:52 +0000)]
[InstCombine] Make folding (X >s -1) ? C1 : C2 --> ((X >>s 31) & (C2 - C1)) + C1 support splat vectors
This also uses decomposeBitTestICmp to decode the compare.
Differential Revision: https://reviews.llvm.org/D36781
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311044
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 16 Aug 2017 20:50:23 +0000 (20:50 +0000)]
[ADCE][Dominators] Teach ADCE to preserve dominators
Summary:
This patch teaches ADCE to preserve both DominatorTrees and PostDominatorTrees.
I didn't notice any performance impact when bootstrapping clang with this patch.
Reviewers: dberlin, chandlerc, sanjoy, davide, grosser, brzycki
Reviewed By: davide
Subscribers: grandinj, zhendongsu, llvm-commits, david2050
Differential Revision: https://reviews.llvm.org/D35869
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311039
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 16 Aug 2017 20:50:01 +0000 (20:50 +0000)]
[MachineCopyPropagation] Extend pass to do COPY source forwarding
This change extends MachineCopyPropagation to do COPY source forwarding.
This change also extends the MachineCopyPropagation pass to be able to
be run during register allocation, after physical registers have been
assigned, but before the virtual registers have been re-written, which
allows it to remove virtual register COPY LiveIntervals that become dead
through the forwarding of all of their uses.
Reviewers: qcolombet, javed.absar, MatzeB, jonpa
Subscribers: jyknight, nemanjai, llvm-commits, nhaehnle, mcrosier, mgorny
Differential Revision: https://reviews.llvm.org/D30751
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311038
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Wed, 16 Aug 2017 19:13:45 +0000 (19:13 +0000)]
[CMake][runtimes] Support for building target variants
This can be used to build non-sanitized and sanitized versions of
runtimes, where sanitized versions use the just built sanitizer
which in turn may use the non-sanitized version.
Differential Revision: https://reviews.llvm.org/D36348
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311036
91177308-0d34-0410-b5e6-
96231b3b80d8
Geoff Berry [Wed, 16 Aug 2017 19:03:16 +0000 (19:03 +0000)]
[LoopDataPrefetch][AArch64FalkorHWPFFix] Preserve ScalarEvolution
Summary:
Mark LoopDataPrefetch and AArch64FalkorHWPFFix passes as preserving
ScalarEvolution since they do not alter loop structure and should not
alter any SCEV values (though LoopDataPrefetch may introduce new
instructions that won't have cached SCEV values yet).
This can result in slight code differences, mainly w.r.t. nsw/nuw flags
on SCEVs, since these are computed somewhat lazily when a zext/sext
instruction is encountered. As a result, passes after the modified
passes may see SCEVs with more nsw/nuw flags present.
Reviewers: sanjoy, anemet
Subscribers: aemerson, rengolin, mzolotukhin, javed.absar, kristof.beyls, mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D36716
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311032
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Wed, 16 Aug 2017 19:01:22 +0000 (19:01 +0000)]
[mips] Handle R_MIPS_TLS_DTPREL32/64 relocations in the RelocVisitor
Debug information for TLS variables on MIPS might have R_MIPS_TLS_DTPREL32
or R_MIPS_TLS_DTPREL64 relocations. This patch adds a support for such
relocations in the `RelocVisitor`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311031
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 16 Aug 2017 17:43:01 +0000 (17:43 +0000)]
Add a convenience overload of DWARFDie::dump() for debugging purposes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311026
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 16 Aug 2017 17:33:43 +0000 (17:33 +0000)]
Add more comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311025
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Wed, 16 Aug 2017 17:18:01 +0000 (17:18 +0000)]
[PGO] Fix ThinLTO crash
Differential Revsion: http://reviews.llvm.org/D36640
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311023
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Mankov [Wed, 16 Aug 2017 16:47:29 +0000 (16:47 +0000)]
[AMDGPU] NFC: test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311019
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Wed, 16 Aug 2017 16:23:32 +0000 (16:23 +0000)]
AMDGPU/NFC: Sort files in CMakeLists.txt alphabetically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311017
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 16 Aug 2017 16:22:19 +0000 (16:22 +0000)]
[X86] Regenerate immediate store merging tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311016
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Kuderski [Wed, 16 Aug 2017 16:12:52 +0000 (16:12 +0000)]
[Dominators] Introduce batch updates
Summary:
This patch introduces a way of informing the (Post)DominatorTree about multiple CFG updates that happened since the last tree update. This makes performing tree updates much easier, as it internally takes care of applying the updates in lockstep with the (virtual) updates to the CFG, which is done by reverse-applying future CFG updates.
The batch updater is able to remove redundant updates that cancel each other out. In the future, it should be also possible to reorder updates to reduce the amount of work needed to perform the updates.
Reviewers: dberlin, sanjoy, grosser, davide, brzycki
Reviewed By: brzycki
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D36167
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311015
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 16 Aug 2017 16:09:22 +0000 (16:09 +0000)]
[BDCE] Don't check demanded bits on unsized types
To clear assumptions that are potentially invalid after trivialization, we need
to walk the use/def chain. Normally, the only way to reach an instruction with
an unsized type is via an instruction that has side effects (or otherwise will
demand its input bits). That would stop the walk. However, if we have a
readnone function that returns an unsized type (e.g., void), we must avoid
asking for the demanded bits of the function call's return value. A
void-returning readnone function is always dead (and so we can stop walking the
use/def chain here), but the check is necessary to avoid asserting.
Fixes PR34211.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311014
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 16 Aug 2017 15:16:33 +0000 (15:16 +0000)]
[Verifier] Reject globals without a type associated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311012
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Wed, 16 Aug 2017 15:16:32 +0000 (15:16 +0000)]
[AMDGPU][MC][GFX9] Added op_sel support for v_mad_*16, v_fma_f16, v_div_fixup_f16
This change implements features postponed in https://reviews.llvm.org/D35424 because of a dependency on https://reviews.llvm.org/D36322
Reviewers: SamWot, artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D36694
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311011
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 16 Aug 2017 14:28:23 +0000 (14:28 +0000)]
[DemandedBits] simplify call; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311009
91177308-0d34-0410-b5e6-
96231b3b80d8
Balaram Makam [Wed, 16 Aug 2017 14:17:43 +0000 (14:17 +0000)]
Revert "MachineInstr: Reason locally about some memory objects before going to AA."
r310825 caused the clang-ppc64le-linux-lnt bot to go red
(http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/5712)
because of a test-suite failure of
SingleSource/UnitTests/2003-07-09-SignedArgs
This reverts commit
0028f6a87224fb595a1c19c544cde9b003035996.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311008
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Wed, 16 Aug 2017 13:51:56 +0000 (13:51 +0000)]
[AMDGPU][MC][GFX9] Added integer clamping support for VOP3 opcodes
See Bug 34152: https://bugs.llvm.org//show_bug.cgi?id=34152
Reviewers: SamWot, artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D36674
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311006
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Wed, 16 Aug 2017 13:50:20 +0000 (13:50 +0000)]
[CostModel][X86][XOP] Improve costs for XOP shuffles
VPPERM/VPERMIL2PD/VPERMIL2PS all provide more effective 2-input shuffles than regular AVX instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311005
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Wed, 16 Aug 2017 13:39:07 +0000 (13:39 +0000)]
[DI] Every DIGlobalVariable should have a type.
I'll make this a verifier check to catch other violations. This
commit fixes the tests already in tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311004
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Wed, 16 Aug 2017 12:18:04 +0000 (12:18 +0000)]
[mips] Handle variables with an explicit section and interactions with .sdata, .sbss
If a variable has an explicit section such as .sdata or .sbss, it is placed
in that section and accessed in a gp relative manner. This overrides the global
-G setting.
Otherwise if a variable has a explicit section attached to it, such as '.rodata'
or '.mysection', it is not placed in the small data section. This also overrides
the global -G setting.
Reviewers: atanasyan, nitesh.jain
Differential Revision: https://reviews.llvm.org/D36616
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311001
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Parker [Wed, 16 Aug 2017 07:42:44 +0000 (07:42 +0000)]
[ARM] Improve loop unrolling for Cortex-M
- Set the default runtime unroll count to 4 and use the newly added
UnrollRemainder option.
- Create loop cost and force unroll for a cost less than 12.
- Disable unrolling on Thumb1 only targets.
Differential Revision: https://reviews.llvm.org/D36134
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310997
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Wed, 16 Aug 2017 07:25:51 +0000 (07:25 +0000)]
[GlobalISel][X86] Fix mir tests, use correct physical register.NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310996
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 16 Aug 2017 05:22:49 +0000 (05:22 +0000)]
[COFF] Make the weak aliases optional
When creating an import library from lld, the cases with
Name != ExtName shouldn't end up as a weak alias, but as a real
export of the new name, which is what actually is exported from
the DLL.
This restores the behaviour of renamed exports to what it was in
4.0.
The other half of this commit, including test, goes into lld.
Differential Revision: https://reviews.llvm.org/D36633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310991
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 16 Aug 2017 05:18:36 +0000 (05:18 +0000)]
[llvm-dlltool] Fix creating stdcall/fastcall import libraries for i386
Hook up the -k option (that in the original GNU dlltool removes the
@n suffix from the symbol that the final executable ends up linked to).
In llvm-dlltool, make sure that functions end up with the undecorate
name type if this option is set and they are decorated. In mingw, when
creating import libraries from def files instead of creating an import
library as a side effect of linking a DLL, the symbol names in the def
contain the stdcall/fastcall decoration (but no leading underscore).
By setting the undecorate name type, a linker linking to the import
library will omit the decoration from the DLL import entry.
With this in place, mingw-w64 for i386 built with llvm-dlltool/clang
produces import libraries that actually work.
Differential Revision: https://reviews.llvm.org/D36548
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310990
91177308-0d34-0410-b5e6-
96231b3b80d8
Martin Storsjo [Wed, 16 Aug 2017 05:13:16 +0000 (05:13 +0000)]
[COFF] Add SymbolName as a distinct field in COFFImportFile
The previous Name and ExtName aren't enough to convey all the nuances
between weak aliases and stdcall decorated function names.
A test for this will be added in LLD.
Differential Revision: https://reviews.llvm.org/D36544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310988
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Wed, 16 Aug 2017 04:43:49 +0000 (04:43 +0000)]
[AMDGPU] Eliminate no effect instructions before s_endpgm
Differential Revision: https://reviews.llvm.org/D36585
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310987
91177308-0d34-0410-b5e6-
96231b3b80d8
Dehao Chen [Wed, 16 Aug 2017 01:55:26 +0000 (01:55 +0000)]
Merge debug info when hoist then-else code to if.
Summary: When we move then-else code to if, we need to merge its debug info, otherwise the hoisted instruction may have inaccurate debug info attached.
Reviewers: aprantl, probinson, dblaikie, echristo, loladiro
Reviewed By: aprantl
Subscribers: sanjoy, llvm-commits
Differential Revision: https://reviews.llvm.org/D36778
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310985
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Wed, 16 Aug 2017 00:49:44 +0000 (00:49 +0000)]
[WebAssembly] Remove infinite loop from reg-stackify test
r310940 exposed reverse-unreachable code to some optimizers,
which caused some of the code in this test to be sunk, changing
the input to the pass and breaking the exptectations.
Since that change is irrelevant to this particular test, this change
just adds an exit node to work around the problem; the
test should really be more robust (or be an MIR test?) but this preserves
the existing test intent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310981
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Wed, 16 Aug 2017 00:17:05 +0000 (00:17 +0000)]
[VirtRegRewriter] Properly model the register liveness on undef subreg definition
Undef subreg definition means that the content of the super register
doesn't matter at this point. While that's true for virtual registers,
this may not hold when replacing them with actual physical registers.
Indeed, some part of the physical register may be coalesced with the
related virtual register and thus, the values for those parts matter and
must be live.
The fix consists in checking whether or not subregs of the physical register
being assigned to an undef subreg definition are live through that def and
insert an implicit use if they are. Doing so, will keep them alive until
that point like they should be.
E.g., let vreg14 being assigned to R0_R1 then
%vreg14:gsub_0<def,read-undef> = COPY %R0 ; <-- R1 is still live here
%vreg14:gsub_1<def> = COPY %R1
Before this changes, the rewriter would change the code into:
%R0<def> = KILL %R0, %R0_R1<imp-def> ; <-- this tells R1 is redefined
%R1<def> = KILL %R1, %R0_R1<imp-def>, %R0_R1<imp-use> ; this value of this R1
; is believed to come
; from the previous
; instruction
Because of this invalid liveness, later pass could make wrong choices and in
particular clobber live register as it happened with the register scavenger in
llvm.org/PR34107
Now we would generate:
%R0<def> = KILL %R0, %R0_R1<imp-def>, %R0_R1<imp-use> ; This tells R1 needs to
; reach this point
%R1<def> = KILL %R1, %R0_R1<imp-def>, %R0_R1<imp-use>
The bug has been here forever, it got exposed recently because the register
scavenger got smarter.
Fixes llvm.org/PR34107
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310979
91177308-0d34-0410-b5e6-
96231b3b80d8
Kuba Mracek [Tue, 15 Aug 2017 23:41:34 +0000 (23:41 +0000)]
Revert archive-* tests from r310953, there were test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310974
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 15 Aug 2017 22:48:41 +0000 (22:48 +0000)]
[InstCombine] Teach canEvaluateZExtd and canEvaluateTruncated to handle vector shifts with splat shift amount
We were only allowing ConstantInt before. This patch allows splat of ConstantInt too.
Differential Revision: https://reviews.llvm.org/D36763
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310970
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Tue, 15 Aug 2017 22:31:51 +0000 (22:31 +0000)]
Reapply "[GlobalISel] Remove the GISelAccessor API."
This reverts commit r310425, thus reapplying r310335 with a fix for link
issue of the AArch64 unittests on Linux bots when BUILD_SHARED_LIBS is ON.
Original commit message:
[GlobalISel] Remove the GISelAccessor API.
Its sole purpose was to avoid spreading around ifdefs related to
building global-isel. Since r309990, GlobalISel is not optional anymore,
thus, we can get rid of this mechanism all together.
NFC.
----
The fix for the link issue consists in adding the GlobalISel library in
the list of dependencies for the AArch64 unittests. This dependency
comes from the use of AArch64Subtarget that needs to know how
to destruct the GISel related APIs when being detroyed.
Thanks to Bill Seurer and Ahmed Bougacha for helping me reproducing and
understand the problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310969
91177308-0d34-0410-b5e6-
96231b3b80d8
Charles Saternos [Tue, 15 Aug 2017 22:23:44 +0000 (22:23 +0000)]
[ThinLTO] Fix ThinLTO crash while destroying context
Fix for PR32763
An assert that checks if a Ref was untracked fails during ThinLTO context cleanup. The issue is because lazy loading temporary nodes didn't properly track ValueAsMetadata nodes. This patch ensures that the temporary nodes are properly tracked when they're replaced with the value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310967
91177308-0d34-0410-b5e6-
96231b3b80d8
Kuba Mracek [Tue, 15 Aug 2017 21:02:17 +0000 (21:02 +0000)]
Revert changes in r310953 for llvm-symbolizer.test. The change causes a test failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310956
91177308-0d34-0410-b5e6-
96231b3b80d8
Tony Tye [Tue, 15 Aug 2017 20:47:41 +0000 (20:47 +0000)]
Update AMDGPUUsage.rst documentation:
1. Correct description of the kernel initial state for FLAT_SCRATCH_INIT.
2. Add link to GFX9 architecture documentation.
3. Update product names.
4. Rename note record from NT_AMD_AMDGPU_METADATA to NT_AMD_AMDGPU_HSA_METADATA and move description to the AMDHSA coding convention section.
5. Minor typo corrections.
Differential Revision: https://reviews.llvm.org/D36549
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310954
91177308-0d34-0410-b5e6-
96231b3b80d8
Kuba Mracek [Tue, 15 Aug 2017 20:29:24 +0000 (20:29 +0000)]
[llvm] Get rid of "%T" expansions
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.
This patch removes %T in llvm.
Differential Revision: https://reviews.llvm.org/D36495
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310953
91177308-0d34-0410-b5e6-
96231b3b80d8
Amjad Aboud [Tue, 15 Aug 2017 19:33:14 +0000 (19:33 +0000)]
[InstCombine] Added support for (X >>s C) << C --> X & (-1 << C)
Differential Revision: https://reviews.llvm.org/D36743
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310949
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 15 Aug 2017 19:20:10 +0000 (19:20 +0000)]
[ORC][Kaleidoscope] Update Chapter 1 of BuildingAJIT to incorporate recent ORC
API changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310947
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 15 Aug 2017 18:25:52 +0000 (18:25 +0000)]
[InstCombine] sink sext after ashr
Narrow ops are better for bit-tracking, and in the case of vectors,
may enable better codegen.
As the trunc test shows, this can allow follow-on simplifications.
There's a block of code in visitTrunc that deals with shifted ops
with FIXME comments. It may be possible to remove some of that now,
but I want to make sure there are no problems with this step first.
http://rise4fun.com/Alive/Y3a
Name: hoist_ashr_ahead_of_sext_1
%s = sext i8 %x to i32
%r = ashr i32 %s, 3 ; shift value is < than source bit width
=>
%a = ashr i8 %x, 3
%r = sext i8 %a to i32
Name: hoist_ashr_ahead_of_sext_2
%s = sext i8 %x to i32
%r = ashr i32 %s, 8 ; shift value is >= than source bit width
=>
%a = ashr i8 %x, 7 ; so clamp this shift value
%r = sext i8 %a to i32
Name: junc_the_trunc
%a = sext i16 %v to i32
%s = ashr i32 %a, 18
%t = trunc i32 %s to i16
=>
%t = ashr i16 %v, 15
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310942
91177308-0d34-0410-b5e6-
96231b3b80d8