<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm/lib/Transforms/Utils/CodeExtractor.cpp, branch release-3.2</title>
<subtitle>Unofficial llvm GIT mirror used in EmbToolkit
</subtitle>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/'/>
<entry>
<title>Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.</title>
<updated>2012-10-10T03:12:49+00:00</updated>
<author>
<name>Bill Wendling</name>
<email>isanbard@gmail.com</email>
</author>
<published>2012-10-10T03:12:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=f5e6d70f8c8f21e744a10fd463cdeddae31cbab5'/>
<id>f5e6d70f8c8f21e744a10fd463cdeddae31cbab5</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165595 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165595 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed r158979.</title>
<updated>2012-06-22T14:53:30+00:00</updated>
<author>
<name>Stepan Dyatkovskiy</name>
<email>stpworld@narod.ru</email>
</author>
<published>2012-06-22T14:53:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=43c3a4a7e76920c5646e473b72620acc7eb4ca5a'/>
<id>43c3a4a7e76920c5646e473b72620acc7eb4ca5a</id>
<content type='text'>
Original message:
Performance optimizations:
- SwitchInst: case values stored separately from Operands List. It allows to make faster access to individual case value numbers or ranges.
- Optimized IntItem, added APInt value caching.
- Optimized IntegersSubsetGeneric: added optimizations for cases when subset is single number or when subset consists from single numbers only.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158997 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Original message:
Performance optimizations:
- SwitchInst: case values stored separately from Operands List. It allows to make faster access to individual case value numbers or ranges.
- Optimized IntItem, added APInt value caching.
- Optimized IntegersSubsetGeneric: added optimizations for cases when subset is single number or when subset consists from single numbers only.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158997 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach the code extractor how to extract a sequence of blocks from</title>
<updated>2012-05-04T21:33:30+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T21:33:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=30ba82933c433611e05b07ef95da36bba8721b8b'/>
<id>30ba82933c433611e05b07ef95da36bba8721b8b</id>
<content type='text'>
RegionInfo's RegionNode. This mirrors the logic for automating the
extraction from a Loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156208 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RegionInfo's RegionNode. This mirrors the logic for automating the
extraction from a Loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156208 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Factor the computation of input and output sets into a public interface</title>
<updated>2012-05-04T11:20:27+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T11:20:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=90cb7089e364fdf09058bfb6a89a250fd7a871fb'/>
<id>90cb7089e364fdf09058bfb6a89a250fd7a871fb</id>
<content type='text'>
of the CodeExtractor utility. This allows speculatively computing input
and output sets to measure the likely size impact of the code
extraction.

These sets cannot be reused sadly -- we mutate the function prior to
forming the final sets used by the actual extraction.

The interface has been revamped slightly to make it easier to use
correctly by making the interface const and sinking the computation of
the number of exit blocks into the full extraction function and away
from the rest of this logic which just computed two output parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156168 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
of the CodeExtractor utility. This allows speculatively computing input
and output sets to measure the likely size impact of the code
extraction.

These sets cannot be reused sadly -- we mutate the function prior to
forming the final sets used by the actual extraction.

The interface has been revamped slightly to make it easier to use
correctly by making the interface const and sinking the computation of
the number of exit blocks into the full extraction function and away
from the rest of this logic which just computed two output parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156168 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Rather than trying to gracefully handle input sequences with repeated</title>
<updated>2012-05-04T11:17:06+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T11:17:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=50955031b81ef1abd54fecd587bee7959f7fa19d'/>
<id>50955031b81ef1abd54fecd587bee7959f7fa19d</id>
<content type='text'>
blocks, assert that this doesn't happen. We don't want to bother trying
to support this call pattern as it isn't necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156167 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
blocks, assert that this doesn't happen. We don't want to bother trying
to support this call pattern as it isn't necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156167 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a goof with my previous commit by completely returning when we</title>
<updated>2012-05-04T11:14:19+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T11:14:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=6a81f64ab6bfda1d17de5b405b3b47f67697c3bc'/>
<id>6a81f64ab6bfda1d17de5b405b3b47f67697c3bc</id>
<content type='text'>
detect an in-eligible block rather than just breaking out of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156166 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
detect an in-eligible block rather than just breaking out of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156166 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Hoist a safety assert from the extraction method into the construction</title>
<updated>2012-05-04T10:26:45+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T10:26:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=27742c1a76634312bc28cf37e89c83209576149f'/>
<id>27742c1a76634312bc28cf37e89c83209576149f</id>
<content type='text'>
of the extractor itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156164 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
of the extractor itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156164 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Move the CodeExtractor utility to a dedicated header file / source file,</title>
<updated>2012-05-04T10:18:49+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-04T10:18:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=99650c9088c5dd4b6788a99b63c82d13e0518961'/>
<id>99650c9088c5dd4b6788a99b63c82d13e0518961</id>
<content type='text'>
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156163 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156163 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Factor the logic for testing whether a basic block is viable for code</title>
<updated>2012-05-03T22:26:53+00:00</updated>
<author>
<name>Chandler Carruth</name>
<email>chandlerc@gmail.com</email>
</author>
<published>2012-05-03T22:26:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=9f7af7b74892e5479e26ab535c9a76131e1947c3'/>
<id>9f7af7b74892e5479e26ab535c9a76131e1947c3</id>
<content type='text'>
extraction into a public interface. Also clean it up and apply it more
consistently such that we check for landing pads *anywhere* in the
extracted code, not just in single-block extraction.

This will be used to guide decisions in passes that are planning to
eventually perform a round of code extraction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156114 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
extraction into a public interface. Also clean it up and apply it more
consistently such that we check for landing pads *anywhere* in the
extracted code, not just in single-block extraction.

This will be used to guide decisions in passes that are planning to
eventually perform a round of code extraction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156114 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:</title>
<updated>2012-03-08T07:06:20+00:00</updated>
<author>
<name>Stepan Dyatkovskiy</name>
<email>stpworld@narod.ru</email>
</author>
<published>2012-03-08T07:06:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/llvm/commit/?id=c10fa6c801e48771b5eade50afc2fe6abaf08227'/>
<id>c10fa6c801e48771b5eade50afc2fe6abaf08227</id>
<content type='text'>
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI-&gt;caseBegin(), e = SI-&gt;caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI-&gt;caseBegin(), e = SI-&gt;caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
</feed>
