[PATCH] D61419: Support FNeg ConstantExpr folding

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 06:48:45 PDT 2019


cameron.mcinally marked an inline comment as done.
cameron.mcinally added inline comments.


================
Comment at: llvm/test/CodeGen/X86/vec_fneg.ll:144
 
+; fneg constant folding
 
----------------
arsenm wrote:
> cameron.mcinally wrote:
> > arsenm wrote:
> > > These should still not be codegen tests. Is this the constant folding that the asm parser does?
> > The folding I'd like to test is done whenever a `ConstantExpr::get(...)` or `ConstantExpr::getFNeg(...)` is called. So it's really all over the place. A quick grep shows it's mainly called in IR, but also in Analysis, Transforms, CodeGen, and the AsmParser. 
> > 
> > `unittests/IR/ConstantsTest.cpp` seems like a candidate, but this doesn't really fit a unit test.
> > 
> > There is some prior art in `CodeGen` for constant folding tests, but I'm not sure what constant folder they're testing. E.g. `@div_select_constant_fold(...):llvm/test/CodeGen/X86/fdiv-combine.ll`.
> > 
> If any codegen tests are testing the IR constant folding, that's just broken. I would try to just use the asm parser for this
I actually just shot a question out to llvm-dev about this. I'll wait to see if anyone knows for sure before making that change. Thanks, Matt.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61419





More information about the llvm-commits mailing list