[PATCH] D130839: [DAG] FoldConstantArithmetic - add initial support for undef elements in bitcasted binop constant folding

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 31 07:04:37 PDT 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5584
+        // Handle constant folding with UNDEF. TODO: Handle more cases.
+        auto FoldValueWithUndef = [](unsigned Opcode, const APInt &C1,
+                                     bool IsUndef1, const APInt &C2,
----------------
tschuett wrote:
> Do you need to hide this behind a lambda or could you pull it into a function because it is getting more powerful over time?
No, it could be exposed like FoldValue() is - that is currently a static helper above FoldConstantArithmetic. We could move it into TLI later if it'd help target nodes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130839



More information about the llvm-commits mailing list