forked from OSchip/llvm-project
Bug fix. Only safe to perform extension uses optimization if the source of extension is also defined in the same BB as the extension.
llvm-svn: 44896
This commit is contained in:
parent
0af43a1895
commit
7bc8942532
|
@ -929,6 +929,11 @@ bool CodeGenPrepare::OptimizeExtUses(Instruction *I) {
|
|||
if (Src->hasOneUse())
|
||||
return false;
|
||||
|
||||
// Only safe to perform the optimization if the source is also defined in
|
||||
// this block.
|
||||
if (DefBB != cast<Instruction>(Src)->getParent())
|
||||
return false;
|
||||
|
||||
bool DefIsLiveOut = false;
|
||||
for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
|
||||
UI != E; ++UI) {
|
||||
|
|
Loading…
Reference in New Issue