[PATCH] D144447: [Clang] Teach buildFMulAdd to peek through fneg to find fmul.

Lang Hames via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 22 17:00:07 PST 2023


lhames added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:3738
-  assert(!(negMul && negAdd) && "Only one of negMul and negAdd should be set.");
-
   Value *MulOp0 = MulOp->getOperand(0);
----------------
craig.topper wrote:
> kpn wrote:
> > If I'm reading this right it looks like the assert() wasn't needed before. Do we know why it was added in the first place?
> I don't. I've added @lhames who wrote the code originally, but's been 10 years.
It was probably included as a guard rail during bringup (from memory we didn't have any patterns in LLVM that matched both negations) and was never removed. I think it should be fine to remove.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144447



More information about the cfe-commits mailing list