mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
Add knowledge about the struct form of the GetElementPtr instruction
llvm-svn: 183
This commit is contained in:
parent
10ff90d678
commit
a969eb234b
@ -23,6 +23,7 @@
|
||||
#include "llvm/ConstantPool.h"
|
||||
#include "llvm/InstrTypes.h"
|
||||
#include "llvm/iOther.h"
|
||||
#include "llvm/iMemory.h"
|
||||
#include "llvm/iTerminators.h"
|
||||
#include "llvm/Tools/STLExtras.h"
|
||||
#include "llvm/Assembly/Writer.h"
|
||||
@ -429,8 +430,13 @@ void SCCP::UpdateInstruction(Instruction *I) {
|
||||
|
||||
//===-------------------------------------------------------------------===//
|
||||
// Handle Unary instructions...
|
||||
// Also treated as unary here, are cast instructions and getelementptr
|
||||
// instructions on struct* operands.
|
||||
//
|
||||
if (I->isUnaryOp() || I->getOpcode() == Instruction::Cast) {
|
||||
if (I->isUnaryOp() || I->getOpcode() == Instruction::Cast ||
|
||||
(I->getOpcode() == Instruction::GetElementPtr &&
|
||||
((GetElementPtrInst*)I)->isStructSelector())) {
|
||||
|
||||
Value *V = I->getOperand(0);
|
||||
InstVal &VState = getValueState(V);
|
||||
if (VState.isOverdefined()) { // Inherit overdefinedness of operand
|
||||
|
Loading…
Reference in New Issue
Block a user