[PATCH] D65954: [Reassociate] try harder to convert negative FP constants to positive

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 08:23:23 PDT 2019


spatel marked an inline comment as done.
spatel added inline comments.


================
Comment at: llvm/test/Transforms/Reassociate/reassoc-intermediate-fnegs.ll:9-12
+; CHECK-NEXT:    [[T2_NEG:%.*]] = fmul fast half [[A:%.*]], 0xHC500
 ; CHECK-NEXT:    [[REASS_MUL:%.*]] = fmul fast half [[B:%.*]], 0xH4500
-; CHECK-NEXT:    [[T51:%.*]] = fsub fast half [[REASS_MUL]], [[T2_NEG]]
 ; CHECK-NEXT:    [[T5:%.*]] = fadd fast half [[REASS_MUL]], [[T2_NEG]]
+; CHECK-NEXT:    ret half [[T5]]
----------------
I stepped through this case, and we don't remove the negative constant because ShouldBreakUpSubtract() is true. Even with the positive constant, we failed to factorize, so this needs work either way.


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

https://reviews.llvm.org/D65954





More information about the llvm-commits mailing list