History log of /external/llvm/lib/CodeGen/IfConversion.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
de2d8694e25a814696358e95141f4b1aa4d8847e 20-Sep-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r275480

Bug: http://b/31320715

This merges commit 7dcf7f03e005379ef2f06db96aa93f06186b66d5 from
aosp/dev.

Test: Build AOSP and run RenderScript tests (host tests for slang and
libbcc, RsTest, CTS)

Change-Id: Iaf3738f74312d875e69f61d604ac058f381a2a1a
/external/llvm/lib/CodeGen/IfConversion.cpp
f3ef5332fa3f4d5ec72c178a2b19dac363a19383 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r256229

http://b/26987366

Change-Id: I1f29c4676a8abe633ab5707dded58d846c973d50
/external/llvm/lib/CodeGen/IfConversion.cpp
6948897e478cbd66626159776a8017b3c18579b9 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r239765

Bug: 20140355: This rebase pulls the upstream fix for the spurious
warnings mentioned in the bug.

Change-Id: I7fd24253c50f4d48d900875dcf43ce3f1721a3da
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.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/IfConversion.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/IfConversion.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

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

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/IfConversion.cpp
966772931eea7cdc3cdd7199e304d667aa344bd7 15-Oct-2013 Andrew Trick <atrick@apple.com> LiveRegUnits: Use *MBB for consistency and convenience.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7c489ab36564ddde3fa672aff52cfcae06517dfc 14-Oct-2013 Andrew Trick <atrick@apple.com> Use a SparseSet in LiveRegUnits.

Some clients may add block live ins and may track liveness over a
large scope. This guarantees an efficient implementation in all cases
with no memory allocation/deallocation, independent of the number of
target registers. It could be slightly less convenient but is fine in
the expected case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
5601abb60dcf9617ee24f4fd2da13b1caa0f6965 14-Oct-2013 Andrew Trick <atrick@apple.com> Convert LiveRegUnits methods to the current convention (it's new code).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4c5956cefbb469b93fcbeb5ec3c5ba16d8b83dad 11-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> fConversion: Attempt #2 at fixing the MSVC build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192492 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ae6fa27a0c17b448cc18b0f861f1b935195b419d 11-Oct-2013 Benjamin Kramer <benny.kra@googlemail.com> IfConversion: Try to unbreak the MSVC build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
85733840109907e1e0f8ffc03dcd2f5fd8e49d47 11-Oct-2013 Matthias Braun <matze@braunis.de> Remove kill flags after if conversion if necessary

When if converting something like:
true:
... = R0<kill>

false:
... = R0<kill>

then the instructions of the true block must not have a <kill> flag
anymore, as the instruction of the false block follow and do still read
the R0 value.
Specifically this patch determines the set of register live-in in the
false block (possibly after simulating the liveness changes of the
duplicated instructions). Each of these live-in registers mustn't be
killed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d42730dc712026cbfb1322a979e0ac72cd31a19e 30-Sep-2013 Arnold Schwaighofer <aschwaighofer@apple.com> IfConverter: Use TargetSchedule for instruction latencies

For targets that have instruction itineraries this means no change. Targets
that move over to the new schedule model will use be able the new schedule
module for instruction latencies in the if-converter (the logic is such that if
there is no itineary we will use the new sched model for the latencies).

Before, we queried "TTI->getInstructionLatency()" for the instruction latency
and the extra prediction cost. Now, we query the TargetSchedule abstraction for
the instruction latency and TargetInstrInfo for the extra predictation cost. The
TargetSchedule abstraction will internally call "TTI->getInstructionLatency" if
an itinerary exists, otherwise it will use the new schedule model.

ATTENTION: Out of tree targets!

(I will also send out an email later to LLVMDev)

This means, if your target implements

unsigned getInstrLatency(const InstrItineraryData *ItinData,
const MachineInstr *MI,
unsigned *PredCost);

and returns a value for "PredCost", you now also need to implement

unsigned getPredictationCost(const MachineInstr *MI);

(if your target uses the IfConversion.cpp pass)

radar://15077010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b57d99694b87326a2eea26d76becf67bf5784b49 09-Sep-2013 Joey Gouly <joey.gouly@arm.com> [ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.
IT blocks can only be one instruction lonf, and can only contain a subset of
the 16 instructions.

Patch by Artyom Skrobov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e644b7743bafaf5fc7091f8bf0accee720ade3ab 24-Jul-2013 Quentin Colombet <qcolombet@apple.com> Fix a bug in IfConverter with nested predicates.

Prior to this patch, IfConverter may widen the cases where a sequence of
instructions were executed because of the way it uses nested predicates. This
result in incorrect execution.

For instance, Let A be a basic block that flows conditionally into B and B be a
predicated block.
B can be predicated with A.BrToBPredicate into A iff B.Predicate is less
"permissive" than A.BrToBPredicate, i.e., iff A.BrToBPredicate subsumes
B.Predicate.

The IfConverter was checking the opposite: B.Predicate subsumes
A.BrToBPredicate.

<rdar://problem/14379453>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
62c320a755ac27ac2b7f64e927892249e0f486e0 23-May-2013 Chad Rosier <mcrosier@apple.com> Simplify logic now that r182490 is in place. No functional change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9a28cc14a9bc52072649f63308c2a66c9eebe0d1 05-May-2013 Evan Cheng <evan.cheng@apple.com> Teach if-converter to avoid removing BBs whose addresses are takne. rdar://13782395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181160 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9af7014019c971368d541870b108aef1f12a24ba 11-Apr-2013 Hal Finkel <hfinkel@anl.gov> Manually remove successors in if conversion when CopyAndPredicateBlock is used

In the simple and triangle if-conversion cases, when CopyAndPredicateBlock is
used because the to-be-predicated block has other predecessors, we need to
explicitly remove the old copied block from the successors list. Normally if
conversion relies on TII->AnalyzeBranch combined with BB->CorrectExtraCFGEdges
to cleanup the successors list, but if the predicated block contained an
un-analyzable branch (such as a now-predicated return), then this will fail.

These extra successors were causing a problem on PPC because it was causing
later passes (such as PPCEarlyReturm) to leave dead return-only basic blocks in
the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
dd4fc446b52cf9e617846c77e2c46e827f1d533e 25-Jan-2013 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid creating duplicate CFG edges in the IfConversion pass.

Patch by Stefan Hepp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173395 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
69e42dbd006c0afb732067ece7327988b1e24c01 11-Jan-2013 Benjamin Kramer <benny.kra@googlemail.com> Split TargetLowering into a CodeGen and a SelectionDAG part.

This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7b79b9862c9e6fc31ec072acb09171fd6ec7b0e0 20-Dec-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use MachineInstrBuilder in a few CodeGen passes.

This automatically passes a context pointer to MI->addOperand().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170711 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.cpp
05d96f98cbd96dab7f4ea1ea4ebe4285597e7e88 22-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Reduce duplicated hash map lookups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
96601ca332ab388754ca4673be8973396fea2ddd 22-Aug-2012 Craig Topper <craig.topper@gmail.com> Add a getName function to MachineFunction. Use it in places that previously did getFunction()->getName(). Remove includes of Function.h that are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
791e2e0867d1e6fcb9c6f651da89f57043bc6c4a 08-Jun-2012 Evan Cheng <evan.cheng@apple.com> Start implementing pre-ra if-converter: using speculation and selects to eliminate branches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
396618b43a85e12d290a90b181c6af5d7c0c5f11 02-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch all register list clients to the new MC*Iterator interface.

No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
3d4166dff0624b8843338acc156987e8bc890e9b 30-May-2012 Evan Cheng <evan.cheng@apple.com> If-converter models predicated defs as read + write. The read should be marked as 'undef' since it may not already be live. This appeases -verify-machineinstrs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9ebfbf8b9fd5f982e0db9293808bd32168615ba9 05-Mar-2012 Craig Topper <craig.topper@gmail.com> Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce static data size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.cpp
5e25ee8a1fcf8288d00d731b0f7ab7976f33b123 05-Feb-2012 Craig Topper <craig.topper@gmail.com> Convert assert(0) to llvm_unreachable

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8787c5f24e175a36f645784d533384f9f7cd86fc 19-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add a if-conversion optimization that allows 'true' side of a diamond to be
unpredicated. That is, turn
subeq r0, r1, #1
addne r0, r1, #1
into
sub r0, r1, #1
addne r0, r1, #1

For targets where conditional instructions are always executed, this may be
beneficial. It may remove pseudo anti-dependency in out-of-order execution
CPUs. e.g.
op r1, ...
str r1, [r10] ; end-of-life of r1 as div result
cmp r0, #65
movne r1, #44 ; raw dependency on previous r1
moveq r1, #12

If movne is unpredicated, then
op r1, ...
str r1, [r10]
cmp r0, #65
mov r1, #44 ; r1 written unconditionally
moveq r1, #12

Both mov and moveq are no longer depdendent on the first instruction. This gives
the out-of-order execution engine more freedom to reorder them.

This has passed entire LLVM test suite. But it has not been enabled for any ARM
variant pending more performance evaluation.

rdar://8951196


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.cpp
9c58aa743d5232a3eb78c0ee329281709a50b2f6 05-Nov-2011 Pete Cooper <peter_cooper@apple.com> Added missing &. Fixes <rdar://problem/10393723>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
0767267790e5cc91ffe3cc318d22f043b2633b26 04-Aug-2011 Jakub Staszak <jstaszak@apple.com> Fix typo in #include which revealed in the case-sensitive filesystem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
990f78d53bfe3cf2c82147bc34b457b01e651f25 04-Aug-2011 Jakub Staszak <jstaszak@apple.com> Use MachineBranchProbabilityInfo in If-Conversion instead of its own heuristics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4e2710c266c0f5b074589602d17066ff5f23a641 22-Jul-2011 Jakub Staszak <jstaszak@apple.com> Revert patch which broke some IfConversion tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6b598748b1e03b6b188726d5a0fef2a6abc29562 22-Jul-2011 Jakub Staszak <jstaszak@apple.com> Fix typo in #include which revealed in the case-sensitive filesystem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8592d903e1c9b48a247c0f91e28617b309eff6be 22-Jul-2011 Jakub Staszak <jstaszak@apple.com> Use MachineBranchProbabilityInfo instead of MachineLoopInfo in IfConversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f81b7f6069b27c0a515070dcb392f6828437412f 10-Jul-2011 Jakub Staszak <jstaszak@apple.com> Use BranchProbability instead of floating points in IfConverter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134858 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
2b33f4cbad43dcaca944d02a6ea67991ff9db9cf 10-Jul-2011 Jakub Staszak <jstaszak@apple.com> Don't analyze block if it's not considered for ifcvt anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ab8be96fd30ca9396e6b84fdddf1ac6208984cad 29-Jun-2011 Evan Cheng <evan.cheng@apple.com> Sink SubtargetFeature and TargetInstrItineraries (renamed MCInstrItineraries) into MC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.cpp
cbc988be22bc9411d95215c8b7251b5f85710674 12-May-2011 Evan Cheng <evan.cheng@apple.com> Re-commit 131172 with fix. MachineInstr identity checks should check dead
markers. In some cases a register def is dead on one path, but not on
another.

This is passing Clang self-hosting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131214 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
41cdc16e7301c91d2460aa14412f592695b0d4ed 11-May-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 131172 as it is causing clang to miscompile itself. I will try
to provide a reduced testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7e20a574eb3f4fc3840a0490c814443d756e2e0e 11-May-2011 Evan Cheng <evan.cheng@apple.com> Add a late optimization to BranchFolding that hoist common instruction sequences
at the start of basic blocks to their common predecessor. It's actually quite
common (e.g. about 50 times in JM/lencod) and has shown to be a nice code size
benefit. e.g.

pushq %rax
testl %edi, %edi
jne LBB0_2
## BB#1:
xorb %al, %al
popq %rdx
ret
LBB0_2:
xorb %al, %al
callq _foo
popq %rdx
ret

=>

pushq %rax
xorb %al, %al
testl %edi, %edi
je LBB0_2
## BB#1:
callq _foo
LBB0_2:
popq %rdx
ret

rdar://9145558


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131172 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
309db7c947de7f0f9730dff5f95bc1cc5bd1db7d 27-Apr-2011 Evan Cheng <evan.cheng@apple.com> If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f788854d20b12c60fd8b43c587adb3227b6b1bff 06-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Prune includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8239daf7c83a65a189c352cce3191cdc3bbfe151 03-Nov-2010 Evan Cheng <evan.cheng@apple.com> Two sets of changes. Sorry they are intermingled.

1. Fix pre-ra scheduler so it doesn't try to push instructions above calls to
"optimize for latency". Call instructions don't have the right latency and
this is more likely to use introduce spills.
2. Fix if-converter cost function. For ARM, it should use instruction latencies,
not # of micro-ops since multi-latency instructions is completely executed
even when the predicate is false. Also, some instruction will be "slower"
when they are predicated due to the register def becoming implicit input.
rdar://8598427


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7c730e77908123a83abcfffe781d368e9b873ce9 26-Oct-2010 Bob Wilson <bob.wilson@apple.com> When the "true" and "false" blocks of a diamond if-conversion are the same,
do not double-count the duplicate instructions by counting once from the
beginning and again from the end. Keep track of where the duplicates from
the beginning ended and don't go past that point when counting duplicates
at the end. Radar 8589805.

This change causes one of the MC/ARM/simple-fp-encoding tests to produce
different (better!) code without the vmovne instruction being tested.
I changed the test to produce vmovne and vmoveq instructions but moving
between register files in the opposite direction. That's not quite the same
but predicated versions of those instructions weren't being tested before,
so at least the test coverage is not any worse, just different.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
2ad40d34947ced36d96f351f6c2a4d57a044e2a4 26-Oct-2010 Bob Wilson <bob.wilson@apple.com> Change if-conversion to keep track of the extra cost due to microcoded
instructions separately from the count of non-predicated instructions. The
instruction count is used in places to determine how many instructions to
copy, predicate, etc. and things get confused if that count includes the
extra cost for microcoded ops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117332 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.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/IfConversion.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/IfConversion.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/IfConversion.cpp
e3cc84a43d6a4bb6c50f58f3dd8e60e28787509e 02-Oct-2010 Owen Anderson <resistor@mac.com> Thread the determination of branch prediction hit rates back through the if-conversion heuristic APIs. For now,
stick with a constant estimate of 90% (branch predictors are good!), but we might find that we want to provide
more nuanced estimates in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6406d004c98af569632ecc1db5d852ac7da9b7c8 30-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence msvc warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7571ee7885e270192a5f1b945c94c342d45e56f8 28-Sep-2010 Owen Anderson <resistor@mac.com> Give the if-converter access to MachineLoopInfo, and use it to generate plausible branch prediction
estimates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b20b85168c0e9819e6545f08281e9b83c82108f0 28-Sep-2010 Owen Anderson <resistor@mac.com> Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.

For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
3ef1c8759a20167457eb7fd82ebcaffe7ccaa1d1 10-Sep-2010 Evan Cheng <evan.cheng@apple.com> Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode.
For the current if-converter clients (actually only ARM), the instructions that
are predicated on false are not nops. They would still take machine cycles to
decode. Micro-coded instructions such as LDM / STM can potentially take multiple
cycles to decode. If-converter should take treat them as non-micro-coded
simple instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8eab75f390eb469fea16a290dcd841365007a9a6 29-Jun-2010 Bob Wilson <bob.wilson@apple.com> Reapply my if-conversion cleanup from svn r106939 with fixes.
There are 2 changes relative to the previous version of the patch:

1) For the "simple" if-conversion case, there's no need to worry about
RemoveExtraEdges not handling an unanalyzable branch. Predicated terminators
are ignored in this context, so RemoveExtraEdges does the right thing.
This might break someday if we ever treat indirect branches (BRIND) as
predicable, but for now, I just removed this part of the patch, because
in the case where we do not add an unconditional branch, we rely on keeping
the fall-through edge to CvtBBI (which is empty after this transformation).

The change relative to the previous patch is:

@@ -1036,10 +1036,6 @@
IterIfcvt = false;
}

- // RemoveExtraEdges won't work if the block has an unanalyzable branch,
- // which is typically the case for IfConvertSimple, so explicitly remove
- // CvtBBI as a successor.
- BBI.BB->removeSuccessor(CvtBBI->BB);
RemoveExtraEdges(BBI);

// Update block info. BB can be iteratively if-converted.


2) My patch exposed a bug in the code for merging the tail of a "diamond",
which had previously never been exercised. The code was simply checking that
the tail had a single predecessor, but there was a case in
MultiSource/Benchmarks/VersaBench/dbms where that single predecessor was
neither edge of the diamond. I added the following change to check for
that:

@@ -1276,7 +1276,18 @@
// tail, add a unconditional branch to it.
if (TailBB) {
BBInfo TailBBI = BBAnalysis[TailBB->getNumber()];
- if (TailBB->pred_size() == 1 && !TailBBI.HasFallThrough) {
+ bool CanMergeTail = !TailBBI.HasFallThrough;
+ // There may still be a fall-through edge from BBI1 or BBI2 to TailBB;
+ // check if there are any other predecessors besides those.
+ unsigned NumPreds = TailBB->pred_size();
+ if (NumPreds > 1)
+ CanMergeTail = false;
+ else if (NumPreds == 1 && CanMergeTail) {
+ MachineBasicBlock::pred_iterator PI = TailBB->pred_begin();
+ if (*PI != BBI1->BB && *PI != BBI2->BB)
+ CanMergeTail = false;
+ }
+ if (CanMergeTail) {
MergeBlocks(BBI, TailBBI);
TailBBI.IsDone = true;
} else {

With these fixes, I was able to run all the SingleSource and MultiSource
tests successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d459f457b8c855030217d878988062918dc71e13 28-Jun-2010 Jim Grosbach <grosbach@apple.com> new, no longer brain-dead, r106907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c4abe3aaaf45f69387b8cf55f1870ea416586290 28-Jun-2010 Daniel Dunbar <daniel@zuster.org> Revert r106907, "make sure to handle dbg_value instructions in the middle of the
block, not...", it caused a bunch of nightly test regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107009 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
de4fe231392165c7566081fb3f86aee4f6a4e0d6 26-Jun-2010 Bob Wilson <bob.wilson@apple.com> Revert my if-conversion cleanup since it caused a bunch of nightly test
regressions.

--- Reverse-merging r106939 into '.':
U test/CodeGen/Thumb2/thumb2-ifcvt3.ll
U lib/CodeGen/IfConversion.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ccd9bcca14e7046b7078cdf472a9185b86cdf07d 26-Jun-2010 Bob Wilson <bob.wilson@apple.com> Clean up some problems with extra CFG edges being introduced during
if-conversion. The RemoveExtraEdges function doesn't work for blocks that
end with unanalyzable branches, so in those cases, the "extra" edges must
be explicitly removed. The CopyAndPredicateBlock and MergeBlocks methods
can also avoid copying successor edges due to branches that have already
been removed. The latter case is especially helpful when MergeBlocks is
called for handling "diamond" if-conversions, where otherwise you can end
up with some weird intermediate states in the CFG. Unfortunately I've
been unable to find cases where this cleanup actually makes a significant
difference in the code. There is one test where we manage to remove an
empty block at the end of a function. Radar 6911268.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9f054f017c7bced071f5a4de606cec6751edd23f 26-Jun-2010 Jim Grosbach <grosbach@apple.com> make sure to handle dbg_value instructions in the middle of the block, not
just at the head, when doing diamond if-conversion. rdar://7797940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
13151432edace19ee867a93b5c14573df4f75d24 26-Jun-2010 Evan Cheng <evan.cheng@apple.com> Change if-conversion block size limit checks to add some flexibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106901 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
135ec50ce26b4bb9aee305f5e861d2348969aa31 26-Jun-2010 Jim Grosbach <grosbach@apple.com> 80 column and typo fix

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
fe60104ac97f3a8736dcfbfdf9547c7b7cc7b951 22-Jun-2010 Dan Gohman <gohman@apple.com> Use pre-increment instead of post-increment when the result is not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
54eee524f192a0e7395d057481e8d4240729d7b4 19-Jun-2010 Bob Wilson <bob.wilson@apple.com> Tidy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
86050dc8cc0aaea8c9dfeb89de02cafbd7f48d92 19-Jun-2010 Evan Cheng <evan.cheng@apple.com> Allow ARM if-converter to be run after post allocation scheduling.
- This fixed a number of bugs in if-converter, tail merging, and post-allocation
scheduler. If-converter now runs branch folding / tail merging first to
maximize if-conversion opportunities.
- Also changed the t2IT instruction slightly. It now defines the ITSTATE
register which is read by instructions in the IT block.
- Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't
change the instruction ordering in the IT block (since IT mask has been
finalized). It also ensures no other instructions can be scheduled between
instructions in the IT block.

This is not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6a5e2832d0a30719602f9befe61f35ab19299de7 19-Jun-2010 Evan Cheng <evan.cheng@apple.com> Fix an inverted condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106330 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a9934dc20a5e137a35be6f640c79fda9261f985b 18-Jun-2010 Evan Cheng <evan.cheng@apple.com> Teach iff-converter to properly count # of dups. It was not skipping over dbg_value's which resulted in non-duplicated instructions being deleted. rdar://8104384.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f50e952b0d3df2045b48c8e1ce86639affa6d02c 18-Jun-2010 Bob Wilson <bob.wilson@apple.com> Fix PR7372: Conditional branches (at least on ARM) are treated as predicated,
so when IfConverter::CopyAndPredicateBlock checks to see if it should ignore
an instruction because it is a branch, it should not check if the branch is
predicated.

This case (when IgnoreBr is true) is only relevant from IfConvertTriangle,
where new branches are inserted after the block has been copied and predicated.
If the original branch is not removed, we end up with multiple conditional
branches (possibly conflicting) at the end of the block. Aside from any
immediate errors resulting from that, this confuses the AnalyzeBranch functions
so that the branches are not analyzable. That in turn causes the IfConverter to
think that the "Simple" pattern can be applied, and things go downhill fast
because the "Simple" pattern does _not_ apply if the block can fall through.

This is pretty fragile. If there are other degenerate cases where AnalyzeBranch
fails, but where the block may still fall through, the IfConverter should not
perform its "Simple" if-conversion. But, I don't know how to do that with the
current AnalyzeBranch interface, so for now, the best thing seems to be to
avoid creating branches that AnalyzeBranch cannot handle.

Evan, please review!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
3bf912593301152b65accb9d9c37a95172f1df5a 18-Jun-2010 Stuart Hastings <stuart@apple.com> Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). This
addresses a longstanding deficiency noted in many FIXMEs scattered
across all the targets.

This effectively moves the problem up one level, replacing eleven
FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path
through FastISel where we actually supply a DebugLoc, fixing Radar
7421831.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
46df4eb46e784036cf895db271fe29e1cf2a975a 16-Jun-2010 Evan Cheng <evan.cheng@apple.com> Make post-ra scheduling, anti-dep breaking, and register scavenger (conservatively) aware of predicated instructions. This enables ARM to move if-conversion before post-ra scheduler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
92fffe04057d4528d1336b6a552a07f06858d3cb 16-Jun-2010 Bob Wilson <bob.wilson@apple.com> Fix 80col violations, remove trailing whitespace, and clarify a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6fb124bee95d07f5d5aed42c92182a813fd31cbd 15-Jun-2010 Bob Wilson <bob.wilson@apple.com> IfConversion's AnalyzeBlocks method always returns false; clean it up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
669db04130911252a38d4470a7c136ffc26ec577 15-Jun-2010 Bob Wilson <bob.wilson@apple.com> Fix a comment typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c834f413ae9bfd6d41545aed8d6b91c8ccb8ea16 14-Jun-2010 Jim Grosbach <grosbach@apple.com> More dbg_value cleanup so the presence of debug info doesn't affect code-gen.
Make sure to skip the dbg_value instructions when moving dups out of the
diamond. rdar://7797940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
66f360e990fd54ba1ea02e1ad66e2551cdb519af 07-Jun-2010 Jim Grosbach <grosbach@apple.com> Cleanup. Process the dbg_values separately

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
41a628237ce7892e081f126826db6b2391b100aa 07-Jun-2010 Jim Grosbach <grosbach@apple.com> Move exit check where it really belongs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
870c80540d90e748df95b2e9180fa1961d739229 05-Jun-2010 Jim Grosbach <grosbach@apple.com> Make if-conversion ignore dbg_value instructions in its analysis. rdar://7797940

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105498 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
083b7ffb4dafaec9431e9b620a36b72966efdc25 04-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e54cb16308ad40d0f0b257de47efaa0ee5a47004 21-Nov-2009 Evan Cheng <evan.cheng@apple.com> Allow target to disable if-converting predicable instructions. e.g. NEON instructions under ARM mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a597103c328e29fb763e7a4864bd7c29a588fc9d 28-Oct-2009 Bob Wilson <bob.wilson@apple.com> Revert r85346 change to control tail merging by CodeGenOpt::Level.
I'm going to redo this using the OptimizeForSize function attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
cd4f04d6bcb7aefa24d92582fbadfe17519f4756 28-Oct-2009 Bob Wilson <bob.wilson@apple.com> Record CodeGen optimization level in the BranchFolding pass so that we can
use it to control tail merging when there is a tradeoff between performance
and code size. When there is only 1 instruction in the common tail, we have
been merging. That can be good for code size but is a definite loss for
performance. Now we will avoid tail merging in that case when the
optimization level is "Aggressive", i.e., "-O3". Radar 7338114.

Since the IfConversion pass invokes BranchFolding, it too needs to know
the optimization level. Note that I removed the RegisterPass instantiation
for IfConversion because it required a default constructor. If someone
wants to keep that for some reason, we can add a default constructor with
a hard-wired optimization level.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6726b6d75a8b679068a58cb954ba97cf9d1690ba 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
030a0a0cdb38924e55773a8e0b5fe7347aa664aa 04-Sep-2009 Evan Cheng <evan.cheng@apple.com> Run branch folding if if-converter make some transformations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
705e07f578e2b3af47ddab610feb4e7f2d3063a5 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove various std::ostream version of printing methods from
MachineInstr and MachineOperand. This required eliminating a
bunch of stuff that was using DOUT, I hope that bill doesn't
mind me stealing his fun. ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
44ff7949c73580bf2bc5d075527fc13d8b7ef6a1 22-Aug-2009 Bill Wendling <isanbard@gmail.com> Convert DOUT to DEBUG(errs()...).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ce63ffb52f249b62cdf2d250c128007b13f27e71 25-Jul-2009 Daniel Dunbar <daniel@zuster.org> More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
"magic" DOUT behavior which avoided calling printing functions when the
statement was disabled. In addition to being unnecessary magic, it had the
downside of leaving code in -Asserts builds, and of hiding potentially
unnecessary computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c23197a26f34f559ea9797de51e187087c039c42 14-Jul-2009 Torok Edwin <edwintorok@gmail.com> llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f36892335b4919b9120e48a792e6b3630b9de978 12-Jul-2009 Torok Edwin <edwintorok@gmail.com> Fix assert(0) conversion, as suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7d696d80409aad20bb5da0fc4eccab941dd371d4 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
13bbe4bb9af9cd0789d81374bd5779d546936aad 25-Jun-2009 Owen Anderson <resistor@mac.com> Fewer static variables, part 3 of many.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
2077e18caf1425f83ce549913a1cffa0a4de192e 15-Jun-2009 Evan Cheng <evan.cheng@apple.com> ifcvt should ignore cfg where true and false successors are the same.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4bb3374b6d11a8a4ec1b174f0404bd6cbd2d00b9 14-May-2009 Bob Wilson <bob.wilson@apple.com> Revert r71744. I must not have understood this correctly, because the
assertion is failing for some tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
df1ed678904e65192ecdee9bd695f803c550ed68 14-May-2009 Bob Wilson <bob.wilson@apple.com> The IfConverter::MergeBlocks method appears to be used only to merge a basic
block with its unique predecessor. Change the code to assert if that is not
the case, instead of trying to handle situations where the block has
multiple predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8308e8fae0dad2dff22f0cedbfb5e1be3a146375 14-May-2009 Bob Wilson <bob.wilson@apple.com> Revert a portion of Dan's change r71018 that I'm convinced is wrong.
Dan was trying to catch the case where a basic block ends with a conditional
branch to the fall-through block. In this case, all the instructions have
been moved out of FromBBI, leaving it empty. It cannot end with a
conditional branch. As the existing comment indicates, it will always fall
through to the next block. If the block already had the next block (NBB)
listed as a successor, the preceding loop has a check for that and does not
remove it. Thus, we need to check and add the successor only when it is
not already listed.

With Dan's change, the empty block often ends up with the fall-through
successor listed twice. This exposed the problem in pr4195, where
CodePlacementOpt did not handle the same predecessor listed more than once.
It is also at least partially responsible for pr4202 and probably a similar
issue with Thumb branches being out of range.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
596e22e2b3a1375bad678eb1c5e95b3188a0532b 14-May-2009 Bob Wilson <bob.wilson@apple.com> Merge adjacent conditional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71741 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e19fb7de631acc4e50653926fe023d35be0293e2 14-May-2009 Bob Wilson <bob.wilson@apple.com> Remove an unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71740 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9c4856a4cf90155312181bf85e47f6149ba15034 14-May-2009 Bob Wilson <bob.wilson@apple.com> Fix some typos and spelling and grammar, mostly in comments, but also one
field name. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
5412d06e9c352c9795f4a71b91c4f869585866eb 05-May-2009 Dan Gohman <gohman@apple.com> If a MachineBasicBlock has multiple ways of reaching another block,
allow it to have multiple CFG edges to that block. This is needed
to allow MachineBasicBlock::isOnlyReachableByFallthrough to work
correctly. This fixes PR4126.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
20d629cb904fd5df05046a2eb43227a96d843448 04-Nov-2008 Duncan Sands <baldrick@free.fr> Fix typo. Patch by nlewycky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7ecbfd115721c282b3b67c64d02b2ca0f000608c 04-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> fix leakage of IfcvtTokens

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
279c22e6da2612f024b70e5509ffb0cad32f38b2 21-Oct-2008 Dan Gohman <gohman@apple.com> Optimized FCMP_OEQ and FCMP_UNE for x86.

Where previously LLVM might emit code like this:

ucomisd %xmm1, %xmm0
setne %al
setp %cl
orb %al, %cl
jne .LBB4_2

it now emits this:

ucomisd %xmm1, %xmm0
jne .LBB4_2
jp .LBB4_2

It has fewer instructions and uses fewer registers, but it does
have more branches. And in the case that this code is followed by
a non-fallthrough edge, it may be followed by a jmp instruction,
resulting in three branch instructions in sequence. Some effort
is made to avoid this situation.

To achieve this, X86ISelLowering.cpp now recognizes FCMP_OEQ and
FCMP_UNE in lowered form, and replace them with code that emits
two branches, except in the case where it would require converting
a fall-through edge to an explicit branch.

Also, X86InstrInfo.cpp's branch analysis and transform code now
knows now to handle blocks with multiple conditional branches. It
uses loops instead of having fixed checks for up to two
instructions. It can now analyze and transform code generated
from FCMP_OEQ and FCMP_UNE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
1501cdbf63cff3afd92df6cd249096770334b268 22-Aug-2008 Dan Gohman <gohman@apple.com> Fix SmallVector's size calculation so that a size of 0 is
handled correctly, and change a few SmallVector uses to use
size 0 to more clearly reflect their intent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
44eb65cf58e3ab9b5621ce72256d1621a18aeed7 15-Aug-2008 Owen Anderson <resistor@mac.com> Convert uses of std::vector in TargetInstrInfo to SmallVector. This change had to be propoagated down into all the targets and up into all clients of this API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8e5f2c6f65841542e2a7092553fe42a00048e4c7 08-Jul-2008 Dan Gohman <gohman@apple.com> Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b3dd264f9d356afd6fdc4a3ab17bf2404d062724 04-Jun-2008 Evan Cheng <evan.cheng@apple.com> Register if-converter pass for -debug-pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
fb8075d03f5c87bd57dcc9c5f2304f6b13c55aad 28-Feb-2008 Evan Cheng <evan.cheng@apple.com> Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4c71dfe356716e6bc1993ef5efdced08b68fe612 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Update gcc 4.3 warnings fix patch with recent head changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
303595942502f17c087fa28874c2b89117148c45 29-Jan-2008 Dan Gohman <gohman@apple.com> Use empty() instead of comparing size() with zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
749c6f6b5ed301c84aac562e414486549d7b98eb 07-Jan-2008 Chris Lattner <sabre@nondot.org> rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f86e1df8770faa76bb277d7c3c27a407869c6f0c 07-Jan-2008 Chris Lattner <sabre@nondot.org> simplify some code using new predicates



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
69244300b8a0112efb44b6273ecea4ca6264b8cf 07-Jan-2008 Chris Lattner <sabre@nondot.org> Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
11ce02dbddf4b6629b8537f89d742c98c3c2bce2 10-Jul-2007 Evan Cheng <evan.cheng@apple.com> Somehow this wasn't committed last time. M_CLOBBERS_PRED is gone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38495 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d2c5eb864fc80665ca57038793f2f4a296a87eb3 07-Jul-2007 Evan Cheng <evan.cheng@apple.com> Teach if-conversion about instructions that were already predicated, e.g. conditional move.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37964 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9ffd340daf00fb6e2bbfe6dafd5b7130070b1578 19-Jun-2007 Evan Cheng <evan.cheng@apple.com> Avoid if-converting simple block that ends with unconditional branch or fallthrough unless it branches / falls to the 'false' block. Not profitable, may end up increasing code size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
eaa91b0a1fc68984aae51f3c4b0cf29b38f89dac 19-Jun-2007 Evan Cheng <evan.cheng@apple.com> Replace TargetInstrInfo::CanBeDuplicated() with a M_NOT_DUPLICABLE bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37643 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c4047a8e96408a6149c2b64c953774fa578769fd 19-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix some fragile code wrt CFG edge updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a1a878791b305880c976038b8fcd2697b7799ec1 18-Jun-2007 Evan Cheng <evan.cheng@apple.com> Properly remove duplicate instructions as result of diamond if-conversion. Other bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e882fca902ba6b1a9e0c361c5781084f79eb6216 16-Jun-2007 Evan Cheng <evan.cheng@apple.com> Really turn if-converter loose:
1. Consider all possible ifcvt cases at once. No longer restricted to bottom
up iterative approach.
2. Sort all possible cases based on a cost function. Perform the most profitable
ones first invalidate others that target the same blocks.
3. Fixed a number of bugs related to block duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a2acf840a70c273a03ffb5752221350b4949fc0e 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> Not every predicable block can be safely duplicated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
bf9d02eaf6378c3d35d6202ad803b0374132fc61 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> MachineInstr::isPredicable() is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
93335459802fbbe61d5ca52831a636989b838094 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> Extra edges are deleted later if needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37593 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
2c8c3a4a0df00eee39c28d827d43a1d5462b0671 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> Allow small blocks to be duplicated to enable if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
bc198eeba6d6850639c9ed6449b01aec95d7d205 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> No really, clear predcessors states.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e37e24331c6fb3e83d5fb0c9ce31be619359a52a 15-Jun-2007 Evan Cheng <evan.cheng@apple.com> If BB is predicated, invalidate its predecessor(s) which would if-convert it. It needs to be re-analyzed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b7c908bb81fe4336f60c03802dade7c24a02e619 14-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
86ff296e63cd9d4c28a7b73d3d6ec05e4011a0e5 14-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix some stupid bugs that have effectively disabled if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
93a8e5ea0ccb6fab5cd1a155e62ae73e7dca7d47 13-Jun-2007 Evan Cheng <evan.cheng@apple.com> Typo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
cc8fb46cdc47cac1d4b3b92ffcca75f3216a8698 13-Jun-2007 Evan Cheng <evan.cheng@apple.com> Now if-converting all 4 variants of triangles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
9618bcaf7d3e6fd4a26fab47efb0bd2409b69e0f 12-Jun-2007 Evan Cheng <evan.cheng@apple.com> Restructure code to reduce ifcvt compile time cost.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a9bf49c7e321b789088779a608f3aa9287343982 10-Jun-2007 Reid Spencer <rspencer@reidspencer.com> Fix the build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
1c9f91d7b2653dc730a80f49ac3b6e2b9d6ca236 09-Jun-2007 Evan Cheng <evan.cheng@apple.com> Don't change CFG during analysis stage. Do so during ifcvt and invalidate predecessors accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7e75ba802e4e5df9fe8f0d38a85e05adc05ea7f3 09-Jun-2007 Evan Cheng <evan.cheng@apple.com> Carefully remove extraneous CFG edges after each ifcvt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
2acdbcccd8043d3a91430fdfcef6ba0760c1cc05 08-Jun-2007 Evan Cheng <evan.cheng@apple.com> Correct transfer predicate information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
edf4896a1461fe43081aab3ab7dda16f9dac8590 08-Jun-2007 Evan Cheng <evan.cheng@apple.com> Hidden options to help debugging ifcvt issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
ac5f142b9f80797a294b42ef65d5c4bfbdc168da 08-Jun-2007 Evan Cheng <evan.cheng@apple.com> Allow more cmp / bcc to be predicated; clean up triangle ifcvt checking code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
27af5c414b44315676b4625dc22e29a507ca9dca 08-Jun-2007 Evan Cheng <evan.cheng@apple.com> Only remove the edge from entry to false if false block is merged.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f476961ae6839496b715339cc9c2e28d5c1afbf5 07-Jun-2007 Evan Cheng <evan.cheng@apple.com> ifcvt a triangle: don't merge ifcvt block with rejoin block if it can fall through to it. If merged, the resulting block is not a candidate for iterative ifcvting since it contains both predicated and non-predicated code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d4de6d91b2fd855ff533661dc29c6a879aaa6456 07-Jun-2007 Evan Cheng <evan.cheng@apple.com> Lots of bug fixes. Now finally in a reasonable state.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
96dd9a8b1b969ece5504559ec240930bcb1dddd9 06-Jun-2007 Owen Anderson <resistor@mac.com> Quick patch to fix the build, based on what it appears Evan meant to write.

Evan, please check that this is in fact correct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7a655479ae56f8b71ea266f3fde3f25a7bc7e8d4 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> Lots of bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
3d6f60ec19e8c29d2b06eadb992c3b8380d60585 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> If a unconditional branch is added to branch to the false path during ifcvt, the predicated block cannot be iteratively ifcvted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
cb78d67a1a4e3b17d5801099940901740c67f526 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> Minor statistics counting bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37451 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e705213b679fdfc27b74b12adf7f40c94b97f9b9 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix a couple of typos and be smarter about order of blocks when ifcvt a diamond.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
993fc9594eca60ef5294b4c90cb2e36dd2503163 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix diamond shape ifcvt bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a1a9f408dadefb157d1204f72200936f013521fd 06-Jun-2007 Evan Cheng <evan.cheng@apple.com> ReplaceUsesOfBlockWith() can modify the predecessors list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37441 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
e004317c66651a7bf8cdea7c15060c1f357c0e3e 05-Jun-2007 Evan Cheng <evan.cheng@apple.com> Do not ifcvt if either true / false path is a backedge. Not profitable in almost all cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c53ef58a3549131e5307f10417406e8fd8aea6d4 05-Jun-2007 Evan Cheng <evan.cheng@apple.com> I had a senior moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8ed680cce3d0cff361f352abce75a917093f0656 05-Jun-2007 Evan Cheng <evan.cheng@apple.com> If the predicated block requires an early exit, end the block there and add a unconditional branch to false block. AnalyzeBranch() does not understand early exits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f5305f9cc767ac18c258b03425c2c26345003acc 05-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix some subtle bugs: bug during succeessor copying; incorrectly updating states of ifcvted blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37429 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
3ec425470ff42da6b4c075cf6a46d4c002106487 04-Jun-2007 Evan Cheng <evan.cheng@apple.com> Forgot to check for if iterator reached the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b6665f62c5cb19a04c4bb0eecbc498d406ec85b3 04-Jun-2007 Evan Cheng <evan.cheng@apple.com> Let IfConverter loose. Allow more aggressive subsumptions; reorder basic blocks to expose more ifcvt opportunities; code clean up and fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37409 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
b5a06907881751a2f16e8b5bc049684ba1532dee 01-Jun-2007 Evan Cheng <evan.cheng@apple.com> Correctly mark early-exit on the false path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8c52938e44c6eacfee5faf7103e567f79fa5ebef 01-Jun-2007 Evan Cheng <evan.cheng@apple.com> Ifcvt triangle: don't ifcvt 'true' BB if it has other predecessors; don't merge 'false' BB if it has other predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
fe57a7e4df512f3a40b8ff463f5362a59908becc 01-Jun-2007 Evan Cheng <evan.cheng@apple.com> Remove a bogus check. Even terminators in a ifcvt need to be predicated. Unconditional branches can usually be converted to conditional ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
5f70218c7534d7214cc23b7151ab25771bd3151b 01-Jun-2007 Evan Cheng <evan.cheng@apple.com> Allow multiple ifcvt candidates to share children blocks; add some debugging code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
f15d44cc108a1ce8139b3c80fff7b99cbd651333 31-May-2007 Evan Cheng <evan.cheng@apple.com> Fix a typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37374 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
8258210ed4ab819fd064be2616a4041afd761d79 30-May-2007 Evan Cheng <evan.cheng@apple.com> Change traversal order to bottom up in preparation for more aggressive if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
58fbb9f5babf00bd0a0e5b0f39bb718275972ec6 30-May-2007 Evan Cheng <evan.cheng@apple.com> Don't merge in tail block of a diamond if it has more than one predecessors after if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37353 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c8ed9badfabf8933acf5fcf8a58248c93f401076 30-May-2007 Evan Cheng <evan.cheng@apple.com> If there is an empty block between a source and its successor block, it still requires a unconditional branch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4bec8ae694be9db7505f5589b018a84334730875 25-May-2007 Evan Cheng <evan.cheng@apple.com> Silly boog.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a13aa95bc8d1f0838b46a456c607a7bddab6412a 23-May-2007 Evan Cheng <evan.cheng@apple.com> Preliminary iterative if-conversion support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
a6b4f43eaa5a59d6624fbbfcd8d339365129fafd 22-May-2007 Evan Cheng <evan.cheng@apple.com> If-convert early exit blocks (returns, etc.); bug fixes, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
7f8ff8af1a4372189f22136eb95fe67e3dcfae41 18-May-2007 Evan Cheng <evan.cheng@apple.com> Clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
36489bbbacb2adf0d639faa2d1bc2bbde9936396 18-May-2007 Evan Cheng <evan.cheng@apple.com> Change to depth-first traversal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
cf6cc112d5d8eee8e4cff04615e6ecf8946e17e8 18-May-2007 Evan Cheng <evan.cheng@apple.com> Some restructuring in preparation for most aggressive if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
6092ca155610b6c4cb16f21a1dad1f990758730a 18-May-2007 Evan Cheng <evan.cheng@apple.com> Watch out for blocks that end with a return.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
47d25020728d23ca62a805963e3b0885a4df1bc6 18-May-2007 Evan Cheng <evan.cheng@apple.com> If true / false blocks fallthrough before ifcvt, add unconditional branches to ifcvt'd block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
86cbfea33bc736482cbf6c4ed9a01aefa704d097 18-May-2007 Evan Cheng <evan.cheng@apple.com> Make use of target specific block size limits; bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37195 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
d6ddc308f0320f1c35618cca29edcbf9418d65de 16-May-2007 Evan Cheng <evan.cheng@apple.com> isBlockPredicable() always ignore terminal instructions; add comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37126 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c3a289c4b5a60a204363ba4ae9f017ba87b714f9 16-May-2007 Evan Cheng <evan.cheng@apple.com> Rename M_PREDICATED to M_PREDICABLE; Moved isPredicable() to MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
c5d05ef35780bf822765c5a3e2c13201450591ba 16-May-2007 Evan Cheng <evan.cheng@apple.com> Devang points out that we need an assertion here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/IfConversion.cpp
4e654852f1bee3813dcc1d207710f041cdd22717 16-May-2007 Evan Cheng <evan.cheng@apple.com> Initial commit of (very basic) if converter.


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