[PATCH] D43970: [InstCombine] Allow fptrunc (fpext X)) to be reduced to a single fpext/ftrunc

Steve Canon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 2 08:45:25 PST 2018

scanon added inline comments.

Comment at: lib/IR/Instructions.cpp:2270
       return Instruction::ZExt;
-    case 10:
-      // fpext followed by ftrunc is allowed if the bit size returned to is
-      // the same as the original, in which case its just a bitcast
-      if (SrcTy == DstTy)
-        return Instruction::BitCast;
-      return 0; // If the types are not the same we can't eliminate it.
+    // case 10 used to be fpext, fptrunc but that was changed to case 8.
     case 11: {
I don't think that this comment clarifies anything, since `case 10` no longer exists. It would probably be clearer to just remove it; the repository history documents what it "used to be".


More information about the llvm-commits mailing list