[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
Mon Jul 15 02:24:58 PDT 2019


foad created this revision.
foad added reviewers: mcberg2017, majnemer, craig.topper, qcolombet, mcrosier.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This is implemented with more general rules:

X op (C ? P : Q) -> C ? (X op P) : (X op Q)

  // if X op P and X op Q both simplify

(C ? P : Q) op Y -> C ? (P op Y) : (Q op Y)

  // if P op Y and Q op Y both simplify

The tests include some other cases where these more general rules apply.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64713

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/fmul.ll
  llvm/test/Transforms/InstCombine/mul.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64713.209783.patch
Type: text/x-patch
Size: 5203 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190715/f2386b79/attachment.bin>


More information about the llvm-commits mailing list