<feed xmlns='http://www.w3.org/2005/Atom'>
<title>clang/lib/CodeGen/CGExprComplex.cpp, branch master</title>
<subtitle>Unofficial clang GIT mirror used in EmbToolkit
</subtitle>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/'/>
<entry>
<title>[C++11] Use 'nullptr'. CodeGen edition.</title>
<updated>2014-05-21T05:09:00+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@gmail.com</email>
</author>
<published>2014-05-21T05:09:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=d1008e5c93536222903523b70245ec66876bbad5'/>
<id>d1008e5c93536222903523b70245ec66876bbad5</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209272 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/cfe/trunk@209272 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Change PGO instrumentation to compute counts in a separate AST traversal.</title>
<updated>2014-02-17T19:21:09+00:00</updated>
<author>
<name>Bob Wilson</name>
<email>bob.wilson@apple.com</email>
</author>
<published>2014-02-17T19:21:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=ac14efa58af741a866e10ad8ce34250949d26960'/>
<id>ac14efa58af741a866e10ad8ce34250949d26960</id>
<content type='text'>
Previously, we made one traversal of the AST prior to codegen to assign
counters to the ASTs and then propagated the count values during codegen. This
patch now adds a separate AST traversal prior to codegen for the
-fprofile-instr-use option to propagate the count values. The counts are then
saved in a map from which they can be retrieved during codegen.

This new approach has several advantages:

1. It gets rid of a lot of extra PGO-related code that had previously been
added to codegen.

2. It fixes a serious bug. My original implementation (which was mailed to the
list but never committed) used 3 counters for every loop. Justin improved it to
move 2 of those counters into the less-frequently executed breaks and continues,
but that turned out to produce wrong count values in some cases. The solution
requires visiting a loop body before the condition so that the count for the
condition properly includes the break and continue counts. Changing codegen to
visit a loop body first would be a fairly invasive change, but with a separate
AST traversal, it is easy to control the order of traversal. I've added a
testcase (provided by Justin) to make sure this works correctly.

3. It improves the instrumentation overhead, reducing the number of counters for
a loop from 3 to 1. We no longer need dedicated counters for breaks and
continues, since we can just use the propagated count values when visiting
breaks and continues.

To make this work, I needed to make a change to the way we count case
statements, going back to my original approach of not including the fall-through
in the counter values. This was necessary because there isn't always an AST node
that can be used to record the fall-through count. Now case statements are
handled the same as default statements, with the fall-through paths branching
over the counter increments.  While I was at it, I also went back to using this
approach for do-loops -- omitting the fall-through count into the loop body
simplifies some of the calculations and make them behave the same as other
loops. Whenever we start using this instrumentation for coverage, we'll need
to add the fall-through counts into the counter values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201528 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, we made one traversal of the AST prior to codegen to assign
counters to the ASTs and then propagated the count values during codegen. This
patch now adds a separate AST traversal prior to codegen for the
-fprofile-instr-use option to propagate the count values. The counts are then
saved in a map from which they can be retrieved during codegen.

This new approach has several advantages:

1. It gets rid of a lot of extra PGO-related code that had previously been
added to codegen.

2. It fixes a serious bug. My original implementation (which was mailed to the
list but never committed) used 3 counters for every loop. Justin improved it to
move 2 of those counters into the less-frequently executed breaks and continues,
but that turned out to produce wrong count values in some cases. The solution
requires visiting a loop body before the condition so that the count for the
condition properly includes the break and continue counts. Changing codegen to
visit a loop body first would be a fairly invasive change, but with a separate
AST traversal, it is easy to control the order of traversal. I've added a
testcase (provided by Justin) to make sure this works correctly.

3. It improves the instrumentation overhead, reducing the number of counters for
a loop from 3 to 1. We no longer need dedicated counters for breaks and
continues, since we can just use the propagated count values when visiting
breaks and continues.

To make this work, I needed to make a change to the way we count case
statements, going back to my original approach of not including the fall-through
in the counter values. This was necessary because there isn't always an AST node
that can be used to record the fall-through count. Now case statements are
handled the same as default statements, with the fall-through paths branching
over the counter increments.  While I was at it, I also went back to using this
approach for do-loops -- omitting the fall-through count into the loop body
simplifies some of the calculations and make them behave the same as other
loops. Whenever we start using this instrumentation for coverage, we'll need
to add the fall-through counts into the counter values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201528 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Rename adjustFallThroughCount -&gt; adjustForControlFlow</title>
<updated>2014-01-13T21:24:22+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2014-01-13T21:24:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=1a92b70b61f43d59a8fa4c17808de5cab36f95e9'/>
<id>1a92b70b61f43d59a8fa4c17808de5cab36f95e9</id>
<content type='text'>
adjustFallThroughCount isn't a good name, and the documentation was
even worse. This commit attempts to clarify what it's for and when to
use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199139 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
adjustFallThroughCount isn't a good name, and the documentation was
even worse. This commit attempts to clarify what it's for and when to
use it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199139 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Initial instrumentation based PGO implementation</title>
<updated>2014-01-06T22:27:43+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2014-01-06T22:27:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=e0e019f6a2d76e140221d9c10159a444839e2563'/>
<id>e0e019f6a2d76e140221d9c10159a444839e2563</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198640 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/cfe/trunk@198640 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Add front-end infrastructure now address space casts are in LLVM IR.</title>
<updated>2013-12-11T13:39:46+00:00</updated>
<author>
<name>David Tweed</name>
<email>david.tweed@arm.com</email>
</author>
<published>2013-12-11T13:39:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=142f01674857b0fac52ddf1e4d315d74210a4584'/>
<id>142f01674857b0fac52ddf1e4d315d74210a4584</id>
<content type='text'>
With the introduction of explicit address space casts into LLVM, there's
a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA
and code to produce address space casts from those kinds when appropriate.

Patch by Michele Scandale!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197036 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the introduction of explicit address space casts into LLVM, there's
a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA
and code to produce address space casts from those kinds when appropriate.

Patch by Michele Scandale!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197036 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Whitespace</title>
<updated>2013-11-22T10:20:40+00:00</updated>
<author>
<name>Justin Bogner</name>
<email>mail@justinbogner.com</email>
</author>
<published>2013-11-22T10:20:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=89242238c10141ad06225238277d70eff05e93a5'/>
<id>89242238c10141ad06225238277d70eff05e93a5</id>
<content type='text'>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195437 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/cfe/trunk@195437 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occurs</title>
<updated>2013-10-02T02:29:49+00:00</updated>
<author>
<name>Nick Lewycky</name>
<email>nicholas@mxc.ca</email>
</author>
<published>2013-10-02T02:29:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176'/>
<id>4ee7dc2369c1f0257a73b2e83a7d38fdebdd9176</id>
<content type='text'>
when scalars are loaded / undergo lvalue-to-rvalue conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191808 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when scalars are loaded / undergo lvalue-to-rvalue conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191808 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Make IgnoreParens() look through ChooseExprs.</title>
<updated>2013-07-20T00:40:58+00:00</updated>
<author>
<name>Eli Friedman</name>
<email>eli.friedman@gmail.com</email>
</author>
<published>2013-07-20T00:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=a5e660188a3c654cf0c88ed1093b28207e870b2b'/>
<id>a5e660188a3c654cf0c88ed1093b28207e870b2b</id>
<content type='text'>
This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes &lt;rdar://problem/14438917&gt;.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the same way GenericSelectionExpr works, and it's generally a
more consistent approach.

A large part of this patch is devoted to caching the value of the condition
of a ChooseExpr; it's needed to avoid threading an ASTContext into
IgnoreParens().

Fixes &lt;rdar://problem/14438917&gt;.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186738 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Propagate alignment for _Complex</title>
<updated>2013-07-17T05:57:42+00:00</updated>
<author>
<name>JF Bastien</name>
<email>jfb@google.com</email>
</author>
<published>2013-07-17T05:57:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=ab96e565d6a5aa770ad31e7cb8100cd6a9b3d8a2'/>
<id>ab96e565d6a5aa770ad31e7cb8100cd6a9b3d8a2</id>
<content type='text'>
_Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex.

Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186490 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
_Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex.

Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186490 91177308-0d34-0410-b5e6-96231b3b80d8
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix crash on complex constant zero.</title>
<updated>2013-07-16T20:19:04+00:00</updated>
<author>
<name>Eli Friedman</name>
<email>eli.friedman@gmail.com</email>
</author>
<published>2013-07-16T20:19:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.embtoolkit.org/clang/commit/?id=be6d9130585c33aaea3ee152f365031999d8debe'/>
<id>be6d9130585c33aaea3ee152f365031999d8debe</id>
<content type='text'>
Fixes &lt;rdar://problem/14442543&gt;.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186452 91177308-0d34-0410-b5e6-96231b3b80d8
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes &lt;rdar://problem/14442543&gt;.

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