Commit Graph

128022 Commits

Author SHA1 Message Date
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
Dan Gohman
a96dc7d5ad [WebAssembly] Support physical registers in the rewrite-to-discard optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 03:27:22 +00:00
Duncan P. N. Exon Smith
34cfdde1e9 IR: Add ConstantData, for operand-less Constants
Add a common parent `ConstantData` to the constants that have no
operands.  These are guaranteed to represent abstract data that is in no
way tied to a specific Module.

This is a good cleanup on its own.  It also makes it simpler to disallow
RAUW (and factor away use-lists) on these constants in the future.  (I
have some experimental patches that make RAUW illegal on ConstantData,
and they seem to catch a bunch of bugs...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 02:39:49 +00:00
David Majnemer
9f1a234a23 Unbreak non-X86 targets from fallout caused by r261462
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 01:40:04 +00:00
David Majnemer
36935fd5b1 [X86] Use the correct alignment for COMDAT constant pool entries
COFF doesn't have sections with mergeable contents.  Instead, each
constant pool entry ends up in a COMDAT section.  The linker, when
choosing between COMDAT sections, doesn't choose the max alignment of
the two sections.  You just get whatever alignment was on the section.

If one constant needed a higher alignment in one object file from
another one, then we will get into trouble if the linker chooses the
lower alignment one.

Instead, lets promote the alignment of the constant pool entry to make
sure we don't use an under aligned constant with an instruction which
assumed otherwise.

This fixes PR26680.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 01:30:30 +00:00
Simon Pilgrim
2e17dfddd0 [InstCombine] SSE/SSE2 (u)comiss/(u)comisd comparison intrinsics only use the lowest vector element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:17:35 +00:00
Dan Gohman
98f8ef3a28 [WebAssembly] Refine a README.txt entry.
The register coloring pass may also need to be involved in order to
optimally sort registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:11:14 +00:00
Dan Gohman
772074148f [WebAssembly] Handle CopyToReg nodes with flag results in LowerCopyToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:09:44 +00:00
Simon Pilgrim
b8fb88e6c7 [InstCombine] Added SSE/SSE2 comparison intrinsics demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 22:41:31 +00:00
Derek Schuff
545c0902d4 [WebAssembly] Write stack pointer back to memory when FP is used
The stack pointer is bumped when there is a frame pointer or when there
are static-size objects, but was only getting written back when there
were static-size objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261453 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 22:18:47 +00:00
Derek Schuff
37d3f7f35c [WebAssembly] Stackify function prologs and epilogs
The instructions are the same, but fewer locals are used.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:46:50 +00:00
Simon Pilgrim
51fba47bbf [InstCombine] Added some SSE/SSE2 demanded vector elements tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261451 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:44:48 +00:00