mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-22 20:20:03 +00:00
Use appropriate index to get the result value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47897 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
544b92bb3c
commit
96f9cc02e3
@ -302,7 +302,9 @@ void SRETPromotion::updateCallSites(Function *F, Function *NF) {
|
||||
if (C2 && (C2 == Call))
|
||||
continue;
|
||||
else if (GetElementPtrInst *UGEP = dyn_cast<GetElementPtrInst>(U2)) {
|
||||
Value *GR = new GetResultInst(New, 5, "xxx", UGEP);
|
||||
ConstantInt *Idx = dyn_cast<ConstantInt>(UGEP->getOperand(2));
|
||||
assert (Idx && "Unexpected getelementptr index!");
|
||||
Value *GR = new GetResultInst(New, Idx->getZExtValue(), "gr", UGEP);
|
||||
for (Value::use_iterator GI = UGEP->use_begin(),
|
||||
GE = UGEP->use_end(); GI != GE; ++GI) {
|
||||
if (LoadInst *L = dyn_cast<LoadInst>(*GI)) {
|
||||
|
Loading…
Reference in New Issue
Block a user