[PATCH] D40696: Enable aggressive FMA on T99 and provide AArch64 option for other micro-arch's

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 09:21:14 PST 2017


fhahn added inline comments.


================
Comment at: test/CodeGen/AArch64/fma-aggressive.ll:1
+; RUN: llc -O2 -mtriple=aarch64-none-linux-gnu -mcpu=thunderx2t99 -fp-contract=fast < %s | FileCheck %s
+; This test program demonstrates the effects of enabling aggressive FMA
----------------
steleman wrote:
> fhahn wrote:
> > I think it would be good to also add a check that aggressive FMA is not enabled for other micro architectures.
> OK I'll add another test named 'fma-not-aggressive.ll' :-)
> 
Thanks. You should be able just use a `check-prefix` in the same file, e.g. as in https://github.com/llvm-mirror/llvm/blob/master/test/CodeGen/AArch64/preferred-function-alignment.ll






================
Comment at: test/CodeGen/AArch64/fma-aggressive.ll:323
+
+attributes #0 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="true" "no-jump-tables"="false" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="thunderx2t99" "target-features"="+lse,+neon,+v8.1a" "unsafe-fp-math"="true" "use-soft-float"="false" }
+attributes #1 = { argmemonly nounwind }
----------------
steleman wrote:
> fhahn wrote:
> > Can we drop the meta data from here to the end or is it required for the test?
> I'll check and if it works without the metadata, I'll remove it.
Great thanks. On second look, I think there is no need for the test case to be that complicated, for example, do we need all those global variables, function calls, ifs, loops? AFAIK DagCombine only looks at nodes and uses and does not have a cost model tied to loop iterations. 

Unless I am missing something, it should be enough to have a couple of basic blocks with fadd/fmul instructions to test this, e.g. fadd/fmul with multiple users, or the more complex patterns guarded by `if (Aggressive)` in `visitFADDForFMACombine`.

A much simpler test case will make it easier to debug if it fails in the future and also easier to understand when reviewing if it does the right thing.


Repository:
  rL LLVM

https://reviews.llvm.org/D40696





More information about the llvm-commits mailing list