mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Fix a regression from r125393;
It caused a crash in MultiSource/Benchmarks/Bullet. Opt hit an assertion with "opt -std-compile-opts" because Constant::getAllOnesValue doesn't know how to handle floats. This patch added a test to reproduce the problem and a check that the destination vector is of integer type. Thank you Benjamin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125459 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -43,7 +43,8 @@ using namespace llvm;
|
||||
static Constant *BitCastConstantVector(ConstantVector *CV,
|
||||
const VectorType *DstTy) {
|
||||
|
||||
if (CV->isAllOnesValue()) return Constant::getAllOnesValue(DstTy);
|
||||
if (CV->isAllOnesValue() && DstTy->getElementType()->isIntegerTy())
|
||||
return Constant::getAllOnesValue(DstTy);
|
||||
if (CV->isNullValue()) return Constant::getNullValue(DstTy);
|
||||
|
||||
// If this cast changes element count then we can't handle it here:
|
||||
|
Reference in New Issue
Block a user