mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-20 00:43:48 +00:00
Tweak the check for promotable alloca's to handle
debug intrinsics correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f70bda2f81
commit
2511abf6e7
@ -81,9 +81,15 @@ bool llvm::isAllocaPromotable(const AllocaInst *AI) {
|
|||||||
if (SI->isVolatile())
|
if (SI->isVolatile())
|
||||||
return false;
|
return false;
|
||||||
} else if (const BitCastInst *BC = dyn_cast<BitCastInst>(*UI)) {
|
} else if (const BitCastInst *BC = dyn_cast<BitCastInst>(*UI)) {
|
||||||
// Uses by dbg info shouldn't inhibit promotion.
|
// A bitcast that does not feed into debug info inhibits promotion.
|
||||||
if (!BC->hasOneUse() || !isa<DbgInfoIntrinsic>(*BC->use_begin()))
|
if (!BC->hasOneUse() || !isa<DbgInfoIntrinsic>(*BC->use_begin()))
|
||||||
return false;
|
return false;
|
||||||
|
// If the only use is by debug info, this alloca will not exist in
|
||||||
|
// non-debug code, so don't try to promote; this ensures the same
|
||||||
|
// codegen with debug info. Otherwise, debug info should not
|
||||||
|
// inhibit promotion (but we must examine other uses).
|
||||||
|
if (AI->hasOneUse())
|
||||||
|
return false;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user