mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-15 16:07:49 +00:00
Fix an error in phi translation of GEPs that was causing failures.
llvm-svn: 37868
This commit is contained in:
parent
b7e9781af2
commit
06dd016177
@ -836,7 +836,7 @@ Value* GVNPRE::phi_translate(Value* V, BasicBlock* pred, BasicBlock* succ) {
|
||||
}
|
||||
|
||||
if (newOp1 != U->getPointerOperand() || changed_idx) {
|
||||
Instruction* newVal = new GetElementPtrInst(U->getPointerOperand(),
|
||||
Instruction* newVal = new GetElementPtrInst(newOp1,
|
||||
&newIdx[0], newIdx.size(),
|
||||
U->getName()+".expr");
|
||||
|
||||
|
14
test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
Normal file
14
test/Transforms/GVNPRE/2007-07-03-PhiTranslateGEP.ll
Normal file
@ -0,0 +1,14 @@
|
||||
; RUN: llvm-as < %s | opt -gvnpre | llvm-dis
|
||||
|
||||
define i64 @foo({ i32, i32 }** %__v) {
|
||||
entry:
|
||||
br label %bb
|
||||
|
||||
bb: ; preds = %bb, %entry
|
||||
%__x.066.0 = phi { i32, i32 }* [ null, %entry ], [ null, %bb ]
|
||||
%tmp2.i.i63 = getelementptr { i32, i32 }* %__x.066.0, i32 0, i32 1
|
||||
br i1 false, label %bb, label %cond_true
|
||||
|
||||
cond_true: ; preds = %bb
|
||||
ret i64 0
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user