[PATCH] D61544: Add FNeg IR constant folding

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 4 08:28:34 PDT 2019


cameron.mcinally marked 6 inline comments as done.
cameron.mcinally added inline comments.


================
Comment at: llvm/lib/IR/ConstantFold.cpp:931
+      return C; // -undef -> undef
+    case Instruction::UnaryOpsEnd:
+      llvm_unreachable("Invalid UnaryOp");
----------------
spatel wrote:
> We already asserted that we have a unary op, so can this be "default: llvm_unreachable..."?
This was copied from `ConstantFoldBinaryInstruction(...)`, so that should probably be updated to keep them in sync, as well as any similar switches. I can do that in a separate patch, if you'd like.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61544/new/

https://reviews.llvm.org/D61544





More information about the llvm-commits mailing list