Commit Graph

128183 Commits

Author SHA1 Message Date
Tom Stellard
1d53227930 [AMDGPU][llvm-mc] Support for 32-bit inline literals
Patch by: Artem Tamazov

Summary:
Note: Support for 64-bit inline literals TBD
Added: Support of abs/neg modifiers for literals (incomplete; parsing TBD).
Added: Some TODO comments.
Reworked/clarity: rename isInlineImm() to isInlinableImm()
Reworked/robustness: disallow BitsToFloat() with undefined value in isInlinableImm()
Reworked/reuse: isSSrc32/64(), isVSrc32/64()
Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, nhaustov, SamWot, arsenm

Projects: #llvm-amdgpu-spb

Differential Revision: http://reviews.llvm.org/D17204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261559 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 19:17:56 +00:00
Tom Stellard
52b2fdbe17 [AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.
Patch by: Artem Tamazov

Summary: Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, SamWot, #llvm-amdgpu-spb

Projects: #llvm-amdgpu-spb

Differential Revision: http://reviews.llvm.org/D17271

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261558 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 19:17:53 +00:00
Tom Stellard
58ca760083 docs/AMDGPUUsage: Update assembly example
Reviewers: arsenm, nhaustov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17461

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:36:00 +00:00
Justin Lebar
0bbc549035 Revert "[attrs] Handle convergent CallSites."
This reverts r261544, which was causing a test failure in
Transforms/FunctionAttrs/readattrs.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:24:43 +00:00
Justin Lebar
406b3fe7ae Revert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv."
This reverts r261543.  Accidental commit (not LGTM'ed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:17:27 +00:00
Nemanja Ivanovic
94db889776 Fix for PR26690 take 2
This is what was meant to be in the initial commit to fix this bug. The
parens were missing. This commit also adds a test case for the bug and
has undergone full testing on PPC and X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 18:04:00 +00:00
Justin Lebar
4644890a51 [attrs] Handle convergent CallSites.
Summary:
Previously we had a notion of convergent functions but not of convergent
calls.  This is insufficient to correctly analyze calls where the target
is unknown, e.g. indirect calls.

Now a call is convergent if it targets a known-convergent function, or
if it's explicitly marked as convergent.  As usual, we can remove
convergent where we can prove that no convergent operations are
performed in the call.

Reviewers: chandlerc, jingyue

Subscribers: hfinkel, jhen, tra, llvm-commits

Differential Revision: http://reviews.llvm.org/D17317

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:35 +00:00
Justin Lebar
4485e598b6 [ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.
Summary:
Also add a comment briefly explaining what ifcnv is.

No functional changes.

Reviewers: resistor

Subscribers: echristo, tra, llvm-commits

Differential Revision: http://reviews.llvm.org/D17430

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:30 +00:00
Justin Lebar
d1a3737547 [ifcnv] Use unique_ptr in IfConversion. NFC
Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17466

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:51:28 +00:00
Justin Lebar
6aa1e32f4a Don't tail-duplicate blocks that contain convergent instructions.
Summary:
Convergent instrs shouldn't be made control-dependent on other values,
but this is basically the whole point of tail duplication.  So just bail
if we see a convergent instruction.

Reviewers: iteratee

Subscribers: jholewinski, jhen, hfinkel, tra, jingyue, llvm-commits

Differential Revision: http://reviews.llvm.org/D17320

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:50:52 +00:00
Dan Gohman
125ad6e3d9 [WebAssembly] Properly ignore llvm.dbg.value instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261538 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 17:45:20 +00:00
Sanjoy Das
e9d736f57c [ConstantRange] Rename a method and add more doc
Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion,
and add a comment about the counter-intuitive aspects of the function.
This is to help prevent cases like PR26628.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 16:13:02 +00:00
Zoran Jovanovic
5fa0e4be6e [mips] added support for trunc macro
Author: obucina
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D15745


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 16:00:23 +00:00
Nemanja Ivanovic
485b73c671 Revert bad fix for PR26690.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 15:06:32 +00:00
Nemanja Ivanovic
6bf5860c4e Fix for PR26690
I mistook BitVector::empty() to mean BitVector::count() == 0 and it does
not. Corrected the issue with the fix for PR26500.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 14:47:49 +00:00
Benjamin Kramer
b0ce7c7fb5 Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261524 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 13:11:58 +00:00
Igor Breger
54e0fe8d68 AVX512F: Add assembler Intel syntax tests for knl, fix minor bugs.
Differential Revision: http://reviews.llvm.org/D17498

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 12:37:41 +00:00
Igor Breger
2ec70dbae0 AVX512: Fix scalar mem operands.
Differential Revision: http://reviews.llvm.org/D17500

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 11:48:27 +00:00
Elena Demikhovsky
8659296d0e Allow setting MaxRerollIterations above 16
By Ayal Zaks.

Differential Revision http://reviews.llvm.org/D17258



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 09:38:28 +00:00
Craig Topper
3e936408dd [X86] Minor formatting fix. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 08:00:04 +00:00
Tobias Grosser
dae2e1d530 Use EXPECT_EQ in the unittests instead of plain assert
This addresses post-review comments from Duncan P. N. Exon Smith to r261485.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 07:20:40 +00:00
Duncan P. N. Exon Smith
65b18dd93d Reapply "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
This reverts commit r261510, effectively reapplying r261509.  The
original commit missed a caller in AArch64ConditionalCompares.

Original commit message:

Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 03:33:28 +00:00
Duncan P. N. Exon Smith
01f8c42f80 Revert "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
This reverts commit r261509.  I'm not sure how this compiled locally,
but something was out of whack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 03:12:42 +00:00
Duncan P. N. Exon Smith
8c34e067a7 CodeGen: Use references in MachineTraceMetrics::Trace, NFC
Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 03:07:49 +00:00
Duncan P. N. Exon Smith
d2c0ad9eb4 CodeGen: Explicitly convert from iterator to pointer, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 02:53:42 +00:00
Duncan P. N. Exon Smith
17ef67672c Document assumption in X86FrameLowering::inlineStackProbe()
Resolve FIXME from r261504.  Apparently bundled instructions are illegal
here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160215/334146.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261507 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 02:32:35 +00:00
Kevin B. Smith
8e7d9b70e4 [X86] More test updates to support fixup-byte-word-insts optimization
either on or off.
Differential Revisions: http://reviews.llvm.org/D17458


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 01:27:56 +00:00
Duncan P. N. Exon Smith
6e5736e1aa CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC
Delete MachineInstr::getIterator(), since the term "iterator" is
overloaded when talking about MachineInstr.

- Downcast to ilist_node in iplist::getNextNode() and getPrevNode() so
  that ilist_node::getIterator() is still available.
- Add it back as MachineInstr::getInstrIterator().  This matches the
  naming in MachineBasicBlock.
- Add MachineInstr::getBundleIterator().  This is explicitly called
  "bundle" (not matching MachineBasicBlock) to disintinguish it clearly
  from ilist_node::getIterator().
- Update all calls.  Some of these I switched to `auto` to remove
  boiler-plate, since the new name is clear about the type.

There was one call I updated that looked fishy, but it wasn't clear what
the right answer was.  This was in X86FrameLowering::inlineStackProbe(),
added in r252578 in lib/Target/X86/X86FrameLowering.cpp.  I opted to
leave the behaviour unchanged, but I'll reply to the original commit on
the list in a moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 22:58:35 +00:00
Lang Hames
1d95ab2d6c [Orc] Add stack-realignment code to the i386 resolver function.
The resolver uses the fxsave/fxrstor instructions, which require 16-byte
alignment, to save SSE state to the stack. Since 16-byte alignment can't be
assumed on all OSes (and all i386 OSes share this function) - add code to
automatically bump the alignment to 16-bytes on entry to the function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 22:50:26 +00:00
Duncan P. N. Exon Smith
b64deed8bb CodeGen: Split bundle_iterator into a separate file, NFC
Split MachineBasicBlock::bundle_iterator into a separate file, and
rename the class to MachineBundleIterator.

This is a precursor to adding a `MachineInstr::getBundleIterator()`
accessor, which will eventually let us delete the final call to
getNodePtrUnchecked(), and then remove the UB from ilist_iterator.

As a drive-by, I removed an unnecessary second template parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 22:05:50 +00:00
Duncan P. N. Exon Smith
151a6ae8d1 CodeGen: Add constructor for MIBuilder from a bundle_iterator, NFC
Don't require explicit conversions for creating a MachineInstrBuilder
from a bundle_iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 21:15:37 +00:00
Duncan P. N. Exon Smith
7b83cb68d4 ADT: Disallow == and != between pointers and ilist iterators
I completely missed these non-class operators when I removed the
implicit conversions in r252380.  Remove them now.  r261498 should have
already removed all uses.

Note (repeated from r252380): if you have out-of-tree code, it should be
fairly easy to revert this patch downstream while you update your
out-of-tree call sites.  Note that these conversions are occasionally
latent bugs (that may happen to "work" now, but only because of getting
lucky with UB; follow-ups will change your luck).  When they are valid,
I suggest using `->getIterator()` to go from pointer to iterator, and
`&*` to go from iterator to pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 20:46:37 +00:00
Duncan P. N. Exon Smith
8de6150816 ADT: Remove == and != comparisons between ilist iterators and pointers
I missed == and != when I removed implicit conversions between iterators
and pointers in r252380 since they were defined outside ilist_iterator.

Since they depend on getNodePtrUnchecked(), they indirectly rely on UB.
This commit removes all uses of these operators.  (I'll delete the
operators themselves in a separate commit so that it can be easily
reverted if necessary.)

There should be NFC here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 20:39:50 +00:00
Duncan P. N. Exon Smith
d73d33fedf TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC
Stop relying on `getNodePtrUnchecked()` being useful on invalid
iterators.  This function is documented to be for internal use only, and
the pointer type will eventually have to change to remove UB from
ilist_iterator.  Instead, check the iterator before it has been
invalidated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 20:14:29 +00:00
Duncan P. N. Exon Smith
14147eda61 ADT: Stop using getNodePtrUnchecked on end() iterators
Stop using `getNodePtrUnchecked()` when building IR.  Eventually a
dereference will be required to get at the downcast node, since the
iterator will only store an `ilist_node_base` of some sort.

This should have no functionality change for now, but is a path towards
removing some more UB from ilist.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:52:15 +00:00
Craig Topper
cfaeacdafb [X86] Remove unused encoding types from disassembler. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:49:16 +00:00
Duncan P. N. Exon Smith
2d6fcba17e CodeGen: Avoid getNodePtrUnchecked() where we need a Value, NFC
`ilist_iterator<NodeTy>::getNodePtrUnchecked()` is documented as being
for internal use only, but CodeGenPrepare was using it anyway.  This
code relies on pulling out the `Value*` pointer even after the lifetime
of the iterator is over.  But having this pointer available in
ilist_iterator depends on UB in the first place.

Instead, safely pull out the `Value*` when the iterator is alive and
stop using the internal-only API.

There should be no functionality change here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:37:45 +00:00
Duncan P. N. Exon Smith
be77f42278 ADT: clang-format ilist_iterator, NFC
Also removed a couple of noisy (no-value-added) comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261492 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:26:08 +00:00
Duncan P. N. Exon Smith
729234413b ADT: Remove ilist_iterator random access API, NFC
Remove explicitly deleted random access API from ilist_iterator.
Since it no longer has implicit conversions to a pointer type, we
no longer need this protection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:23:18 +00:00
Simon Pilgrim
b9582ec27e [X86][AVX] Add shuffle masking support for EltsFromConsecutiveLoads
Add support for the case where we have a consecutive load (which must include the first + last elements) with a mixture of undef/zero elements. We load the vector and then apply a shuffle to clear the zero'd elements.

Differential Revision: http://reviews.llvm.org/D17297

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 19:15:48 +00:00
Tobias Grosser
679834bfcc ScalerEvolution: Only erase temporary values if they actually have been added
This addresses post-review comments from Sanjoy Das for r261485.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 18:50:09 +00:00
Tobias Grosser
bbe882c52c ScalarEvolution: Do not keep temporary PHI values in ValueExprMap
Before this patch simplified SCEV expressions for PHI nodes were only returned
the very first time getSCEV() was called, but later calls to getSCEV always
returned the non-simplified value, which had "temporarily" been stored in the
ValueExprMap, but was never removed and consequently blocked the caching of the
simplified PHI expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261485 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:42:10 +00:00
Sanjay Patel
fa7c411aab fix inaccurate comment; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:33:31 +00:00
Sanjay Patel
3c1ba0bbaa [InstCombine] add getNegativeIsTrueBoolVec() helper function; NFC
Originally part of:
http://reviews.llvm.org/D17485

We need this when simplifying masked memory ops too.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:29:33 +00:00
Sanjoy Das
1c5b38d20f Fix LLVM's handling and detection of skylake and cannonlake CPUs
Summary:
 - Rename `"skylake"` == SkylakeServerProc to `"skylake-avx512"`
 - Change `"skylake"` to denote SkylakeClientProc
 - Fix the detection of cpu family 6 and model 94 to be
   SkylakeClientProc instead of SkylakeServerProc
 - Remove the `"cnl"` for CannonLake

Reviewers: craig.topper, delena

Subscribers: zansari, echristo, qcolombet, RKSimon, spatel, DavidKreitzer, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D17090

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:12:03 +00:00
Sanjoy Das
745f68cc1a [LoopDeletion] Add an assert that verifies LCSSA
This is inspired by PR24804 -- had this assert been there before,
isolating the root cause for PR24804 would have been far easier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:11:59 +00:00
JF Bastien
31fee5e7e4 WebAssembly: update expected torture test failures
r261457 handles CopyToReg nodes with flag results in LowerCopyToReg, which was causing the SelectionDAGNodes assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 16:52:00 +00:00
Simon Pilgrim
9d73abc1df [InstCombine] Added SSE41 roundss/roundsd demanded vector elements invec tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261472 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 14:50:27 +00:00
Simon Pilgrim
f8acdf5d5a [InstCombine] Added XOP frczss/vfrczsd demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261469 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 12:45:36 +00:00
Simon Pilgrim
12144eb2cc [InstCombine] Added SSE41 roundss/roundsd demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 12:40:39 +00:00