[PATCH] D39958: [InstCombine] Make foldSelectOpOp able to handle two-operand getelementptr

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 05:41:28 PST 2017


john.brawn added inline comments.


================
Comment at: lib/Transforms/InstCombine/InstCombineSelect.cpp:349
+  }
+  if (GetElementPtrInst *TGEP = dyn_cast<GetElementPtrInst>(TI)) {
+    GetElementPtrInst *FGEP = dyn_cast<GetElementPtrInst>(FI);
----------------
majnemer wrote:
> I think this dyn_cast can just be cast<>, then you can avoid the llvm_unreachable.
I could do that, but that would make GetElementPtrInst be in essence the default case which doesn't really make sense, especially if we end up supporting other instructions here as well.


Repository:
  rL LLVM

https://reviews.llvm.org/D39958





More information about the llvm-commits mailing list