mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Try again to disable critical edge splitting in CodeGenPrepare.
The bug that broke i386 linux has been fixed in r115191. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115204 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f9764fa14f
commit
7eb589d3f9
@ -31,6 +31,7 @@
|
|||||||
#include "llvm/Transforms/Utils/BuildLibCalls.h"
|
#include "llvm/Transforms/Utils/BuildLibCalls.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
#include "llvm/ADT/DenseMap.h"
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
|
#include "llvm/ADT/Statistic.h"
|
||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "llvm/Support/CallSite.h"
|
#include "llvm/Support/CallSite.h"
|
||||||
#include "llvm/Support/CommandLine.h"
|
#include "llvm/Support/CommandLine.h"
|
||||||
@ -42,10 +43,12 @@
|
|||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
using namespace llvm::PatternMatch;
|
using namespace llvm::PatternMatch;
|
||||||
|
|
||||||
|
STATISTIC(NumElim, "Number of blocks eliminated");
|
||||||
|
|
||||||
static cl::opt<bool>
|
static cl::opt<bool>
|
||||||
CriticalEdgeSplit("cgp-critical-edge-splitting",
|
CriticalEdgeSplit("cgp-critical-edge-splitting",
|
||||||
cl::desc("Split critical edges during codegen prepare"),
|
cl::desc("Split critical edges during codegen prepare"),
|
||||||
cl::init(true), cl::Hidden);
|
cl::init(false), cl::Hidden);
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CodeGenPrepare : public FunctionPass {
|
class CodeGenPrepare : public FunctionPass {
|
||||||
@ -302,6 +305,7 @@ void CodeGenPrepare::EliminateMostlyEmptyBlock(BasicBlock *BB) {
|
|||||||
PFI->removeEdge(ProfileInfo::getEdge(BB, DestBB));
|
PFI->removeEdge(ProfileInfo::getEdge(BB, DestBB));
|
||||||
}
|
}
|
||||||
BB->eraseFromParent();
|
BB->eraseFromParent();
|
||||||
|
++NumElim;
|
||||||
|
|
||||||
DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");
|
DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");
|
||||||
}
|
}
|
||||||
|
@ -624,11 +624,11 @@ bb23: ; preds = %bb22, %bb20, %bb9,
|
|||||||
bb24: ; preds = %bb23
|
bb24: ; preds = %bb23
|
||||||
|
|
||||||
; LSR should use count-down iteration to avoid requiring the trip count
|
; LSR should use count-down iteration to avoid requiring the trip count
|
||||||
; in a register, and it shouldn't require any reloads here.
|
; in a register.
|
||||||
|
|
||||||
; CHECK: @ %bb24
|
; CHECK: @ %bb24
|
||||||
; CHECK: subs{{.*}} [[REGISTER:(r[0-9]+)|(lr)]], #1
|
; CHECK: subs{{.*}} [[REGISTER:(r[0-9]+)|(lr)]], #1
|
||||||
; CHECK-NEXT: bne.w
|
; CHECK: bne.w
|
||||||
|
|
||||||
%92 = icmp eq i32 %tmp81, %indvar78 ; <i1> [#uses=1]
|
%92 = icmp eq i32 %tmp81, %indvar78 ; <i1> [#uses=1]
|
||||||
%indvar.next79 = add i32 %indvar78, 1 ; <i32> [#uses=1]
|
%indvar.next79 = add i32 %indvar78, 1 ; <i32> [#uses=1]
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
define void @_Z19getClosestDiagonal3ii(%0* noalias sret, i32, i32) nounwind {
|
define void @_Z19getClosestDiagonal3ii(%0* noalias sret, i32, i32) nounwind {
|
||||||
; CHECK: blx ___muldf3
|
; CHECK: blx ___muldf3
|
||||||
; CHECK: blx ___muldf3
|
; CHECK: blx ___muldf3
|
||||||
; CHECK: beq LBB0_8
|
; CHECK: beq LBB0_7
|
||||||
; CHECK: blx ___muldf3
|
; CHECK: blx ___muldf3
|
||||||
; <label>:3
|
; <label>:3
|
||||||
switch i32 %1, label %4 [
|
switch i32 %1, label %4 [
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 9
|
; RUN: llc < %s -march=x86 -mcpu=yonah -stats |& grep {Number of block tails merged} | grep 16
|
||||||
; PR1909
|
; PR1909
|
||||||
|
|
||||||
@.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
|
@.str = internal constant [48 x i8] c"transformed bounds: (%.2f, %.2f), (%.2f, %.2f)\0A\00" ; <[48 x i8]*> [#uses=1]
|
||||||
|
@ -389,7 +389,7 @@ return:
|
|||||||
; rdar://7657764
|
; rdar://7657764
|
||||||
|
|
||||||
; CHECK: asd:
|
; CHECK: asd:
|
||||||
; CHECK: BB9_5:
|
; CHECK: BB9_4:
|
||||||
; CHECK-NEXT: addl (%r{{[^,]*}},%rdi,4), %e
|
; CHECK-NEXT: addl (%r{{[^,]*}},%rdi,4), %e
|
||||||
; CHECK-NEXT: incq %rdi
|
; CHECK-NEXT: incq %rdi
|
||||||
; CHECK-NEXT: cmpq %rdi, %r{{[^,]*}}
|
; CHECK-NEXT: cmpq %rdi, %r{{[^,]*}}
|
||||||
@ -464,7 +464,7 @@ bb5: ; preds = %bb3, %entry
|
|||||||
|
|
||||||
; And the one at %bb68, where we want to be sure to use superhero mode:
|
; And the one at %bb68, where we want to be sure to use superhero mode:
|
||||||
|
|
||||||
; CHECK: BB10_9:
|
; CHECK: BB10_7:
|
||||||
; CHECK-NEXT: movaps 48(%r{{[^,]*}}), %xmm{{.*}}
|
; CHECK-NEXT: movaps 48(%r{{[^,]*}}), %xmm{{.*}}
|
||||||
; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}}
|
; CHECK-NEXT: mulps %xmm{{.*}}, %xmm{{.*}}
|
||||||
; CHECK-NEXT: movaps 32(%r{{[^,]*}}), %xmm{{.*}}
|
; CHECK-NEXT: movaps 32(%r{{[^,]*}}), %xmm{{.*}}
|
||||||
@ -484,7 +484,6 @@ bb5: ; preds = %bb3, %entry
|
|||||||
; CHECK-NEXT: addq $64, %r{{.*}}
|
; CHECK-NEXT: addq $64, %r{{.*}}
|
||||||
; CHECK-NEXT: addq $64, %r{{.*}}
|
; CHECK-NEXT: addq $64, %r{{.*}}
|
||||||
; CHECK-NEXT: addq $-16, %r{{.*}}
|
; CHECK-NEXT: addq $-16, %r{{.*}}
|
||||||
; CHECK-NEXT: BB10_10:
|
|
||||||
; CHECK-NEXT: cmpq $15, %r{{.*}}
|
; CHECK-NEXT: cmpq $15, %r{{.*}}
|
||||||
; CHECK-NEXT: jg
|
; CHECK-NEXT: jg
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
; RUN: llc < %s -march=x86 -stats |& grep {Number of blocks eliminated} | grep 6
|
||||||
; PR1296
|
; PR1296
|
||||||
; RUN: llc < %s -march=x86 | grep {movl \$1} | count 1
|
|
||||||
|
|
||||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
|
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
|
||||||
target triple = "i686-apple-darwin8"
|
target triple = "i686-apple-darwin8"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -march=x86 | grep mov | count 5
|
; RUN: llc < %s -march=x86 | grep mov | count 4
|
||||||
; PR2659
|
; PR2659
|
||||||
|
|
||||||
define i32 @binomial(i32 %n, i32 %k) nounwind {
|
define i32 @binomial(i32 %n, i32 %k) nounwind {
|
||||||
|
@ -68,7 +68,7 @@ bb26.preheader: ; preds = %imix_test.exit
|
|||||||
|
|
||||||
bb23: ; preds = %imix_test.exit
|
bb23: ; preds = %imix_test.exit
|
||||||
unreachable
|
unreachable
|
||||||
; X86-32: %bb26.preheader.bb28_crit_edge
|
; X86-32: %bb26.preheader
|
||||||
; X86-32: movl -16(%ebp),
|
; X86-32: movl -16(%ebp),
|
||||||
; X86-32-NEXT: .align 4
|
; X86-32-NEXT: .align 4
|
||||||
; X86-32-NEXT: %bb28
|
; X86-32-NEXT: %bb28
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 5
|
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 4
|
||||||
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | FileCheck %s
|
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | FileCheck %s
|
||||||
; PR2659
|
; PR2659
|
||||||
|
|
||||||
@ -14,10 +14,11 @@ forcond.preheader: ; preds = %entry
|
|||||||
%cmp44 = icmp eq i32 %k, 0 ; <i1> [#uses=1]
|
%cmp44 = icmp eq i32 %k, 0 ; <i1> [#uses=1]
|
||||||
br i1 %cmp44, label %afterfor, label %forbody
|
br i1 %cmp44, label %afterfor, label %forbody
|
||||||
|
|
||||||
; CHECK: %forcond.preheader.forbody_crit_edge
|
; CHECK: %forcond.preheader
|
||||||
; CHECK: movl $1
|
; CHECK: movl $1
|
||||||
; CHECK-NOT: xorl
|
; CHECK-NOT: xorl
|
||||||
; CHECK-NEXT: movl
|
; CHECK-NOT: movl
|
||||||
|
; CHECK-NEXT: je
|
||||||
|
|
||||||
ifthen: ; preds = %entry
|
ifthen: ; preds = %entry
|
||||||
ret i32 0
|
ret i32 0
|
||||||
|
@ -153,19 +153,16 @@ bb30:
|
|||||||
; an unconditional jump to complete a two-way conditional branch.
|
; an unconditional jump to complete a two-way conditional branch.
|
||||||
|
|
||||||
; CHECK: c_expand_expr_stmt:
|
; CHECK: c_expand_expr_stmt:
|
||||||
; CHECK: jmp .LBB3_7
|
; CHECK: jmp .LBB3_11
|
||||||
; CHECK-NEXT: .LBB3_12:
|
; CHECK-NEXT: .LBB3_9:
|
||||||
; CHECK-NEXT: movq 8(%rax), %rax
|
; CHECK-NEXT: movq 8(%rax), %rax
|
||||||
|
; CHECK-NEXT: xorb %dl, %dl
|
||||||
; CHECK-NEXT: movb 16(%rax), %al
|
; CHECK-NEXT: movb 16(%rax), %al
|
||||||
; CHECK-NEXT: cmpb $16, %al
|
; CHECK-NEXT: cmpb $16, %al
|
||||||
; CHECK-NEXT: je .LBB3_6
|
; CHECK-NEXT: je .LBB3_11
|
||||||
; CHECK-NEXT: cmpb $23, %al
|
; CHECK-NEXT: cmpb $23, %al
|
||||||
; CHECK-NEXT: je .LBB3_6
|
; CHECK-NEXT: jne .LBB3_14
|
||||||
; CHECK-NEXT: jmp .LBB3_15
|
; CHECK-NEXT: .LBB3_11:
|
||||||
; CHECK-NEXT: .LBB3_14:
|
|
||||||
; CHECK-NEXT: cmpb $23, %bl
|
|
||||||
; CHECK-NEXT: jne .LBB3_15
|
|
||||||
; CHECK-NEXT: .LBB3_15:
|
|
||||||
|
|
||||||
%0 = type { %struct.rtx_def* }
|
%0 = type { %struct.rtx_def* }
|
||||||
%struct.lang_decl = type opaque
|
%struct.lang_decl = type opaque
|
||||||
|
Loading…
Reference in New Issue
Block a user