mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-20 10:24:12 +00:00
fix a bitcode reader bug where it can't handle extractelement correctly:
the index of the value being extracted is always an i32. This fixes PR3465 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63597 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -915,8 +915,7 @@ bool BitcodeReader::ParseConstants() {
|
|||||||
dyn_cast_or_null<VectorType>(getTypeByID(Record[0]));
|
dyn_cast_or_null<VectorType>(getTypeByID(Record[0]));
|
||||||
if (OpTy == 0) return Error("Invalid CE_EXTRACTELT record");
|
if (OpTy == 0) return Error("Invalid CE_EXTRACTELT record");
|
||||||
Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
|
Constant *Op0 = ValueList.getConstantFwdRef(Record[1], OpTy);
|
||||||
Constant *Op1 = ValueList.getConstantFwdRef(Record[2],
|
Constant *Op1 = ValueList.getConstantFwdRef(Record[2], Type::Int32Ty);
|
||||||
OpTy->getElementType());
|
|
||||||
V = ConstantExpr::getExtractElement(Op0, Op1);
|
V = ConstantExpr::getExtractElement(Op0, Op1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
8
test/Bitcode/extractelement.ll
Normal file
8
test/Bitcode/extractelement.ll
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
; RUN: llvm-as < %s | opt -constprop | llvm-dis
|
||||||
|
; PR3465
|
||||||
|
|
||||||
|
define double @test() {
|
||||||
|
%tmp24 = extractelement <2 x double> bitcast (<1 x i128> < i128 85070591730234615870450834276742070272 > to <2 x double>), i32 0
|
||||||
|
ret double %tmp24
|
||||||
|
}
|
||||||
|
|
Reference in New Issue
Block a user