mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-26 13:36:28 +00:00
Fix PR4909, patch by Jakub Staszak.
llvm-svn: 81250
This commit is contained in:
parent
eaf0f7f20b
commit
b32b599081
@ -48,7 +48,8 @@ ModulePass* llvm::createPartialInliningPass() { return new PartialInliner(); }
|
||||
Function* PartialInliner::unswitchFunction(Function* F) {
|
||||
// First, verify that this function is an unswitching candidate...
|
||||
BasicBlock* entryBlock = F->begin();
|
||||
if (!isa<BranchInst>(entryBlock->getTerminator()))
|
||||
BranchInst *BR = dyn_cast<BranchInst>(entryBlock->getTerminator());
|
||||
if (!BR || BR->isUnconditional())
|
||||
return 0;
|
||||
|
||||
BasicBlock* returnBlock = 0;
|
||||
|
15
test/Transforms/Inline/PR4909.ll
Normal file
15
test/Transforms/Inline/PR4909.ll
Normal file
@ -0,0 +1,15 @@
|
||||
; RUN: llvm-as < %s | opt -partial-inliner -disable-output
|
||||
|
||||
define i32 @f() {
|
||||
entry:
|
||||
br label %return
|
||||
|
||||
return: ; preds = %entry
|
||||
ret i32 undef
|
||||
}
|
||||
|
||||
define i32 @g() {
|
||||
entry:
|
||||
%0 = call i32 @f()
|
||||
ret i32 %0
|
||||
}
|
Loading…
Reference in New Issue
Block a user