Commit Graph

22574 Commits

Author SHA1 Message Date
Craig Topper
58c7fe69d0 [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits
This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.

Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.

I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.

Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:39:58 +00:00
Sanjoy Das
263da12ab2 Reverts commit r301424, r301425 and r301426
Commits were:

"Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts"
"Add a new WeakVH value handle; NFC"
"Rename WeakVH to WeakTrackingVH; NFC"

The changes assumed pointers are 8 byte aligned on all architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:37:05 +00:00
Sanjoy Das
d0cf26e443 Rename WeakVH to WeakTrackingVH; NFC
Summary:
I plan to use WeakVH to mean "nulls itself out on deletion, but does
not track RAUW" in a subsequent commit.

Reviewers: dblaikie, davide

Reviewed By: davide

Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:20:52 +00:00
Sanjay Patel
553bcb5841 [TargetLowering] fix isConstTrueVal to account for build vector truncation
Build vectors have magical truncation powers, so we have things like this:

v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>

If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find 
truth when ZeroOrNegativeOneBooleanContent is the rule.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 14:05:42 +00:00
Ranjeet Singh
d530427b4a Fix signed multiplication with overflow fallback.
For targets that don't have ISD::MULHS or ISD::SMUL_LOHI for the type
and the double width type is illegal, then the two operands are
sign extended to twice their size then multiplied to check for overflow.
The extended upper halves were mismatched causing an incorrect result.
This fixes the mismatch.

A test was added for ARM V6-M where the bug was detected.

Patch by James Duley.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301404 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:41:43 +00:00
Sanjay Patel
0f75548f9f [DAG] add FIXME comments for splat detection; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 13:27:57 +00:00
Andrew V. Tischenko
03ca81ebd4 PR31007 and PR27884 will be closed: a possibility to compile constants like 0bH is now supported in MS asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 09:56:59 +00:00
Michael Liao
2238d782d6 Remove tailing whitespaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301383 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 05:27:20 +00:00
Sanjay Patel
2b2adc9567 [DAG] fix formatting of isConstantSplat(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 23:33:28 +00:00
Adrian Prantl
6ec3ecc68b Fix an assertion when skipping stack values in DWARF2 mode.
The fix consists of resetting LocationKind when addMachineRegExpression fails.

rdar://problem/31803010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301351 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 19:40:53 +00:00
Adrian Prantl
f88c05494c Print complete DIExpressions in the assembler output DEBUG_VALUE comments.
The previous code was complex, incorrect, and couldn't print everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301333 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 17:22:09 +00:00
Simon Pilgrim
21b590cebc [DAGCombiner] Refactor to make it easy to add support for vectors in a future patch. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 16:16:03 +00:00
Andrew Ng
d8be4bf95c Resubmit r301309: [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch reapplies r301309 with the fix to the MIR test to fix the assertion
triggered by r301309. Had trimmed a little bit too much from the MIR!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301317 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 15:39:57 +00:00
Simon Pilgrim
05711fea06 [SelectionDAG] Use getBuildVector helper where possible. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301314 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 15:10:47 +00:00
Andrew Ng
e9fd8c5001 Revert "[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler."
This reverts commit r301309 which is causing buildbot assertion failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301312 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 14:36:01 +00:00
Daniel Sanders
ac1a2173c6 Bring back the ability opt out of padding zero-byte functions by not providing a nop instruction.
Summary: No test case since I'm not aware of an in-tree target that needs this.

Reviewers: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301311 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 14:27:27 +00:00
Andrew Ng
7198047ec4 [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.
This patch fixes a bug with the updating of DBG_VALUE's in
BreakAntiDependencies. Previously, it would only attempt to update the first
DBG_VALUE following the instruction whose register is being changed,
potentially leaving DBG_VALUE's referring to the wrong register. Now the code
will update all DBG_VALUE's that immediately follow the instruction.

This issue was detected as a result of an optimized codegen difference with
"-g" where an X86 byte/word fixup was not performed due to a DBG_VALUE
referencing the wrong register.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 13:39:49 +00:00
Simon Pilgrim
70ad9d96e1 [SelectionDAG] Pull out repeated getValueType calls. NFCI.
Noticed in D32391.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 13:39:07 +00:00
Simon Pilgrim
cda4399247 [DAGCombiner] Add vector support for (srl (trunc (srl x, c1)), c2) combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 12:40:45 +00:00
Simon Pilgrim
5c072c6410 [SelectionDAG] Recognise splat vector isKnownToBeAPowerOfTwo one/sign bit shift cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301303 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 12:29:07 +00:00
Simon Pilgrim
1ef6a945eb [DAGCombiner] Use SDValue::getConstantOperandVal helper where possible. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301300 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-25 10:47:35 +00:00
Simon Pilgrim
60823da1a9 [DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 21:43:21 +00:00
Krzysztof Parzyszek
f3b0bf3070 Move value type list from TargetRegisterClass to TargetRegisterInfo
Differential Revision: https://reviews.llvm.org/D31937


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301234 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 19:51:12 +00:00
Krzysztof Parzyszek
031e2c7f67 Revert r301231: Accidentally committed stale files
I forgot to commit local changes before commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 19:48:51 +00:00
Krzysztof Parzyszek
a23ad66819 Move value type list from TargetRegisterClass to TargetRegisterInfo
Differential Revision: https://reviews.llvm.org/D31937


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301231 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 19:43:45 +00:00
Krzysztof Parzyszek
36d7c2b2e5 Move size and alignment information of regclass to TargetRegisterInfo
1. RegisterClass::getSize() is split into two functions:
   - TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const;
   - TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const;
2. RegisterClass::getAlignment() is replaced by:
   - TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const;

This will allow making those values depend on subtarget features in the
future.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301221 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:55:33 +00:00
Adrian Prantl
83092adef9 Don't emit CFI instructions at the end of a function
When functions are terminated by unreachable instructions, the last
instruction might trigger a CFI instruction to be generated. However,
emitting it would be be illegal since the function (and thus the FDE
the CFI is in) has already ended with the previous instruction.

Darwin's dwarfdump --verify --eh-frame complains about this and the
specification supports this.
Relevant bits from the DWARF 5 standard (6.4 Call Frame Information):

"[The] address_range [field in an FDE]: The number of bytes of
 program instructions described by this entry."

"Row creation instructions: [...]
 The new location value is always greater than the current one."
The first quotation implies that a CFI cannot describe a target
address outside of the enclosing FDE's range.

rdar://problem/26244988

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301219 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:45:59 +00:00
Yaxun Liu
76c532ddba CodeGen: Add a hook for getFenceOperandTy
Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0.
This is fine for most targets. However for amdgcn target, the size of pointer in address space 0
depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is
32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target
triple environment. Therefore a hook is need in target lowering for getting the fence operand type.

This patch has no effect on targets other than amdgcn.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301215 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:26:27 +00:00
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
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
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
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
Renato Golin
d907744fff Revert "[APInt] Fix a few places that use APInt::getRawData to operate within the normal API."
This reverts commit r301105, 4, 3 and 1, as a follow up of the previous
revert, which broke even more bots.

For reference:
Revert "[APInt] Use operator<<= where possible. NFC"
Revert "[APInt] Use operator<<= instead of shl where possible. NFC"
Revert "[APInt] Use ashInPlace where possible."

PR32754.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 12:15:30 +00:00
Artyom Skrobov
2a7f4178e4 [ARM] ScheduleDAGRRList::DelayForLiveRegsBottomUp must consider OptionalDefs
Summary:
D30400 has enabled tADC and tSBC instructions to be unglued, thereby allowing CPSR to remain live between Thumb1 scheduling units.

Most Thumb1 instructions have an OptionalDef for CPSR; but the scheduler ignored the OptionalDefs, and could unwittingly insert a flag-setting instruction in between an ADDS and the corresponding ADC.

Reviewers: javed.absar, atrick, MatzeB, t.p.northover, jmolloy, rengolin

Reviewed By: javed.absar

Subscribers: rogfer01, efriedma, aemerson, rengolin, llvm-commits, MatzeB

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 06:58:08 +00:00
Craig Topper
aeda136605 [APInt] Fix a few places that use APInt::getRawData to operate within the normal API.
getRawData exposes the internal type of the APInt class directly to its users. Ideally we wouldn't expose such an implementation detail.

This patch fixes a few of the easy cases by using truncate, extract, or a rotate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301105 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 06:41:11 +00:00
Craig Topper
e3ba850127 [APInt] Use operator<<= where possible. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 05:43:02 +00:00
Craig Topper
5e17d2e85c [APInt] Use operator<<= instead of shl where possible. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301103 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 05:18:31 +00:00
Craig Topper
1ea7b69466 [APInt] Use ashInPlace where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-23 03:45:59 +00:00
Daniel Sanders
cc3830e7da [globalisel][tablegen] Revise API for ComplexPattern operands to improve flexibility.
Summary:
Some targets need to be able to do more complex rendering than just adding an
operand or two to an instruction. For example, it may need to insert an
instruction to extract a subreg first, or it may need to perform an operation
on the operand.

In SelectionDAG, targets would create SDNode's to achieve the desired effect
during the complex pattern predicate. This worked because SelectionDAG had a
form of garbage collection that would take care of SDNode's that were created
but not used due to a later predicate rejecting a match. This doesn't translate
well to GlobalISel and the churn was wasteful.

The API changes in this patch enable GlobalISel to accomplish the same thing
without the waste. The API is now:
	InstructionSelector::OptionalComplexRendererFn selectArithImmed(MachineOperand &Root) const;
where Root is the root of the match. The return value can be omitted to
indicate that the predicate failed to match, or a function with the signature
ComplexRendererFn can be returned. For example:
	return OptionalComplexRendererFn(
	       [=](MachineInstrBuilder &MIB) { MIB.addImm(Immed).addImm(ShVal); });
adds two immediate operands to the rendered instruction. Immed and ShVal are
captured from the predicate function.

As an added bonus, this also reduces the amount of information we need to
provide to GIComplexOperandMatcher.

Depends on D31418

Reviewers: aditya_nandakumar, t.p.northover, qcolombet, rovka, ab, javed.absar

Reviewed By: ab

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301079 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 15:11:04 +00:00
David Blaikie
36e99fa5b0 Avoid using relocations for ref_addr in .dwo files
In dwo files the fixed offset can be used - if the dwos are linked into
a dwp, the dwo consumer must use the dwp tables to find out where the
original range of the debug_info was and resolve the "section relative"
value relative to that original range - effectively
avoiding/reimplementing the relocation handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 07:53:44 +00:00
David Blaikie
a753d9a103 Remove the unnecessary virtual dtor from the DIEUnit hierarchy (in favor of protected dtor in the base, final derived classes with public non-virtual dtors)
These objects are never polymorphically owned/destroyed, so the virtual
dtor was unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 02:18:00 +00:00
David Blaikie
9c1b0af658 Move Split DWARF handling to an MC option/command line argument rather than using metadata
Since Split DWARF needs to name the actual .dwo file that is generated,
it can't be known at the time the llvm::Module is produced as it may be
merged with other Modules before the object is generated and that object
may be generated with any name.

By passing the Split DWARF file name when LLVM is producing object code
the .dwo file name in the object file can match correctly.

The support for Split DWARF for implicit modules remains the same -
using metadata to store the dwo name and dwo id so that potentially
multiple skeleton CUs referring to different dwo files can be generated
from one llvm::Module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 23:35:26 +00:00
Hans Wennborg
960a40ec57 Re-commit r301040 "X86: Don't emit zero-byte functions on Windows"
In addition to the original commit, tighten the condition for when to
pad empty functions to COFF Windows.  This avoids running into problems
when targeting e.g. Win32 AMDGPU, which caused test failures when this
was committed initially.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 21:48:41 +00:00
Hans Wennborg
0720f631bf Revert r301040 "X86: Don't emit zero-byte functions on Windows"
This broke almost all bots. Reverting while fixing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 21:10:37 +00:00
Hans Wennborg
fe76aaa6ee X86: Don't emit zero-byte functions on Windows
Empty functions can lead to duplicate entries in the Guard CF Function
Table of a binary due to multiple functions sharing the same RVA,
causing the kernel to refuse to load that binary.

We had a terrific bug due to this in Chromium.

It turns out we were already doing this for Mach-O in certain
situations. This patch expands the code for that in
AsmPrinter::EmitFunctionBody() and renames
TargetInstrInfo::getNoopForMachoTarget() to simply getNoop() since it
seems it was used for not just Mach-O anyway.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 20:58:12 +00:00
Akira Hatanaka
586c752a82 [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 r300932 and r300930, which was causing dag-combine to
loop forever. The problem was that optimizeLogicalImm was returning
true even when there was no change to the immediate node (which happened
when the immediate was all zeros or ones), which caused dag-combine to
push and pop the same node to the work list over and over again without
making any progress.

This commit fixes the bug by returning false early in optimizeLogicalImm
if the immediate is all zeros or ones. Also, it changes the code to
compare the immediate with 0 or Mask rather than calling
countPopulation.

rdar://problem/18231627

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301019 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 18:53:12 +00:00
Akira Hatanaka
1933132d0a Revert r300932 and r300930.
It seems that r300930 was creating an infinite loop in dag-combine when
compling the following file:

MultiSource/Benchmarks/MiBench/consumer-typeset/z21.c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300940 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-21 01:31:50 +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
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
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