mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-08 04:11:27 +00:00
Take advantage of undefined behavior if the source program tries to GEP
beyond the end of an alloca to make FastDSE faster and more aggressive. llvm-svn: 39945
This commit is contained in:
parent
67ae861705
commit
55b794723f
@ -61,17 +61,10 @@ namespace {
|
||||
|
||||
// See through pointer-to-pointer bitcasts
|
||||
while (isa<BitCastInst>(v) || isa<GetElementPtrInst>(v))
|
||||
if (BitCastInst* C = dyn_cast<BitCastInst>(v)) {
|
||||
if (isa<PointerType>(C->getSrcTy()))
|
||||
v = C->getOperand(0);
|
||||
else
|
||||
break;
|
||||
} else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(v)) {
|
||||
if (G->hasAllZeroIndices())
|
||||
v = G->getOperand(0);
|
||||
else
|
||||
break;
|
||||
}
|
||||
if (BitCastInst* C = dyn_cast<BitCastInst>(v))
|
||||
v = C->getOperand(0);
|
||||
else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(v))
|
||||
v = G->getOperand(0);
|
||||
}
|
||||
|
||||
// getAnalysisUsage - We require post dominance frontiers (aka Control
|
||||
|
Loading…
Reference in New Issue
Block a user