History log of /external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cddc3e03e4ec99c0268c03a126195173e519ed58 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r256229

http://b/26987366

(cherry picked from commit f3ef5332fa3f4d5ec72c178a2b19dac363a19383)

Change-Id: Ic75dcb63191d65df1b69724576392c0aaeb47728
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
4c5e43da7792f75567b693105cc53e3f1992ad98 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master llvm for rebase to r233350

Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
ebe69fe11e48d322045d5949c83283927a0d790b 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r230699.

Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
37ed9c199ca639565f6ce88105f9e39e898d82d0 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r222494.

Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
c6a4f5e819217e1e12c458aed8e7b122e23a3a58 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
0df68423f9567b3d3eafb3b26668f783b07f687f 13-Sep-2013 Quentin Colombet <qcolombet@apple.com> [Peephole] Rewrite copies to avoid cross register banks copies.

By definition copies across register banks are not coalescable. Still, it may be
possible to get rid of such a copy when the value is available in another
register of the same register file.
Consider the following example, where capital and lower letters denote different
register file:
b = copy A <-- cross-bank copy
...
C = copy b <-- cross-bank copy

This could have been optimized this way:
b = copy A <-- cross-bank copy
...
C = copy A <-- same-bank copy

Note: b and C's definitions may be in different basic blocks.

This patch adds a peephole optimization that looks through a chain of copies
leading to a cross-bank copy and reuses a source that is on the same register
file if available.

This solution could also be used to get rid of some copies (e.g., A could have
been used instead of C). However, we do not do so because:
- It may over constrain the coloring of the source register for coalescing.
- The register allocator may not be able to find a nice split point for the
longer live-range, leading to more spill.

<rdar://problem/14742333>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
a1032b7e4c405474f8a26c731873d413b1f1d25b 17-Dec-2012 Craig Topper <craig.topper@gmail.com> Add debug prints for when optimizeLoadInstr folds a load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
8293b7b8b1c4372095f86097da33f6cc63330289 11-Dec-2012 Joel Jones <joel_k_jones@apple.com> Add comment for load folding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
10ad98bbbb00d67d4272e8f29186a65e2a75215e 15-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Make sure we iterate over newly created instructions. Fixes pr13625. Testcase to
follow in one sec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
cabc0699ea32cad78028a6533aef1e380064262e 17-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use standard pattern for iterate+erase.

Increment the MBB iterator at the top of the loop to properly handle the
current (and previous) instructions getting erased.

This fixes PR13625.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
f2c64ef519b38a4328809b27b4a3a8e0c26e9709 17-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add an MCID::Select flag and TII hooks for optimizing selects.

Select instructions pick one of two virtual registers based on a
condition, like x86 cmov. On targets like ARM that support predication,
selects can sometimes be eliminated by predicating the instruction
defining one of the operands.

Teach PeepholeOptimizer to recognize select instructions, and ask the
target to optimize them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
127eea87d666ccc9fe7025f41148c33af0f8c84b 02-Aug-2012 Manman Ren <mren@apple.com> X86 Peephole: fold loads to the source register operand if possible.

Add more comments and use early returns to reduce nesting in isLoadFoldable.
Also disable folding for V_SET0 to avoid introducing a const pool entry and
a const pool load.

rdar://10554090 and rdar://11873276


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
d7d003c2b7b7f657eed364e4ac06f4ab32fc8c2d 02-Aug-2012 Manman Ren <mren@apple.com> X86 Peephole: fold loads to the source register operand if possible.

Machine CSE and other optimizations can remove instructions so folding
is possible at peephole while not possible at ISel.

This patch is a rework of r160919 and was tested on clang self-host on my local
machine.

rdar://10554090 and rdar://11873276


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
e8b4a4a9d173d67e35e4b1d32e20140381db6bde 29-Jul-2012 Manman Ren <mren@apple.com> Revert r160920 and r160919 due to dragonegg and clang selfhost failure



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
0eb3edea9cb6819334173a7d288da85943201fe5 28-Jul-2012 Manman Ren <mren@apple.com> X86 Peephole: fold loads to the source register operand if possible.

Machine CSE and other optimizations can remove instructions so folding
is possible at peephole while not possible at ISel.

rdar://10554090 and rdar://11873276


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
de7266c611b37ec050efb53b73166081a98cea13 29-Jun-2012 Manman Ren <mren@apple.com> Add SrcReg2 to analyzeCompare and optimizeCompareInstr to handle Compare
instructions with two register operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
7164288c3eb52e20454fc757440f867f04eb13a4 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement PPCInstrInfo::isCoalescableExtInstr().

The PPC::EXTSW instruction preserves the low 32 bits of its input, just
like some of the x86 instructions. Use it to reduce register pressure
when the low 32 bits have multiple uses.

This requires a small change to PeepholeOptimizer since EXTSW takes a
64-bit input register.

This is related to PR5997.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
d8d0279c007e70c325b4ac9d9893b31ee5f21085 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Style: Don't reuse variables for multiple purposes.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
2afde7782dfa56b2e46f79598bdb5f1e09471941 07-Jun-2012 Manman Ren <mren@apple.com> Revert r157755.

The commit is intended to fix rdar://11540023.
It is implemented as part of peephole optimization. We can actually implement
this in the SelectionDAG lowering phase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158122 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
91c5346d91973a1d3458a20f8c6b0e899b732e38 31-May-2012 Manman Ren <mren@apple.com> X86: replace SUB with CMP if possible

This patch will optimize the following
movq %rdi, %rax
subq %rsi, %rax
cmovsq %rsi, %rdi
movq %rdi, %rax
to
cmpq %rsi, %rdi
cmovsq %rsi, %rdi
movq %rdi, %rax

Perform this optimization if the actual result of SUB is not used.

rdar: 11540023


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
418a3638acfa95e4212a38100adfc2f8cdd45919 20-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Constrain regclasses in PeepholeOptimizer.

It can be necessary to restrict to a sub-class before accessing
sub-registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
247c5ab07c1c136f37f5ad8ade9a1ee086ca452e 11-May-2012 Manman Ren <mren@apple.com> ARM: peephole optimization to remove cmp instruction

This patch will optimize the following cases:
sub r1, r3 | sub r1, imm
cmp r3, r1 or cmp r1, r3 | cmp r1, imm
bge L1

TO
subs r1, r3
bge L1 or ble L1

If the branch instruction can use flag from "sub", then we can replace
"sub" with "subs" and eliminate the "cmp" instruction.

rdar: 10734411


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
fe65d98dadbedf2650266ac71c1c093c3b97da1f 10-May-2012 Manman Ren <mren@apple.com> Revert: 156550 "ARM: peephole optimization to remove cmp instruction"

This commit broke an external linux bot and gave a compile-time warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
8ae4f062e4aefe60732b3fc135769aaedddf082d 10-May-2012 Manman Ren <mren@apple.com> ARM: peephole optimization to remove cmp instruction

This patch will optimize the following cases:
sub r1, r3 | sub r1, imm
cmp r3, r1 or cmp r1, r3 | cmp r1, imm
bge L1

TO
subs r1, r3
bge L1 or ble L1

If the branch instruction can use flag from "sub", then we can replace
"sub" with "subs" and eliminate the "cmp" instruction.

rdar: 10734411


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
39cc5138707eee563db7a487cd720b232b4b58fd 02-May-2012 Jim Grosbach <grosbach@apple.com> Tidy up. Naming conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
c69cbd0a7431b047dbc4a9758e81bf122926ba0a 25-Feb-2012 Lang Hames <lhames@gmail.com> Make the peephole optimizer clear kill flags on a vreg if it's about to add new
uses of the vreg, since the old kills may no longer be valid. This was causing
-verify-machineinstrs to complain about uses after kills, and could potentially
have been causing subtle register allocation issues, but I haven't come across a
test case yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
3b26eb62946a64409f81c8089a362eb582114342 25-Feb-2012 Lang Hames <lhames@gmail.com> Fixed typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
1dd8c8560d45d36a8e507cd014352f1d313f9f9e 08-Feb-2012 Andrew Trick <atrick@apple.com> Codegen pass definition cleanup. No functionality.

Moving toward a uniform style of pass definition to allow easier target configuration.
Globally declare Pass ID.
Globally declare pass initializer.
Use INITIALIZE_PASS consistently.
Add a call to the initializer from CodeGen.cpp.
Remove redundant "createPass" functions and "getPassName" methods.

While cleaning up declarations, cleaned up comments (sorry for large diff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
1df91b0e54bc62f8fc7a06a4f75220e40aa2dfe0 08-Feb-2012 Andrew Trick <atrick@apple.com> whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
5a96b3dad2f634c9081c8b2b6c2575441dc5a2bd 07-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add bundle aware API for querying instruction properties and switch the code
generator to it. For non-bundle instructions, these behave exactly the same
as the MC layer API.

For properties like mayLoad / mayStore, look into the bundle and if any of the
bundled instructions has the property it would return true.
For properties like isPredicable, only return true if *all* of the bundled
instructions have the property.
For properties like canFoldAsLoad, isCompare, conservatively return false for
bundles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
dec1b10161a3bc1b49ab8d35e1bd6488486dfd4a 13-Oct-2011 Nick Lewycky <nicholas@mxc.ca> If MI is deleted then remove it from the set. If a new MI is created, it could
have the same address as the one we deleted, and we don't want that in the set
yet. Noticed by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
7becbc41ab2875153868c21a84153eca442cc28f 26-Jul-2011 Duncan Sands <baldrick@free.fr> SrcDef is only written and never read. Remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
e837dead3c8dc3445ef6a0e2322179c57e264a13 28-Jun-2011 Evan Cheng <evan.cheng@apple.com> - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
d158fba3e45547f013bbab4c0ac640f31b5e341f 15-Mar-2011 Evan Cheng <evan.cheng@apple.com> Add a peephole optimization to optimize pairs of bitcasts. e.g.
v2 = bitcast v1
...
v3 = bitcast v2
...
= v3
=>
v2 = bitcast v1
...
= v1
if v1 and v3 are of in the same register class.

bitcast between i32 and fp (and others) are often not nops since they
are in different register classes. These bitcast instructions are often
left because they are in different basic blocks and cannot be
eliminated by dag combine.

rdar://9104514


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
326d976eb2b03d1f2b7537d7b90dff264fd84378 15-Feb-2011 Evan Cheng <evan.cheng@apple.com> Fix thinko. Cmp can be the first instruction in a MBB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
cf75ab597514effb6f8e915f05d74f45debb89ec 14-Feb-2011 Evan Cheng <evan.cheng@apple.com> Fix PR8854. Track inserted copies to avoid read before write. Sorry, it's hard to reduce a sensible small test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
c9df025e33ac435adb3b3318d237c36ca7cec659 10-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.

These functions not longer assert when passed 0, but simply return false instead.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
c36b7069b42bece963b7e6adf020353ce990ef76 08-Jan-2011 Evan Cheng <evan.cheng@apple.com> Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
30a343aeedf777f9b8b6be9823da750afbf765b1 07-Jan-2011 Evan Cheng <evan.cheng@apple.com> DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
c4af4638dfdab0dc3b6257276cfad2ee45053060 17-Nov-2010 Evan Cheng <evan.cheng@apple.com> Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

Instead, let peephole optimization pass recognize registers that are defined by
immediates and the ARM target hook will fold the immediates in.

Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ
instructions if there are multiple uses. This happens when the 'and' is live
out, machine sink would have sinked the computation and that ends up pessimizing
code. The peephole pass would recognize situations where the 'and' can be
toggled to define CPSR and eliminate the comparison anyway.

2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking
important optimizations.

rdar://8663787, rdar://8241368


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119548 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
eb96a2f6c03c0ec97c56a3493ac38024afacc774 15-Nov-2010 Evan Cheng <evan.cheng@apple.com> Code clean up. The peephole pass should be the one updating the instruction
iterator, not TII->OptimizeCompareInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
40a5eb18b031fa1a5e9697e21e251e613d441cc5 01-Nov-2010 Bill Wendling <isanbard@gmail.com> When we look at instructions to convert to setting the 's' flag, we need to look
at more than those which define CPSR. You can have this situation:

(1) subs ...
(2) sub r6, r5, r4
(3) movge ...
(4) cmp r6, 0
(5) movge ...

We cannot convert (2) to "subs" because (3) is using the CPSR set by
(1). There's an analogous situation here:

(1) sub r1, r2, r3
(2) sub r4, r5, r6
(3) cmp r4, ...
(5) movge ...
(6) cmp r1, ...
(7) movge ...

We cannot convert (1) to "subs" because of the intervening use of CPSR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
9e7cb3d2434e252cc0b81d88169d3d8989fcd78f 01-Nov-2010 Bill Wendling <isanbard@gmail.com> The testcase is now XFAILed. Sorry about the breakage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117904 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
b698a56dd4739fb1a407b2b286bf2aa7bdf86fde 31-Oct-2010 Eric Christopher <echristo@apple.com> Revert r117876 for now, it's causing more testsuite failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
b3747706fc0ccece33516b257f6601508c3a2a45 31-Oct-2010 Bill Wendling <isanbard@gmail.com> Disable the peephole optimizer until 186.crafty on armv6 is fixed. This is what
looks like is happening:

Without the peephole optimizer:
(1) sub r6, r6, #32
orr r12, r12, lr, lsl r9
orr r2, r2, r3, lsl r10
(x) cmp r6, #0
ldr r9, LCPI2_10
ldr r10, LCPI2_11
(2) sub r8, r8, #32
(a) movge r12, lr, lsr r6
(y) cmp r8, #0
LPC2_10:
ldr lr, [pc, r10]
(b) movge r2, r3, lsr r8

With the peephole optimizer:
ldr r9, LCPI2_10
ldr r10, LCPI2_11
(1*) subs r6, r6, #32
(2*) subs r8, r8, #32
(a*) movge r12, lr, lsr r6
(b*) movge r2, r3, lsr r8

(1) is used by (x) for the conditional move at (a). (2) is used by (y) for the
conditional move at (b). After the peephole optimizer, these the flags resulting
from (1*) are ignored and only the flags from (2*) are considered for both
conditional moves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
b41ee96d76ccf1eec2fd898def4cfd7c16868708 18-Oct-2010 Bill Wendling <isanbard@gmail.com> Don't recompute MachineRegisterInfo in the Optimize* method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
2ab36d350293c77fc8941ce1023e4899df7e3a82 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
04ac81d5db058a3a9492e1aff1f398a8643bfda9 21-Sep-2010 Gabor Greif <ggreif@gmail.com> Move the search for the appropriate AND instruction
into OptimizeCompareInstr.
This necessitates the passing of CmpValue around,
so widen the virtual functions to accomodate.

No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
4f7d107d1d2b2392ce8eb1647e2daa04a81f6c99 14-Sep-2010 Gabor Greif <ggreif@gmail.com> must not peephole away side effects

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
a65568676d0d9d53dd4aae8f1c58271bb4cfff10 11-Sep-2010 Bill Wendling <isanbard@gmail.com> Rename ConvertToSetZeroFlag to something more general.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
3665661a5708c8adc2727be38b56d1d87ddeb661 11-Sep-2010 Bill Wendling <isanbard@gmail.com> No need to recompute the SrcReg and CmpValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
92ad57f066e9f256e4e3d72febf152e68caa80c7 11-Sep-2010 Bill Wendling <isanbard@gmail.com> Move some of the decision logic for converting an instruction into one that sets
the 'zero' bit down into the back-end. There are other cases where this logic
isn't sufficient, so they should be handled separately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
220e240bdf3235252c2a1fc8fcc5d4b8e8117918 10-Sep-2010 Bill Wendling <isanbard@gmail.com> Modify the comparison optimizations in the peephole optimizer to update the
iterator when an optimization took place. This allows us to do more insane
things with the code than just remove an instruction or two.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
69c5eb59f592087af89b971bea072f070f2a5cfa 27-Aug-2010 Bill Wendling <isanbard@gmail.com> Remove now unneeded command line flag that enables 'optimize compares.'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
75486dbf4e9611f2070bf13b874f78a5587ed7ff 10-Aug-2010 Bill Wendling <isanbard@gmail.com> Turn optimize compares back on with fix. We needed to test that a machine op was
a register before checking if it was defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
a8c58a6f59880a5bb2ef8fc86ebdeb15e96ed110 10-Aug-2010 Dan Gohman <gohman@apple.com> Revert r110718; it broke clang-i386-darwin9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
a54e3cddce8e9f5e84e1124466b9134f90961c84 10-Aug-2010 Bill Wendling <isanbard@gmail.com> Turn optimize cmps on by default so that we can get some testing by the nightly
ARM testers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110718 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp
6cdb1abe4e4f6364649e7ef656589441754e82ae 10-Aug-2010 Bill Wendling <isanbard@gmail.com> Merge the OptimizeExts and OptimizeCmps passes into one PeepholeOptimizer
pass. This pass should expand with all of the small, fine-grained optimization
passes to reduce compile time and increase happiment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PeepholeOptimizer.cpp