diff options
| -rw-r--r-- | llvm/lib/CodeGen/StackColoring.cpp | 6 | ||||
| -rw-r--r-- | llvm/test/Feature/optnone-llc.ll | 1 | ||||
| -rw-r--r-- | llvm/test/Other/opt-bisect-legacy-pass-manager.ll | 22 | 
3 files changed, 24 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp index 281836e909d..17c01dc3c3f 100644 --- a/llvm/lib/CodeGen/StackColoring.cpp +++ b/llvm/lib/CodeGen/StackColoring.cpp @@ -963,9 +963,6 @@ void StackColoring::expungeSlotMap(DenseMap<int, int> &SlotRemap,  }  bool StackColoring::runOnMachineFunction(MachineFunction &Func) { -  if (skipFunction(*Func.getFunction())) -    return false; -    DEBUG(dbgs() << "********** Stack Coloring **********\n"                 << "********** Function: "                 << ((const Value*)Func.getFunction())->getName() << '\n'); @@ -1005,7 +1002,8 @@ bool StackColoring::runOnMachineFunction(MachineFunction &Func) {    // Don't continue because there are not enough lifetime markers, or the    // stack is too small, or we are told not to optimize the slots. -  if (NumMarkers < 2 || TotalSize < 16 || DisableColoring) { +  if (NumMarkers < 2 || TotalSize < 16 || DisableColoring || +      skipFunction(*Func.getFunction())) {      DEBUG(dbgs()<<"Will not try to merge slots.\n");      return removeAllMarkers();    } diff --git a/llvm/test/Feature/optnone-llc.ll b/llvm/test/Feature/optnone-llc.ll index 8abcd09eea5..a03757359c8 100644 --- a/llvm/test/Feature/optnone-llc.ll +++ b/llvm/test/Feature/optnone-llc.ll @@ -46,7 +46,6 @@ attributes #0 = { optnone noinline }  ; LLC-Ox-DAG: Skipping pass 'Machine Copy Propagation Pass'  ; LLC-Ox-DAG: Skipping pass 'Machine Instruction Scheduler'  ; LLC-Ox-DAG: Skipping pass 'Machine Loop Invariant Code Motion' -; LLC-Ox-DAG: Skipping pass 'Merge disjoint stack slots'  ; LLC-Ox-DAG: Skipping pass 'Optimize machine instruction PHIs'  ; LLC-Ox-DAG: Skipping pass 'Peephole Optimizations'  ; LLC-Ox-DAG: Skipping pass 'Post{{.*}}RA{{.*}}{{[Ss]}}cheduler' diff --git a/llvm/test/Other/opt-bisect-legacy-pass-manager.ll b/llvm/test/Other/opt-bisect-legacy-pass-manager.ll index 0e528ea4b32..6677c264e9c 100644 --- a/llvm/test/Other/opt-bisect-legacy-pass-manager.ll +++ b/llvm/test/Other/opt-bisect-legacy-pass-manager.ll @@ -154,3 +154,25 @@ bb.true:  bb.false:    ret i32 0  } + +; This function is here to verify that opt-bisect can skip all passes for +; functions that contain lifetime intrinsics. +define void @f4() { +entry: +  %i = alloca i32, align 4 +  %tmp = bitcast i32* %i to i8* +  call void @llvm.lifetime.start(i64 4, i8* %tmp) +  br label %for.cond + +for.cond: +  br i1 undef, label %for.body, label %for.end + +for.body: +  br label %for.cond + +for.end: +  ret void +} + +declare void @llvm.lifetime.start(i64, i8* nocapture) +  | 

