mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-29 13:24:25 +00:00
Fix flawed logic that was breaking several SPEC benchmarks, including gzip and crafty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -1337,8 +1337,8 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) {
|
|||||||
// because the source would be zero extended.
|
// because the source would be zero extended.
|
||||||
unsigned SrcBits =
|
unsigned SrcBits =
|
||||||
SrcTy == Type::BoolTy ? 1 : SrcTy->getPrimitiveSize()*8;
|
SrcTy == Type::BoolTy ? 1 : SrcTy->getPrimitiveSize()*8;
|
||||||
bool HasSignBit = 1ULL << (DestTy->getPrimitiveSize()*8-1);
|
bool HasSignBit = ConstVal & (1ULL << (DestTy->getPrimitiveSize()*8-1));
|
||||||
if (ConstVal & ((1ULL << SrcBits)-1)) {
|
if (ConstVal & ~((1ULL << SrcBits)-1)) {
|
||||||
switch (I.getOpcode()) {
|
switch (I.getOpcode()) {
|
||||||
default: assert(0 && "Unknown comparison type!");
|
default: assert(0 && "Unknown comparison type!");
|
||||||
case Instruction::SetEQ:
|
case Instruction::SetEQ:
|
||||||
@ -1655,7 +1655,7 @@ Instruction *InstCombiner::visitCastInst(CastInst &CI) {
|
|||||||
unsigned AllocElTySize = TD->getTypeSize(AllocElTy);
|
unsigned AllocElTySize = TD->getTypeSize(AllocElTy);
|
||||||
const Type *CastElTy = PTy->getElementType();
|
const Type *CastElTy = PTy->getElementType();
|
||||||
unsigned CastElTySize = TD->getTypeSize(CastElTy);
|
unsigned CastElTySize = TD->getTypeSize(CastElTy);
|
||||||
|
|
||||||
// If the allocation is for an even multiple of the cast type size
|
// If the allocation is for an even multiple of the cast type size
|
||||||
if (CastElTySize && (AllocElTySize % CastElTySize == 0)) {
|
if (CastElTySize && (AllocElTySize % CastElTySize == 0)) {
|
||||||
Value *Amt = ConstantUInt::get(Type::UIntTy,
|
Value *Amt = ConstantUInt::get(Type::UIntTy,
|
||||||
|
Reference in New Issue
Block a user