[PATCH] D64713: [InstCombine] X *fast (C ? 1.0 : 0.0) -> C ? X : 0.0

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 16 01:25:57 PDT 2019


foad marked an inline comment as done.
foad added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:787
+    }
+  } else if (LHSIsSelect) {
+    // (A ? B : C) op Y -> A ? (B op Y) : (C op Y)
----------------
Question to reviewers: should I make this condition `LHSIsSelect && LHS->hasOneUse()` (and the same for RHS on line 792)? I am tempted to do so just to be conservative, to make sure that this instcombine actually removes all uses of the original select.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64713





More information about the llvm-commits mailing list