[PATCH] D82372: [ARM][BFloat] Legalize bf16 type even without fullfp16.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 08:31:34 PDT 2020


dmgreen added inline comments.


================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:729
+    if (!Subtarget->hasFullFP16()) {
+      setAllExpand(MVT::bf16);
+      setOperationAction(ISD::BITCAST, MVT::bf16, Custom);
----------------
I'm not sure if setAllExpand should be guarded by !hasFullFP16? In either case they would be in pretty much the same situation - most operations are illegal with bf16. Does something go wrong always doing this?


================
Comment at: llvm/lib/Target/ARM/ARMInstrVFP.td:166
 
-def : FPRegs16Pat<(f16 (alignedload16 addrmode5fp16:$addr)),
-                  (VLDRH addrmode5fp16:$addr)>;
-def : FPRegs16Pat<(bf16 (alignedload16 addrmode5fp16:$addr)),
-                  (VLDRH addrmode5fp16:$addr)>;
+foreach fptype = [f16, bf16] in {
+  def : Pat<(fptype (alignedload16 addrmode5fp16:$addr)),
----------------
I would expect HasNoFPRegs16 + f16 to never come up? If so you could alternatively move that single pattern back into the instruction above.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82372





More information about the llvm-commits mailing list