forked from OSchip/llvm-project
parent
b8be78b753
commit
04e0c95248
|
@ -8262,9 +8262,9 @@ Instruction *InstCombiner::commonIntCastTransforms(CastInst &CI) {
|
||||||
// expression tree to something weird like i93 unless the source is also
|
// expression tree to something weird like i93 unless the source is also
|
||||||
// strange.
|
// strange.
|
||||||
if (!isa<IntegerType>(SrcI->getType()) ||
|
if (!isa<IntegerType>(SrcI->getType()) ||
|
||||||
ShouldChangeType(SrcI->getType(), DestTy, TD) &&
|
(ShouldChangeType(SrcI->getType(), DestTy, TD) &&
|
||||||
CanEvaluateInDifferentType(SrcI, DestTy,
|
CanEvaluateInDifferentType(SrcI, DestTy,
|
||||||
CI.getOpcode(), NumCastsRemoved)) {
|
CI.getOpcode(), NumCastsRemoved))) {
|
||||||
// If this cast is a truncate, evaluting in a different type always
|
// If this cast is a truncate, evaluting in a different type always
|
||||||
// eliminates the cast, so it is always a win. If this is a zero-extension,
|
// eliminates the cast, so it is always a win. If this is a zero-extension,
|
||||||
// we need to do an AND to maintain the clear top-part of the computation,
|
// we need to do an AND to maintain the clear top-part of the computation,
|
||||||
|
|
Loading…
Reference in New Issue