[PATCH] D123663: [PPC][CodeGen][NFC] Use ArrayRef in TargetLowering functions

Kai Luo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 02:40:08 PDT 2022


lkail added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:197
     setLoadExtAction(ISD::EXTLOAD, MVT::f64, MVT::f16, Expand);
-    setOperationAction(ISD::FP16_TO_FP, MVT::f64, Expand);
-    setOperationAction(ISD::FP_TO_FP16, MVT::f64, Expand);
+    setOperationAction({ISD::FP16_TO_FP, ISD::FP_TO_FP16}, {MVT::f64, MVT::f32},
+                       Expand);
----------------
I doubt if it really eases developer to read the code. This API implies Cartesian product, but some might think it as one-to-one mapping at first glance due to the same length.
Also, if we have new operation but only applied to `MVT::f64`, we still need another statement to specify it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123663



More information about the llvm-commits mailing list