[PATCH] D63933: [NewGVN] Add unary FNeg support to NewGVN pass

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 14:25:32 PDT 2019


fhahn added inline comments.


================
Comment at: llvm/test/Transforms/NewGVN/fpmath.ll:46
 ; CHECK: @test5(double %x)
-; CHECK: %neg1 = fneg double %x, !fpmath !0
-; CHECK: %neg2 = fneg double %x, !fpmath !1
-; CHECK: %foo = fadd double %neg1, %neg2
+; CHECK: %neg1 = fneg double %x, !fpmath !1
+; CHECK: %foo = fadd double %neg1, %neg1
----------------
cameron.mcinally wrote:
> cameron.mcinally wrote:
> > fhahn wrote:
> > > Can you update the test to check !1 points to the expected metadata?
> > Sorry, missed this comment. Will submit a follow-up patch ASAP.
> Actually, I'm not sure how to do that well. Would you point me to an example, please?
> 
> The metadata string is at the end of the file. I could check for it at the very end of all the tests. Is that what you're suggesting?
> 
> If I check the metadata in this particular test, that would prevent new tests from being added after this test, since it would throw off the CHECK line order.
I think the most robust thing is to check it at the end of the file.

Ideally you would use a regex to match the ID in the CHECK lines for the operations and then check the value of the metadata at the bottom.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63933





More information about the llvm-commits mailing list