Cameron McInally via llvm-dev
2019-May-03 13:46 UTC
[llvm-dev] [ConstantExpr] Adding folding tests
Hey everyone, I'd like to add some new constant foldings to ConstantExpr -- in particular ConstantExpr::get(...) and friends. But, I'm having trouble finding the correct place for adding IR tests in the /test directory. Any suggestions? Thanks, Cam -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190503/000c5f61/attachment.html>
Tim Northover via llvm-dev
2019-May-03 13:56 UTC
[llvm-dev] [ConstantExpr] Adding folding tests
Hi Cameron, On Fri, 3 May 2019 at 14:46, Cameron McInally via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I'd like to add some new constant foldings to ConstantExpr -- in particular ConstantExpr::get(...) and friends. But, I'm having trouble finding the correct place for adding IR tests in the /test directory.test/Analysis/ConstantFolding looks promising. You could also use unittests/IR/ConstantsTest.cpp. Cheers. Tim.
Cameron McInally via llvm-dev
2019-May-03 14:32 UTC
[llvm-dev] [ConstantExpr] Adding folding tests
On Fri, May 3, 2019 at 9:56 AM Tim Northover <t.p.northover at gmail.com> wrote:> Hi Cameron, > > On Fri, 3 May 2019 at 14:46, Cameron McInally via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > I'd like to add some new constant foldings to ConstantExpr -- in > particular ConstantExpr::get(...) and friends. But, I'm having trouble > finding the correct place for adding IR tests in the /test directory. > > test/Analysis/ConstantFolding looks promising. You could also use >Ah, I should have mentioned that. So Matt and I looked into this, but that directory appears to be testing the constant folding in InstructionSimplify (and one or two other opt passes). That's a different set of folds. Looking closer now, hooking up this instruction (namely FNeg) in InstCombine to call ConstantExpr to do the folds is probably the best option. There's prior art for this in test/Analysis/ConstantFolding/min-max.ll. Does anyone see problems with that plan? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190503/86b2d40e/attachment.html>