[llvm] a218940 - [Lanai] Use `softPromoteHalfType` (#175137)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 02:07:41 PST 2026


Author: Trevor Gross
Date: 2026-01-09T11:07:36+01:00
New Revision: a218940d39a71f477cdde6946d03ce1ed004e8fc

URL: https://github.com/llvm/llvm-project/commit/a218940d39a71f477cdde6946d03ce1ed004e8fc
DIFF: https://github.com/llvm/llvm-project/commit/a218940d39a71f477cdde6946d03ce1ed004e8fc.diff

LOG: [Lanai] Use `softPromoteHalfType` (#175137)

There are currently no other tests checking `half` so I am unsure how
well supported the type is, but the patch here resolves the op tests.

Fixes the (unlisted) Lanai portion of
https://github.com/llvm/llvm-project/issues/97975
Fixes the (unlisted) Lanai portion of
https://github.com/llvm/llvm-project/issues/97981

Added: 
    

Modified: 
    llvm/lib/Target/Lanai/LanaiISelLowering.h
    llvm/test/CodeGen/Generic/half-op.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Lanai/LanaiISelLowering.h b/llvm/lib/Target/Lanai/LanaiISelLowering.h
index b0d5644c1c4a1..f8af4cdb0fe7c 100644
--- a/llvm/lib/Target/Lanai/LanaiISelLowering.h
+++ b/llvm/lib/Target/Lanai/LanaiISelLowering.h
@@ -69,6 +69,8 @@ class LanaiTargetLowering : public TargetLowering {
                                      const SelectionDAG &DAG,
                                      unsigned Depth = 0) const override;
 
+  bool softPromoteHalfType() const override { return true; }
+
 private:
   SDValue LowerCCCCallTo(SDValue Chain, SDValue Callee,
                          CallingConv::ID CallConv, bool IsVarArg,

diff  --git a/llvm/test/CodeGen/Generic/half-op.ll b/llvm/test/CodeGen/Generic/half-op.ll
index f08c71b187eb1..4c0eb8a293293 100644
--- a/llvm/test/CodeGen/Generic/half-op.ll
+++ b/llvm/test/CodeGen/Generic/half-op.ll
@@ -16,7 +16,7 @@
 ; RUN: %if csky-registered-target        %{ llc %s -o - -mtriple=csky-unknown-linux-gnuabiv2 -mcpu=ck860fv -mattr=+hard-float | FileCheck %s --check-prefixes=ALL,BAD-NEG-ABS,BAD-COPYSIGN,BAD-FMA %}
 ; FIXME: directx has a compiler error
 ; RUN: %if hexagon-registered-target     %{ llc %s -o - -mtriple=hexagon-unknown-linux-musl      | FileCheck %s --check-prefixes=ALL,CHECK-NEG-ABS,CHECK-COPYSIGN,CHECK-FMA %}
-; RUN: %if lanai-registered-target       %{ llc %s -o - -mtriple=lanai-unknown-unknown           | FileCheck %s --check-prefixes=ALL,BAD-NEG-ABS,BAD-COPYSIGN,BAD-FMA %}
+; RUN: %if lanai-registered-target       %{ llc %s -o - -mtriple=lanai-unknown-unknown           | FileCheck %s --check-prefixes=ALL,CHECK-NEG-ABS,CHECK-COPYSIGN,CHECK-FMA %}
 ; RUN: %if loongarch-registered-target   %{ llc %s -o - -mtriple=loongarch32-unknown-linux-gnu   | FileCheck %s --check-prefixes=ALL,CHECK-NEG-ABS,CHECK-COPYSIGN,CHECK-FMA %}
 ; RUN: %if loongarch-registered-target   %{ llc %s -o - -mtriple=loongarch64-unknown-linux-gnu   | FileCheck %s --check-prefixes=ALL,CHECK-NEG-ABS,CHECK-COPYSIGN,CHECK-FMA %}
 ; RUN: %if loongarch-registered-target   %{ llc %s -o - -mtriple=loongarch64-unknown-linux-gnu -mattr=+f | FileCheck %s --check-prefixes=ALL,CHECK-NEG-ABS,CHECK-COPYSIGN,CHECK-FMA %}


        


More information about the llvm-commits mailing list