mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-12 17:32:19 +00:00
Fix an error in phi translation of GEPs that was causing failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37868 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
75f75b9137
commit
9eee94c5f7
@ -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