Commit Graph

148174 Commits

Author SHA1 Message Date
Adrian Prantl
478111bfa7 Add a testcase for DIExpression(DW_OP_stack_value)
and relax the assertion that prohibited its emission.

This fixes the assertion failure uncovered by r301093.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:11:38 +00:00
Matt Arsenault
efcdf5ecd6 AMDGPU: Add StackPtr and FramePtr registers to MFI
These will be necessary for setting up call sequences.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301208 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:05:16 +00:00
Matt Arsenault
666020a37d AMDGPU: Move trap lowering to DAG
Fixes traps in any block besides the entry block,
and fixes depending on a live-in physical register
by using a virtual register copy.

Also happens to stop emitting a nop in the case
debug trap is not supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:49:13 +00:00
Davide Italiano
c180879c54 [DomPrinter] Add a way to programmatically dump a dot representation.
Differential Revision:  https://reviews.llvm.org/D32145

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:48:44 +00:00
Zachary Turner
41374872ac [llvm-pdbdump] Merge functionality of graphical and text dumpers.
The *real* difference between these two was that

a) The "graphical" dumper could recurse, while the text one could
   not.
b) The "text" dumper could display nested types and functions,
   while the graphical one could not.

Merge these two so that there is only one dumper that can recurse
arbitrarily deep and optionally display nested types or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:47:52 +00:00
Zachary Turner
0e8b7073e9 [llvm-pdbdump] Re-write the record layout code to be more resilient.
This reworks the way virtual bases are handled, and also the way
padding is detected across multiple levels of aggregates, producing
a much more accurate result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301203 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:47:24 +00:00
Craig Topper
36e5af50c1 [APInt] Simplify the zext and sext methods
This replaces a hand written copy loop with a call to memcpy for both zext and sext.

For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits.

Differential Revision: https://reviews.llvm.org/D32417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301201 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:37:10 +00:00
George Karpenkov
e6dc33fc17 Testing commit credentials
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:28:32 +00:00
Matt Arsenault
772deb9cd5 InstCombine: Fix assert when reassociating fsub with undef
There is logic to track the expected number of instructions
produced. It thought in this case an instruction would
be necessary to negate the result, but here it folded
into a ConstantExpr fneg when the non-undef value operand
was cancelled out by the second fsub.

I'm not sure why we don't fold constant FP ops with undef currently,
but I think that would also avoid this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301199 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:24:37 +00:00
Craig Topper
f322f9268c [APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ashrInPlace.
This patch adds an in place version of ashr to match lshr and shl which were recently added.

I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting.

Differential Revision: https://reviews.llvm.org/D32415

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:18:47 +00:00
Nicolai Haehnle
c3187b408e AMDGPU: Move v_readlane lane select from VGPR to SGPR
Summary:
Fix a compiler bug when the lane select happens to end up in a VGPR.

Clarify the semantic of the corresponding intrinsic to be that of
the corresponding GLSL: the lane select must be uniform across a
wave front, otherwise results are undefined.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D32343

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:17:36 +00:00
Xin Tong
fa273182f4 Compute safety information in a much finer granularity.
Summary:
Instead of keeping a variable indicating whether there are early exits
in the loop.  We keep all the early exits. This improves LICM's ability to
move instructions out of the loop based on is-guaranteed-to-execute.

I am going to update compilation time as well soon.

Reviewers: hfinkel, sanjoy, efriedma, mkuper

Reviewed By: hfinkel

Subscribers: llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D32433

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301196 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:12:22 +00:00
Nicolai Haehnle
7b717b6e43 InstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}
Summary:
The return value of these intrinsics should always have 0 bits for
inactive threads. This means that when all arguments are constant
and the comparison evaluates to true, the intrinsic should return
the current exec mask.

Fixes some GL_ARB_shader_ballot tests.

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

Differential Revision: https://reviews.llvm.org/D32344

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301195 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:08:43 +00:00
Igor Breger
8978f2978f [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.
Summary: [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.

Reviewers: zvi, t.p.northover, guyblank

Reviewed By: t.p.northover

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

Differential Revision: https://reviews.llvm.org/D32288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301194 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:05:52 +00:00
Simon Pilgrim
e5d13111d7 [DAGCombiner] Updated bswap byte offset variable names to be more descriptive. NFC
As discussed on D32039, use MaskByteOffset to describe the variable and also pull out repeated getOpcode() calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301193 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:05:14 +00:00
Craig Topper
e115996cce [APInt] Fix repeated word in comments. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301192 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:00:22 +00:00
Nicolai Haehnle
1c1f7ef631 AMDGPU: Fix crash when scheduling non-memory SMRD instructions
Summary: Fixes piglit spec/arb_shader_clock/execution/*

Reviewers: arsenm

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

Differential Revision: https://reviews.llvm.org/D32345

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301191 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 16:53:52 +00:00
Nirav Dave
a43d9cd666 [SDAG] Teach Chain Analysis about BaseIndexOffset addressing.
While we use BaseIndexOffset in FindBetterNeighborChains to
appropriately realize they're almost the same address and should be
improved concurrently we do not use it in isAlias using the non-index
understanding FindBaseOffset instead. Adding a BaseIndexOffset check
in isAlias like should allow indexed stores to be merged.

FindBaseOffset to be excised in subsequent patch.

Reviewers: jyknight, aditya_nandakumar, bogner

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31987

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 15:37:20 +00:00
Simon Pilgrim
8073bf67dd [X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructions
Had to split btver2/znver1 checks as only btver2 suppresses zeroupper

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301181 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 14:26:30 +00:00
Jonas Paulsson
ecf0e93d1f [SystemZ] Update kill-flag in splitMove().
EarlierMI needs to clear the kill flag on the first operand in case of a store.

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301177 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 12:40:28 +00:00
Renato Golin
a26ca6fe0b [DWARF] Move test to x86 directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301176 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 12:37:11 +00:00
Philip Pfaffe
f114918df8 [RegionInfo] Fix dangling references created by moving RegionInfo objects
Summary: Region objects capture the address of the creating RegionInfo instance. Because the RegionInfo class is movable, moving a RegionInfo object creates dangling references. This patch fixes these references by walking the Regions post-move, and updating references to the new parent.

Reviewers: Meinersbur, grosser

Reviewed By: Meinersbur, grosser

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31719

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 11:54:37 +00:00
Ismail Donmez
63dc9141ba Add SUSE vendor
Summary: SUSE's ARM triples end with -gnueabi even though they are hard-float. This requires special handling of SUSE ARM triples. Hence we need a way to differentiate the SUSE as vendor. This CL adds that.

Reviewers: chandlerc, compnerd, echristo, rengolin

Reviewed By: rengolin

Subscribers: aemerson, rengolin, llvm-commits

Differential Revision: https://reviews.llvm.org/D32426

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 11:18:29 +00:00
Nitesh Jain
2f681da9f4 [LLVM][MIPS] Fix different definition of off_t in LLDB and LLVM.
Reviewers: beanz

Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste

Differential Revision: https://reviews.llvm.org/D32125

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301171 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 10:36:46 +00:00
George Rimar
6ffaaaaee1 [DWARF] - Take relocations in account when extracting ranges from .debug_ranges
I found this when investigated "Bug 32319 - .gdb_index is broken/incomplete" for LLD.

When we have object file with .debug_ranges section it may be filled with zeroes.
Relocations are exist in file to relocate this zeroes into real values later, but until that
a pair of zeroes is treated as terminator. And DWARF parser thinks there is no ranges at all
when I am trying to collect address ranges for building .gdb_index.

Solution implemented in this patch is to take relocations in account when parsing ranges.

Differential revision: https://reviews.llvm.org/D32228

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301170 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 10:19:45 +00:00
Diana Picus
c1f12989a6 [ARM] GlobalISel: Legalize s8 and s16 G_(S|U)DIV
We have to widen the operands to 32 bits and then we can either use
hardware division if it is available or lower to a libcall otherwise.

At the moment it is not enough to set the Legalizer action to
WidenScalar, since for libcalls it won't know what to do (it won't be
able to find what size to widen to, because it will find Libcall and not
Legal for 32 bits). To hack around this limitation, we request Custom
lowering, and as part of that we widen first and then we run another
legalizeInstrStep on the widened DIV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 09:12:19 +00:00
Sjoerd Meijer
8e5f1d4de2 [Arch64AsmParser] better diagnostic for isb
Instruction isb takes as an operand either 'sy' or an immediate value. This
improves the diagnostic when the string is not 'sy' and adds a test case for
this which was missing. This also adds tests to check invalid inputs for dsb
and dmb.

Differential Revision: https://reviews.llvm.org/D32227


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 08:22:20 +00:00
Diana Picus
eaf78a2f04 [ARM] GlobalISel: Support G_(S|U)DIV for s32
Add support for both targets with hardware division and without. For
hardware division we have to add support throughout the pipeline
(legalizer, reg bank select, instruction select). For targets without
hardware division, we only need to mark it as a libcall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 08:20:05 +00:00
Diana Picus
68724fc353 [GlobalISel] Legalize G_(S|U)DIV libcalls
Treat them the same as the other binary operations that we have so far,
but on integers rather than floating point types. Extract the common
code into a helper.

This will be used in the ARM backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 07:22:31 +00:00
Diana Picus
b9c5aa7d0d [ARM] GlobalISel: Select G_CONSTANT with CImm operands
When selecting a G_CONSTANT to a MOVi, we need the value to be an Imm
operand. We used to just leave the G_CONSTANT operand unchanged, which
works in some cases (such as the GEP offsets that we create when
referring to stack slots). However, in many other places the G_CONSTANTs
are created with CImm operands. This patch makes sure to handle those as
well, and to error out gracefully if in the end we don't end up with an
Imm operand.

Thanks to Oliver Stannard for reporting this issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301162 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 06:30:56 +00:00
Dean Michael Berris
0d479b0056 [XRay][tools] Fixup for pedantic and permissive errors/warnings
Remove extraneous semicolons and fully qualify the Trace type.

Follow-up to D29320.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301161 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 06:15:53 +00:00
Dean Michael Berris
ae0fbfb1fb [XRay] A tool for Comparing xray function call graphs
Summary:
This is a tool for comparing the function graphs produced by the
llvm-xray graph too. It takes the form of a new subcommand of the
llvm-xray tool 'graph-diff'.

This initial version of the patch is very rough, but it is close to
feature complete.

Depends on D29363

Reviewers: dblaikie, dberris

Reviewed By: dberris

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29320

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301160 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 05:54:33 +00:00
Craig Topper
6a61317c63 [APInt] Make behavior of ashr by BitWidth consistent between single and multi word.
Previously single word would always return 0 regardless of the original sign. Multi word would return all 0s or all 1s based on the original sign. Now single word takes into account the sign as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 05:38:26 +00:00
Frederich Munch
ccb223e38e Revert "Refactor DynamicLibrary so searching for a symbol will have a defined order.”
The changes are causing the i686-mingw32 build to fail.

This reverts commit r301153, and the changes for a separate warning on i686-mingw32 in r301155  and r301156.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 03:33:30 +00:00
Frederich Munch
bffb4d4e84 Fix warning converting from boolean to pointer introduced in r301153.
This reverts commit r301155, which was incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 03:12:16 +00:00
Frederich Munch
478f822a4d Fix warning converting from void* to boolean introduced in r301153.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301155 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 02:51:40 +00:00
Sanjoy Das
86b13b4b4f Revert "[SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds"
This reverts commit r301150.  It breaks CodeGen/Hexagon/hwloop-wrap2.ll, reverting
while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301154 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 02:35:19 +00:00
Frederich Munch
545de00b4b Refactor DynamicLibrary so searching for a symbol will have a defined order and
libraries are properly unloaded when llvm_shutdown is called.

Summary:
This was mostly affecting usage of the JIT, where storing the library handles in
a set made iteration unordered/undefined. This lead to disagreement between the
JIT and native code as to what the address and implementation of particularly on
Windows with stdlib functions:

JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
not giving priority to the process' symbols as it did on Unix.

Reviewers: chapuni, v.g.vassilev, lhames

Reviewed By: lhames

Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

Differential Revision: https://reviews.llvm.org/D30107

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301153 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 02:30:12 +00:00
Lang Hames
dd358f5cfd [Orc] Fix a warning by removing an unused lambda capture.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301152 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 01:21:23 +00:00
Sanjoy Das
0e8cd85fc0 Fix unused variables / fields warnings in release builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301151 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 00:46:40 +00:00
Sanjoy Das
57106e7963 [SCEV] Enable SCEV verification by default in EXPENSIVE_CHECKS builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 00:41:58 +00:00
Sanjoy Das
de62d73fb7 [SCEV] Fix exponential time complexity by caching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301149 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 00:09:46 +00:00
Xinliang David Li
0cb27bba3d [PartialInine]: add triaging options
There are more bugs (runtime failures) triggered when partial
inlining is turned on. Add options to help triaging problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 23:39:04 +00:00
Lang Hames
1936b28dbf [Orc] Use recursive mutexes for Error serialization.
Errors can be nested, so we need recursive locking for serialization /
deserialization.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301147 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 23:36:13 +00:00
Sanjoy Das
0f49a66c42 [SCEV] Move towards a verifier without false positives
This change reboots SCEV's current (off by default) verification logic
to avoid false failures.  Instead of stringifying trip counts, it maps
old and new trip counts to the same ScalarEvolution "universe" and
asks ScalarEvolution to compute the difference between them.  If the
difference comes out to be a non-zero constant, then (barring some
corner cases) we *know* we messed up.

I've not yet enabled this by default since it hits an exponential time
issue in SCEV, but once I fix that, I'll flip it on by default in
EXPENSIVE_CHECKS builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301146 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 23:04:45 +00:00
Simon Pilgrim
84468c22d8 [X86][AVX] Add scheduling latency/throughput tests for some AVX1 instructions
More instructions will be added in future commits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301145 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 22:08:17 +00:00
Sanjay Patel
f7a9048833 [InstCombine] add/move folds for [not]-xor
We handled all of the commuted variants for plain xor already,
although they were scattered around and sometimes folded less
efficiently using distributive laws. We had no folds for not-xor.

Handling all of these patterns consistently is part of trying to 
reinstate:
https://reviews.llvm.org/rL300977


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 22:00:02 +00:00
Xinliang David Li
33d67f1348 [PartialInlining] Add optimization remark support
Differential Revision: http://reviews.llvm.org/D32387


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301143 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 21:40:58 +00:00
Simon Pilgrim
4396307c0e [X86][SSE] Add scheduler class support for SSE42 (PCMPGT) instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301142 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 21:23:27 +00:00
Simon Pilgrim
f8b00dbd59 [X86][SSE] Add scheduling latency/throughput tests for (most) SSE42 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 21:00:25 +00:00