Displaying 20 results from an estimated 5000 matches similar to: "[LLVMdev] A question about FoldBranchtoCommonDest() in pass -simplifycfg"
2008 Aug 13
4
[LLVMdev] A case where llvm created different cfg for same code
>
> Message: 4
> Date: Tue, 12 Aug 2008 13:23:52 -0700
> From: "Bill Wendling" <isanbard at gmail.com>
> Subject: Re: [LLVMdev] A case where llvm created different cfg for
> same code
> To: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Message-ID:
> <16e5fdf90808121323g1ae2a2e3lb6c5bd62521df621 at mail.gmail.com>
>
2012 Dec 24
0
[LLVMdev] Can simplifycfg kill llvm.lifetime intrinsics?
This looks like a bug in simplifycfg. We should preserve lifetime
intrinsics due to the reasons I described.
The code in //lib/Transforms/Utils/Local.cpp:
if (Succ->getSinglePredecessor()) {
// BB is the only predecessor of Succ, so Succ will end up with exactly
// the same predecessors BB had.
// Copy over any phi, debug or lifetime instruction.
2009 Aug 28
1
[LLVMdev] SimplifyCFG
Hello,
in the description of SimplifyCFG, it says that it can "Eliminates PHI
nodes for basic blocks with a single predecessor."
I tested this pass with a program that has phi nodes with a single
predecessor and it did not remove it. I also looked in the code and
found nothing to remove it. I'm I missing something, or it does not
remove phis with a single predecessor?
My
2012 Dec 25
0
[LLVMdev] Can simplifycfg kill llvm.lifetime intrinsics?
On Tue, Dec 25, 2012 at 11:09 PM, Rafael Espíndola <
rafael.espindola at gmail.com> wrote:
> On 24 December 2012 04:02, Alexey Samsonov <samsonov at google.com> wrote:
> > This looks like a bug in simplifycfg. We should preserve lifetime
> intrinsics
> > due to the reasons I described.
> > The code in //lib/Transforms/Utils/Local.cpp:
> >
> > if
2012 Dec 25
3
[LLVMdev] Can simplifycfg kill llvm.lifetime intrinsics?
On 24 December 2012 04:02, Alexey Samsonov <samsonov at google.com> wrote:
> This looks like a bug in simplifycfg. We should preserve lifetime intrinsics
> due to the reasons I described.
> The code in //lib/Transforms/Utils/Local.cpp:
>
> if (Succ->getSinglePredecessor()) {
> // BB is the only predecessor of Succ, so Succ will end up with exactly
> // the
2008 Aug 12
1
[LLVMdev] A case where llvm created different cfg for same code
Hi,
The following two segments of code are actually the same,
but llvm created different cfg for them.
Form1:
1 #define N 10
2 int test(int A[N][N])
3 {
4 int i, j;
5 int result =0;
6 for(j=0; j+2<N; ++j) {
7 //for(i=0; i<j && i+j+1<N; i++) {
8 for(i=0; i<j && i<N-j-1; i++) {
9 A[i+j+1][j] = A[j + 2][j-i] + i;
10 }
11 }
12
13 for (i=0; i<N-2; ++i)
14 for (j=0;
2013 Nov 19
1
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
On Tue, Nov 19, 2013 at 8:38 AM, Kostya Serebryany <kcc at google.com> wrote:
>
>
>
> On Tue, Nov 19, 2013 at 8:25 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> Just moving this branch of the thread out of the review because I don't
>> want to derail the review thread...
>>
>> Kostya - why are these two cases not optimization bugs in
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
On Tue, Nov 19, 2013 at 8:25 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Just moving this branch of the thread out of the review because I don't
> want to derail the review thread...
>
> Kostya - why are these two cases not optimization bugs in general? (why do
> they only affect sanitizers?)
>
The recent case from mozilla (
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
Just moving this branch of the thread out of the review because I don't
want to derail the review thread...
Kostya - why are these two cases not optimization bugs in general? (why do
they only affect sanitizers?)
On Mon, Nov 18, 2013 at 8:37 PM, Kostya Serebryany <kcc at google.com> wrote:
> And we've been just informed by the mozilla folks about yet another case
> of
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
My $0.02 - I'm not sure the transformation introduces a data race.
To the best of my understanding, the point of the C++11/C11 memory model is to allow a wide array of compiler transformations - including speculative loads - for non-atomic variables.
I believe what's most likely happening (without looking at the Mozilla source) is that the original program contains a C++ data race, and
2012 Dec 17
2
[LLVMdev] Can simplifycfg kill llvm.lifetime intrinsics?
Hi!
I'm working on ASan option that uses llvm.lifetime intrinsics to detect
use-after-scope bugs. In short, the idea is to
insert calls into ASan runtime that would mark the memory as "addressable"
or "unaddressable".
I see the following problem with the following "trivial" basic block:
for.body.lr.ph.i: ; preds = %for.body.i310
2008 Aug 13
0
[LLVMdev] A case where llvm created different cfg for same code
Hi,
> 7 for(i=0; i<j && i+j+1<N; i++) {
>
> 8 for(i=0; i<j && i<N-j-1; i++) {
the arithmetic might overflow in one of these
but not in the other.
Best wishes,
Duncan.
2016 Sep 02
2
Problem with "[SimplifyCFG] Handle tail-sinking of more than 2 incoming branches"
It’s not about weird restrictions we are adding, it’s about the fact that for that specific address space we cannot dynamically index into the memory.
The address needs to be a constant of some sort in the selection (it’s an hardware limitation, there’s nothing we can do about it) and the fact that it is transformed into a PHI makes it not constant anymore.
We will need to undo this into Codegen
2013 Nov 19
3
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
The root cause of those issues is the fact that sanitizers verify
C++-level semantics with LLVM IR level instrumentation. For example,
speculative loads are OK in IR if it can be proved that the load won't
trap, but in C++ it would be a data race.
On Tue, Nov 19, 2013 at 8:38 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>
>
> On Tue, Nov 19, 2013 at 8:25 PM, David
2008 Sep 04
3
[LLVMdev] A simple case about SDiv
Hi,
I have a simple C case as following:
int test(int x, int y) {
return -x / -y;
}
With llvm-gcc -O1, I got:
define i32 @test(i32 %x, i32 %y) nounwind {
entry:
sub i32 0, %x ; <i32>:0 [#uses=1]
sub i32 0, %y ; <i32>:1 [#uses=1]
sdiv i32 %0, %1 ; <i32>:2 [#uses=1]
ret i32 %2
}
With llvm-gcc -O2, I got:
define i32 @test(i32 %x, i32 %y) nounwind {
entry:
sdiv i32
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
----- Original Message -----
> From: "Kostya Serebryany" <kcc at google.com>
> To: "Michael M Kuperstein" <michael.m.kuperstein at intel.com>
> Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Tuesday, November 19, 2013 11:45:39 AM
> Subject: Re: [LLVMdev] Curiosity about transform changes under Sanitizers (Was:
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
What I'm trying to say is that according to my understanding of the C++11 memory model, even in that small reproducer, the store to g and the load from g are in fact a data race.
(This is regardless of the fact the load is protected by a branch that is not taken.)
From: Kostya Serebryany [mailto:kcc at google.com]
Sent: Tuesday, November 19, 2013 19:46
To: Kuperstein, Michael M
Cc: Evgeniy
2009 Jun 30
2
[LLVMdev] Irreducibility and the -simplifycfg flag
Hi everyone,
I'm currently trying to run a study on irreducibility of C programs, and
I've implemented structural analysis (original paper by Sharir, algorithm in
Muchnick's book) as an LLVM pass. When my implementation becomes a bit less
buggy I'll certainly look into including it in the LLVM project.
As a test for the algorithm I've been producing LLVM bitcode for C files
2013 Nov 19
0
[LLVMdev] Curiosity about transform changes under Sanitizers (Was: [PATCH] Disable branch folding with MemorySanitizer)
----- Original Message -----
> From: "David Blaikie" <dblaikie at gmail.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Kostya Serebryany" <kcc at google.com>, "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu>
> Sent: Tuesday, November 19, 2013 12:19:46 PM
> Subject: Re: [LLVMdev] Curiosity about transform
2016 Dec 26
1
Multiple simplifycfg pass make some loop significantly slower
Hi all,
I am noticing a significant degradation in execution performance in loops
with just one backedge than loops with two backedges. Unifying the
backedges into one will also cause the slowdown.
To replicate this problem, I used the C code in
https://gist.github.com/sklam/11f11a410258ca191e6f263262a4ea65 and checked
against clang-3.8 and clang-4.0 nightly. Depending on where I put the