Commit Graph

148002 Commits

Author SHA1 Message Date
Akira Hatanaka
2159c695f3 [AArch64] Use suffix ULL to shift a 64-bit value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300932 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 00:35:27 +00:00
Davide Italiano
f113d04b8d [CodeExtractor] Remove an unneeded level of indirection. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300931 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 00:21:09 +00:00
Akira Hatanaka
63da689bdf [AArch64] Improve code generation for logical instructions taking
immediate operands.

This commit adds an AArch64 dag-combine that optimizes code generation
for logical instructions taking immediate operands. The optimization
uses demanded bits to change a logical instruction's immediate operand
so that the immediate can be folded into the immediate field of the
instruction.

This recommits r300913, which broke bots because I didn't fix a call to
ShrinkDemandedConstant in SIISelLowering.cpp after changing the APIs of
TargetLoweringOpt and TargetLowering.

rdar://problem/18231627

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300930 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 00:05:16 +00:00
Eli Friedman
df4849c1dd Revert r300746 (SCEV analysis for or instructions).
There have been multiple reports of this causing problems: a
compile-time explosion on the LLVM testsuite, and a stack
overflow for an opencl kernel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300928 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:59:05 +00:00
Craig Topper
c7e3512b43 [InstCombine] Remove the zextOrTrunc from ShrinkDemandedConstant.
The demanded mask and the constant should always be the same width for all callers today.

Also stop copying the demanded mask as its passed in. We should avoid allocating memory unless we are going to do something. The final AND to create the new constant will take care of it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300927 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:58:27 +00:00
Matthias Braun
e0bfbeae68 X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC
X86RegisterInfo::eliminateFrameIndex() and
X86FrameLowering::getFrameIndexReference() both had logic to compute the
base register. This consolidates the code.

Also use MachineInstr::isReturn instead of manually enumerating tail
call instructions (return instructions were not included in the previous
list because they never reference frame indexes).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300923 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:34:50 +00:00
Matthias Braun
6ef1610d07 X86RegisterInfo: eliminateFrameIndex: Force SP for AfterFPPop; NFC
AfterFPPop is used for tailcall/tailjump instructions. We shouldn't ever
have frame-pointer/base-pointer relative addressing for those. After all
the frame/base pointer should already be restored to their previous
values at the return.

Make this fact explicit in preparation for an upcoming refactoring.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:34:46 +00:00
Sanjoy Das
5037cf29e4 Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300918 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:07:00 +00:00
Akira Hatanaka
01c014ca98 Revert "[AArch64] Improve code generation for logical instructions taking"
This reverts r300913.

This broke bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 23:03:30 +00:00
Craig Topper
7a610e66b2 [Simplify] Add testcase to show that merging conditional stores for triangles is sensitive to the order of the branch targets on the conditional branches. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300915 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 22:57:36 +00:00
Akira Hatanaka
ac0ecde9f0 [AArch64] Improve code generation for logical instructions taking
immediate operands.

This commit adds an AArch64 dag-combine that optimizes code generation
for logical instructions taking immediate operands. The optimization
uses demanded bits to change a logical instruction's immediate operand
so that the immediate can be folded into the immediate field of the
instruction.

rdar://problem/18231627

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300913 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 22:47:56 +00:00
Sanjay Patel
f23a493cab [InstCombine] function names start with lower-case letter; NFC
Forgot to make this fix with the signature change in r300911.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 22:37:01 +00:00
Sanjay Patel
e29c6aab81 [InstCombine] allow shl+shr demanded bits folds with splat constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 22:33:54 +00:00
Sanjay Patel
c086bdaf50 [InstCombine] add tests for shl+shr demanded bits splat vector folds; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300907 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 22:18:47 +00:00
Tim Northover
efa8c0e73a AArch64: lower "fence singlethread" to a pure compiler barrier.
Single-threaded fences aren't required to provide any synchronization with
other processing elements so there's no need for a DMB. They should still be a
barrier for compiler optimizations though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300905 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:57:45 +00:00
Tim Northover
ff268972fc ARM: lower "fence singlethread" to a pure compiler barrier.
Single-threaded fences aren't required to provide any synchronization with
other processing elements so there's no need for a DMB. They should still be a
barrier for compiler optimizations though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:56:52 +00:00
Xinliang David Li
2747b70917 Use basicblock split block utility function
Instead of calling BasicBlock::SplitBasicBlock directly in 
CodeExtractor.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300899 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:40:22 +00:00
Sanjay Patel
a24f137360 [InstCombine] allow shl demanded bits folds with splat constants
More fixes are needed to enable the helper SimplifyShrShlDemandedBits().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300898 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:33:02 +00:00
Craig Topper
7b99ac1139 [InstCombine] Use APInt::intersects and APInt::isSubsetOf to improve a few more places in SimplifyDemandedBits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:24:37 +00:00
Chad Rosier
9ec21444cc [AArch64] Whitespace/ordering fixes for Falkor machine description. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300893 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:11:17 +00:00
Chad Rosier
4b046c4cf4 [AArch64] Refine Falkor machine description for pre/post-inc and stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 21:11:09 +00:00
Sanjay Patel
f0d51838c5 [InstCombine] allow ashr/lshr demanded bits folds with splat constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:59:02 +00:00
Craig Topper
a6180c4b3c [InstCombine] Use APInt::isSubsetOf to simplify some code in SimplifyDemandedBits. NFC
This allows us to use less temporary APInt for And and Invert operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:47:35 +00:00
Sanjay Patel
cef604c5bb [InstCombine] add tests for demanded bits ashr/lshr splat constants; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300884 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:44:54 +00:00
Adrian Prantl
52a72dacab Don't emit locations that need a DW_OP_stack_value in DWARF 2 & 3.
https://bugs.llvm.org/show_bug.cgi?id=32382

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:42:33 +00:00
Benjamin Kramer
060f30deeb [Support] Make asan poisoning for recyclers more aggressive by also poisoning the 'next' pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300882 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:28:18 +00:00
Benjamin Kramer
175caa6d02 Remove stray ^S. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:03:36 +00:00
Paul Robinson
e0f26af747 [DWARF] Fix a couple of typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300879 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 20:03:03 +00:00
Tim Northover
8cc396e7aa ARM: handle post-indexed NEON ops where the offset isn't the access width.
Before, we assumed that any ConstantInt offset was precisely the access width,
so we could use the "[rN]!" form. ISelLowering only ever created that kind, but
further simplification during combining could lead to unexpected constants and
incorrect codegen.

Should fix PR32658.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300878 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 19:54:02 +00:00
Adrian McCarthy
5078c4cbed VarStreamArrayIterator needed non-const operator* overload.
Without this change, the operator-> provided by iterator_facade lost type
qualifiers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300877 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 19:34:06 +00:00
Craig Topper
1fa7ca8b26 [InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The code above it is equivalent if you work through the bitwise math.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300876 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 19:31:22 +00:00
Paul Robinson
ce35560497 [DWARF] Versioning for DWARF constants; verify FORMs
Associate the version-when-defined with definitions of standard DWARF
constants.  Identify the "vendor" for DWARF extensions.
Use this information to verify FORMs in .debug_abbrev are defined as
of the DWARF version specified in the associated unit.
Removed two tests that had specified DWARF v1 (which essentially does
not exist).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300875 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 19:16:51 +00:00
Benjamin Kramer
1ec650ee5f [go bindings] Rmove duplicated conversion function definitions after r300843.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300872 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 19:06:11 +00:00
Chad Rosier
03b48f8380 [AArch64] Improve scheduling of logical operations on Falkor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300871 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:50:21 +00:00
Weiming Zhao
a90b36e98b [Thumb-1] Fix corner cases for compressed jump tables
Summary:
When synthesized TBB/TBH is expanded, we need to avoid the case of:
   BaseReg is redefined after the load of branching target. E.g.:

    %R2 = tLEApcrelJT <jt#1>
    %R1 =  tLDRr %R1, %R2    ==> %R2 = tLEApcrelJT <jt#1>
    %R2 = tLDRspi %SP, 12        %R2 = tLDRspi %SP, 12
    tBR_JTr %R1                  tTBB_JT %R2, %R1
`
Reviewers: jmolloy

Reviewed By: jmolloy

Subscribers: llvm-commits, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:37:14 +00:00
Davide Italiano
b2a1e2499a [CodeExtractor] Remove a bunch of unneeded constructors.
Differential Revision:  https://reviews.llvm.org/D32305

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300869 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:33:40 +00:00
Benjamin Kramer
4b3567dbfc [Recycler] Add asan/msan annotations.
This enables use after free and uninit memory checking for memory
returned by a recycler. SelectionDAG currently relies on the opcode of a
free'd node being ISD::DELETED_NODE, so poke a hole in the asan poison
for SDNode opcodes. This means that we won't find some issues, but only
in SDag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300868 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:29:37 +00:00
Benjamin Kramer
5fc394e871 Fix use-after-frees on memory allocated in a Recycler.
This will become asan errors once the patch lands that poisons the
memory after free. The x86 change is a hack, but I don't see how to
solve this properly at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300867 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:29:14 +00:00
Artyom Skrobov
bf812938af Fixing outdated comment [NFC]
Since r32105 back in 2006, RegisterPass doesn't support
passes without a default constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300866 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:20:02 +00:00
Andrew Kaylor
f7c70afb60 Fix formatting of constrained FP intrinsic documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:18:36 +00:00
Yaxun Liu
1baa360f32 CodeGen: Let frame index value type match alloca addr space
Recently alloca address space has been added to data layout. Due to this
change, pointer returned by alloca may have different size as pointer in
address space 0.

However, currently the value type of frame index is assumed to be of the
same size as pointer in address space 0.

This patch fixes that.

Most targets assume alloca returning pointer in address space 0, which
is the default alloca address space. Therefore it is NFC for them.

AMDGCN target with amdgiz environment requires this change since it
assumes alloca returning pointer to addr space 5 and its size is 32,
which is different from the size of pointer in addr space 0 which is 64.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:15:34 +00:00
Reid Kleckner
4d00a6147f Remove duplicate AttributeList::removeAttributes implementation
Have the AttributeList overload delegate to the AttrBuilder one.
Simplify the AttrBuilder overload by avoiding getSlotAttributes, which
creates temporary AttributeLists.

Simplify `AttrBuilder::removeAttributes(AttributeList, unsigned)` by
using getAttributes instead of manually iterating over slots.

Extracted from https://reviews.llvm.org/D32262

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300863 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:08:36 +00:00
Sanjay Patel
999e03461f [DAGCombiner] use more local variables in isAlias(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300860 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:02:27 +00:00
Sam Clegg
702bc51679 [WebAssembly] Add known failures for wasm object file backend
Subscribers: jfb, dschuff

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 17:18:15 +00:00
Zachary Turner
2a7d654e64 Resubmit "[BitVector] Add operator<<= and operator>>=."
This was failing due to the use of assigning a Mask to an
unsigned, rather than to a BitWord.  But most systems do not
have sizeof(unsigned) == sizeof(unsigned long), so the mask
was getting truncated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300857 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:56:54 +00:00
Craig Topper
54f0462d2b [APInt] Rename getSignBit to getSignMask
getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:56:25 +00:00
Amara Emerson
3e9c4ea1fe [SVE] Fix mismatched sign comparison warning in unit test from r300842.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:54:49 +00:00
Sanjay Patel
f3c6d22768 [DAGCombiner] fix variable names in isAlias(); NFCI
We started with zero-based params and switched to one-based locals...
Also, variables start with a capital and functions do not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300854 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:36:37 +00:00
Zachary Turner
154c0ad769 Revert "[BitVector] Add operator<<= and operator>>=."
This is causing test failures on Linux / BSD systems.  Reverting
while I investigate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300852 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:35:22 +00:00
Craig Topper
b52e0e4247 [APInt] Add isSubsetOf method that can check if one APInt is a subset of another without creating temporary APInts
This question comes up in many places in SimplifyDemandedBits. This makes it easy to ask without allocating additional temporary APInts.

The BitVector class provides a similar functionality through its (IMHO badly named) test(const BitVector&) method. Though its output polarity is reversed.

I've provided one example use case in this patch. I plan to do more as a follow up.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300851 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 16:17:13 +00:00