- Expose passinfo from BreakCriticalEdges pass so that it may be "Required"
[oota-llvm.git] / lib / Transforms / Scalar / InstructionCombining.cpp
index 082dc020b00900293e71c4968e70e5e06ff9da10..b60d1fa9720ff7f4044950bba12d82961f23c099 100644 (file)
@@ -536,6 +536,12 @@ static inline bool isEliminableCastOfCast(const CastInst &CI,
     if (SrcSize >= MidSize && MidSize >= DstSize)
       return true;
 
+    // Cases where the source and destination type are the same, but the middle
+    // type is bigger are noops.
+    //
+    if (SrcSize == DstSize && MidSize > SrcSize)
+      return true;
+
     // If we are monotonically growing, things are more complex.
     //
     if (SrcSize <= MidSize && MidSize <= DstSize) {