mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
Make sure that value handle users see the transformation of an indirect call to a direct call. This is important for the CallGraph iteration. Patch by Björn Steinbrink!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201822 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f17f214145
commit
0aabe661a4
@ -1212,6 +1212,8 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) {
|
||||
|
||||
if (!Caller->use_empty())
|
||||
ReplaceInstUsesWith(*Caller, NV);
|
||||
else if (Caller->hasValueHandle())
|
||||
ValueHandleBase::ValueIsRAUWd(Caller, NV);
|
||||
|
||||
EraseInstFromFunction(*Caller);
|
||||
return true;
|
||||
|
23
test/Transforms/InstCombine/cast-call-combine.ll
Normal file
23
test/Transforms/InstCombine/cast-call-combine.ll
Normal file
@ -0,0 +1,23 @@
|
||||
; RUN: opt < %s -always-inline -instcombine -S | FileCheck %s
|
||||
|
||||
define internal void @foo(i16*) alwaysinline {
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @bar() noinline noreturn {
|
||||
unreachable
|
||||
}
|
||||
|
||||
define void @test() {
|
||||
br i1 false, label %then, label %else
|
||||
|
||||
then:
|
||||
call void @bar()
|
||||
unreachable
|
||||
|
||||
else:
|
||||
; CHECK-NOT: call
|
||||
call void bitcast (void (i16*)* @foo to void (i8*)*) (i8* null)
|
||||
ret void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user