mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-19 03:38:26 +00:00
[Attributor][FIX] Do not replace musstail calls with constant
llvm-svn: 374498
This commit is contained in:
parent
a22c832b21
commit
898213453e
@ -997,7 +997,7 @@ ChangeStatus AAReturnedValuesImpl::manifest(Attributor &A) {
|
||||
|
||||
// Callback to replace the uses of CB with the constant C.
|
||||
auto ReplaceCallSiteUsersWith = [](CallBase &CB, Constant &C) {
|
||||
if (CB.getNumUses() == 0)
|
||||
if (CB.getNumUses() == 0 || CB.isMustTailCall())
|
||||
return ChangeStatus::UNCHANGED;
|
||||
CB.replaceAllUsesWith(&C);
|
||||
return ChangeStatus::CHANGED;
|
||||
|
@ -830,6 +830,11 @@ define i32* @use_const() #0 {
|
||||
; CHECK: ret i32* bitcast (i8* @G to i32*)
|
||||
ret i32* %c
|
||||
}
|
||||
define i32* @dont_use_const() #0 {
|
||||
%c = musttail call i32* @ret_const()
|
||||
; CHECK: ret i32* %c
|
||||
ret i32* %c
|
||||
}
|
||||
|
||||
attributes #0 = { noinline nounwind uwtable }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user