<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 3, 2019 at 9:56 AM Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi Cameron,<br>
<br>
On Fri, 3 May 2019 at 14:46, Cameron McInally via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> 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.<br>
<br>
test/Analysis/ConstantFolding looks promising. You could also use<br></blockquote><div><br></div><div>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.</div><div><br></div><div>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?</div></div></div></div></div>