mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[MustExecute] Shwo the effect of using full loop info variant
Most basic possible test for the logic used by LICM. Also contains a speculative build fix for compiles which complain about a definition of a stuct K; followed by a declaration as class K; llvm-svn: 328058
This commit is contained in:
parent
f542698551
commit
9176c8f7af
@ -40,7 +40,6 @@ class BasicBlock;
|
|||||||
class DataLayout;
|
class DataLayout;
|
||||||
class Loop;
|
class Loop;
|
||||||
class LoopInfo;
|
class LoopInfo;
|
||||||
class LoopSafetyInfo;
|
|
||||||
class OptimizationRemarkEmitter;
|
class OptimizationRemarkEmitter;
|
||||||
class PredicatedScalarEvolution;
|
class PredicatedScalarEvolution;
|
||||||
class PredIteratorCache;
|
class PredIteratorCache;
|
||||||
|
@ -185,11 +185,13 @@ FunctionPass *llvm::createMustExecutePrinter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool isMustExecuteIn(const Instruction &I, Loop *L, DominatorTree *DT) {
|
bool isMustExecuteIn(const Instruction &I, Loop *L, DominatorTree *DT) {
|
||||||
// TODO: move loop specific code to analysis
|
// TODO: merge these two routines. For the moment, we display the best
|
||||||
//LoopSafetyInfo LSI;
|
// result obtained by *either* implementation. This is a bit unfair since no
|
||||||
//computeLoopSafetyInfo(&LSI, L);
|
// caller actually gets the full power at the moment.
|
||||||
//return isGuaranteedToExecute(I, DT, L, &LSI);
|
LoopSafetyInfo LSI;
|
||||||
return isGuaranteedToExecuteForEveryIteration(&I, L);
|
computeLoopSafetyInfo(&LSI, L);
|
||||||
|
return isGuaranteedToExecute(I, DT, L, &LSI) ||
|
||||||
|
isGuaranteedToExecuteForEveryIteration(&I, L);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \brief An assembly annotator class to print must execute information in
|
/// \brief An assembly annotator class to print must execute information in
|
||||||
|
@ -88,9 +88,14 @@ exit:
|
|||||||
; FIXME: handled by loop safety info, test it
|
; FIXME: handled by loop safety info, test it
|
||||||
define i1 @nothrow_loop(i32* noalias %p, i32 %high) {
|
define i1 @nothrow_loop(i32* noalias %p, i32 %high) {
|
||||||
; CHECK-LABEL: @nothrow_loop(
|
; CHECK-LABEL: @nothrow_loop(
|
||||||
; CHECK-LABEL: loop:
|
; CHECK-LABEL: loop:
|
||||||
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
|
; CHECK: %iv = phi i32 [ 0, %entry ], [ %iv.next, %next ] ; (mustexec in: loop)
|
||||||
; CHECK: br label %next ; (mustexec in: loop)
|
; CHECK: br label %next ; (mustexec in: loop)
|
||||||
|
; CHECK-LABEL: next:
|
||||||
|
; CHECK: %v = load i32, i32* %p ; (mustexec in: loop)
|
||||||
|
; CHECK: %iv.next = add nuw nsw i32 %iv, 1 ; (mustexec in: loop)
|
||||||
|
; CHECK: %exit.test = icmp slt i32 %iv, %high ; (mustexec in: loop)
|
||||||
|
; CHECK: br i1 %exit.test, label %exit, label %loop ; (mustexec in: loop)
|
||||||
; CHECK-NOT: mustexec
|
; CHECK-NOT: mustexec
|
||||||
|
|
||||||
entry:
|
entry:
|
||||||
|
Loading…
Reference in New Issue
Block a user