mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Fixes following the CR by Chris and Duncan:
Optimize chained bitcasts of the form A->B->A. Undo r138722 and change isEliminableCastPair to allow this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138756 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -51,12 +51,6 @@ static Constant *FoldBitCast(Constant *C, Type *DestTy,
|
||||
if (C->isAllOnesValue() && !DestTy->isX86_MMXTy())
|
||||
return Constant::getAllOnesValue(DestTy);
|
||||
|
||||
// Bitcast of Bitcast can be done using a single cast.
|
||||
ConstantExpr *CE = dyn_cast<ConstantExpr>(C);
|
||||
if (CE && CE->getOpcode() == Instruction::BitCast) {
|
||||
return ConstantExpr::getBitCast(CE->getOperand(0), DestTy);
|
||||
}
|
||||
|
||||
// The code below only handles casts to vectors currently.
|
||||
VectorType *DestVTy = dyn_cast<VectorType>(DestTy);
|
||||
if (DestVTy == 0)
|
||||
|
||||
Reference in New Issue
Block a user