[PATCH] D61573: Add FNeg support to InstructionSimplify

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 5 12:01:48 PDT 2019


cameron.mcinally created this revision.
cameron.mcinally added reviewers: spatel, arsenm, kpn, andrew.w.kaylor, craig.topper.
Herald added subscribers: llvm-commits, hiraditya, wdng.
Herald added a project: LLVM.

This is the last chunk separated from the larger D61419 <https://reviews.llvm.org/D61419>...

Add FNeg support to InstructionSimplify. There is only one xform included in this patch:

  fneg (fneg X) -> X

We only have FP UnOps right now, but I added framework stubs for Integer UnOps also. That keeps the code inline with the BinOps functions. If anyone feels strongly against it, I will remove them.

I took a liberty with the added test and will comment inline so that it's clear for review purposes.


Repository:
  rL LLVM

https://reviews.llvm.org/D61573

Files:
  llvm/include/llvm/Analysis/InstructionSimplify.h
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Analysis/ConstantFolding/fneg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61573.198186.patch
Type: text/x-patch
Size: 6032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190505/08c2909c/attachment.bin>


More information about the llvm-commits mailing list