mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
GVN-hoist: add missing check for all GEP operands available
llvm-svn: 276364
This commit is contained in:
parent
b5e501a79c
commit
6ec0a83576
@ -613,6 +613,9 @@ public:
|
||||
|
||||
// Also copy Val when it is a GEP.
|
||||
if (Val && isa<GetElementPtrInst>(Val)) {
|
||||
// Check whether we can compute the GEP at HoistPt.
|
||||
if (!allOperandsAvailable(Val, HoistPt))
|
||||
return false;
|
||||
Instruction *ClonedVal = Val->clone();
|
||||
ClonedVal->insertBefore(HoistPt->getTerminator());
|
||||
// Conservatively discard any optimization hints, they may differ on the
|
||||
|
Loading…
Reference in New Issue
Block a user