mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-06 17:47:37 +00:00
[ValueTracking] Teach GetUnderlyingObject to stop when it reachs an alloca instruction.
Previously it tried to call SimplifyInstruction which doesn't know anything about alloca so defers to constant folding which also doesn't do anything with alloca. This results in wasted cycles making calls that won't do anything. Given the frequency with which this function is called this time adds up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300118 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c6ef2a299
commit
53726fa11a
@ -3216,6 +3216,9 @@ Value *llvm::GetUnderlyingObject(Value *V, const DataLayout &DL,
|
||||
if (GA->isInterposable())
|
||||
return V;
|
||||
V = GA->getAliasee();
|
||||
} else if (isa<AllocaInst>(V)) {
|
||||
// An alloca can't be further simplified.
|
||||
return V;
|
||||
} else {
|
||||
if (auto CS = CallSite(V))
|
||||
if (Value *RV = CS.getReturnedArgOperand()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user