llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `clang-hip-vega20` running
on `hip-vega20-0` while building `clang` at step 3 "annotate".
Full details are available at:
https://lab.llvm.org/buildbot/#/builders/123/builds/5253
Here is the relevant piece of the build log for
github-actions[bot] wrote:
@JinjinLi868 Congratulations on having your first Pull Request (PR) merged into
the LLVM Project!
Your changes will be combined with recent changes from other authors, then
tested by our [build bots](https://lab.llvm.org/buildbot/). If there is a
problem with a bu
https://github.com/wangpc-pp closed
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arsenm approved this pull request.
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 6688d7ed8a0ce0c6885b82218e832320da57eef0 Mon Sep 17 00:00:00 2001
From: JinjinLi868
Date: Wed, 4 Sep 2024 16:43:48 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data typ
JinjinLi868 wrote:
> > > The vector tests should still be added
> >
> >
> > sorry. if i remove the change of the vector. i have to remove the testcase.
> > because, for the current code convert between vector type of half and
> > bfloat16, it has a bug. And it will be Assert "Invalid cast!""
arsenm wrote:
> > The vector tests should still be added
>
> sorry. if i remove the change of the vector. i have to remove the testcase.
> because, for the current code convert between vector type of half and
> bfloat16, it has a bug. And it will be Assert "Invalid cast!""
>
OK, LGTM with th
JinjinLi868 wrote:
i add the gcc behavior in this case
```
__bf16 test_convert_from_fp16_to_bf16(_Float16 a) {
return (__bf16)a;
}
test_convert_from_fp16_to_bf16(_Float16):
pushrbp
mov rbp, rsp
sub rsp, 16
movdeax, xmm0
mov WORD PTR
JinjinLi868 wrote:
> The vector tests should still be added
sorry. if i remove the change of the vector. i have to remove the testcase.
because, for the current code convert between vector type of half and bfloat16,
it has a bug. And it will be Assert "Invalid cast!""
`CastInst *CastInst::Crea
https://github.com/arsenm commented:
The vector tests should still be added
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1431,9 +1431,13 @@ Value *ScalarExprEmitter::EmitScalarCast(Value *Src,
QualType SrcType,
return Builder.CreateFPToUI(Src, DstTy, "conv");
}
- if (DstElementTy->getTypeID() < SrcElementTy->getTypeID())
+ if ((DstElementTy->is16bitFPTy() && SrcElementTy->is16bitFPT
JinjinLi868 wrote:
> > ok, you mean, i remove the vector testcase for this patch. and just save
> > the scalar testcase?
>
> No, keep the tests. Only keep the scalar behavior change. The previous
> revision was essentially correct and minimal
i have changed. just save the scalar on this patch
JinjinLi868 wrote:
> > > > @JinjinLi868 are you still working on this?
> > >
> > >
> > > yes, i am. could you give me some advice and can i help you ?
> >
> >
> > Can we have a scalar only patch as @arsenm requested?
>
> ok, you mean, i remove the vector testcase for this patch. and just sav
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 3c2e873551aa85abe9011996c5adfaac544d0104 Mon Sep 17 00:00:00 2001
From: JinjinLi868
Date: Wed, 4 Sep 2024 16:43:48 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data typ
arsenm wrote:
> ok, you mean, i remove the vector testcase for this patch. and just save the
> scalar testcase?
No, keep the tests. Only keep the scalar behavior change. The previous revision
was essentially correct and minimal
https://github.com/llvm/llvm-project/pull/89051
JinjinLi868 wrote:
> > > @JinjinLi868 are you still working on this?
> >
> >
> > yes, i am. could you give me some advice and can i help you ?
>
> Can we have a scalar only patch as @arsenm requested?
ok, you mean, i remove the vector testcase for this patch. and just save the
scalar testcas
topperc wrote:
> > @JinjinLi868 are you still working on this?
>
> yes, i am. could you give me some advice and can i help you ?
Can we have a scalar only patch as @arsenm requested?
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mai
@@ -1431,9 +1431,13 @@ Value *ScalarExprEmitter::EmitScalarCast(Value *Src,
QualType SrcType,
return Builder.CreateFPToUI(Src, DstTy, "conv");
}
- if (DstElementTy->getTypeID() < SrcElementTy->getTypeID())
+ if ((DstElementTy->is16bitFPTy() && SrcElementTy->is16bitFPT
topperc wrote:
> > @JinjinLi868 are you still working on this?
>
> I can ask him. Is this PR blocking some of your recent works on float16/bf16?
I stumbled onto the verifier error earlier while writing a test. It's not
blocking me.
https://github.com/llvm/llvm-project/pull/89051
_
JinjinLi868 wrote:
> @JinjinLi868 are you still working on this?
yes, i am. could you give me some advice and can i help you ?
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.o
wangpc-pp wrote:
> @JinjinLi868 are you still working on this?
I can ask him. Is this PR blocking some of your works on float16/bf16?
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists
topperc wrote:
@JinjinLi868 are you still working on this?
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -disable-O0-optnone
-emit-llvm \
+// RUN: %s -o - | opt -S -passes=mem2reg | FileCheck %s
+
+// CHECK-LABEL: define dso_local half @test_convert_from_bf16_to_fp16(
+// CHECK-SAME: bfloat noundef [[A:%.*]]) #[
arsenm wrote:
> ping Ping Do you have another review comment?
This has now confused me. You should roll back to the case where you only
changed the scalar behavior. Any vector behavior change should be a separate
PR, if that is even correct. I would still like to know what the gcc behavior
is
JinjinLi868 wrote:
ping
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/wangpc-pp edited
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -disable-O0-optnone
-emit-llvm \
+// RUN: %s -o - | opt -S -passes=mem2reg | FileCheck %s
+
+// CHECK-LABEL: define dso_local half @test_convert_from_bf16_to_fp16(
+// CHECK-SAME: bfloat noundef [[A:%.*]]) #[
@@ -0,0 +1,165 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -disable-O0-optnone
-emit-llvm \
+// RUN: %s -o - | opt -S -passes=mem2reg | FileCheck %s
+
+// CHECK-LABEL: define dso_local half @test_convert_from_bf16_to_fp16(
+// CHECK-SAME: bfloat noundef [[A:%.*]]) #
@@ -1906,7 +1909,15 @@ Value
*ScalarExprEmitter::VisitConvertVectorExpr(ConvertVectorExpr *E) {
} else {
assert(SrcEltTy->isFloatingPointTy() && DstEltTy->isFloatingPointTy() &&
"Unknown real conversion");
-if (DstEltTy->getTypeID() < SrcEltTy->getTypeID()
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -disable-O0-optnone
-emit-llvm \
+// RUN: %s -o - | opt -S -passes=mem2reg | FileCheck %s
+
+// CHECK-LABEL: define dso_local half @test_convert_from_bf16_to_fp16(
+// CHECK-SAME: bfloat noundef [[A:%.*]]) #[
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 0afac9d8a6acedff53089f55eacb92a2880f58aa Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
@@ -0,0 +1,165 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -disable-O0-optnone
-emit-llvm \
+// RUN: %s -o - | opt -S -passes=mem2reg | FileCheck %s
+
+// CHECK-LABEL: define dso_local half @test_convert_from_bf16_to_fp16(
+// CHECK-SAME: bfloat noundef [[A:%.*]]) #
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 31ced11517042bcbd6f5f6e544cadf6943c1b1c0 Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 45c6985815f7896c09c1be1eefc10cd4f9cd35af Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
@@ -1431,9 +1431,13 @@ Value *ScalarExprEmitter::EmitScalarCast(Value *Src,
QualType SrcType,
return Builder.CreateFPToUI(Src, DstTy, "conv");
}
- if (DstElementTy->getTypeID() < SrcElementTy->getTypeID())
+ if ((DstElementTy->is16bitFPTy() && SrcElementTy->is16bitFPT
https://github.com/arsenm approved this pull request.
LGTM. Would be good to verify the vector case is "correct" in as far as it's
what GCC does
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
wangpc-pp wrote:
```sugges
efriedma-quic wrote:
Looks like automation didn't trigger, but:
> ⚠️ We detected that you are using a GitHub private e-mail address to
> contribute to the repo.
> Please turn off [Keep my email addresses
> private](https://github.com/settings/emails) setting in your account.
> See [LLVM
> Dis
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
https://github.com/efriedma-quic approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/efriedma-quic edited
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
@@ -0,0 +1,194 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
JinjinLi868 wrote:
> For the vector case, I think you want __builtin_convertvector or something
> like that
thanks, i have add __builtin_convertvector testcase
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From f61686e42906886a0686158b3050767e60b576fa Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
efriedma-quic wrote:
For the vector case, I think you want __builtin_convertvector or something like
that
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/li
JinjinLi868 wrote:
> > But In some target, it supply a HW instruction to complete the process
> > (fp16->float32->bf16) . so it just supply a intrinsic (fp16 -> bf16)
>
> Which is not a bitcast. The correct IR representation of this conversion is
> fpext+fptrunc
i understand, i have changed.
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 9e6c2a16172c66b7a9eec7957d95b4239f178368 Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
arsenm wrote:
> But In some target, it supply a HW instruction to complete the process
> (fp16->float32->bf16) . so it just supply a intrinsic (fp16 -> bf16)
Which is not a bitcast. The correct IR representation of this conversion is
fpext+fptrunc
https://github.com/llvm/llvm-project/pull/89
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From a8d31ec6602f55f845b9e508f71a42f83e3a474e Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
@@ -0,0 +1,109 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/arsenm requested changes to this pull request.
Bitcast is not the correct behavior
https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listin
@@ -0,0 +1,109 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 8d0ed7653c21315c5c920114b3a2d7686e54b9ca Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
JinjinLi868 wrote:
> > This appears to just assert today, but interpreting this as bitcast doesn't
> > make sense. I would expect this to emit a pair of casts, fpext to float,
> > and fptrunc down to half
>
> If we don't just reject it as an invalid cast
i understand your means, it like a Har
JinjinLi868 wrote:
> This appears to just assert today, but interpreting this as bitcast doesn't
> make sense. I would expect this to emit a pair of casts, fpext to float, and
> fptrunc down to half
https://github.com/llvm/llvm-project/pull/89051
_
arsenm wrote:
> This appears to just assert today, but interpreting this as bitcast doesn't
> make sense. I would expect this to emit a pair of casts, fpext to float, and
> fptrunc down to half
If we don't just reject it as an invalid cast
https://github.com/llvm/llvm-project/pull/89051
https://github.com/arsenm edited https://github.com/llvm/llvm-project/pull/89051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,14 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --version 4
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -target-feature +fullbf16
-S -emit-llvm %s -o - | FileCheck %s
+// CHECK-LABEL: define dso_local half @test_
https://github.com/arsenm commented:
This appears to just assert today, but interpreting this as bitcast doesn't
make sense. I would expect this to emit a pair of casts, fpext to float, and
fptrunc down to half
https://github.com/llvm/llvm-project/pull/89051
__
https://github.com/JinjinLi868 updated
https://github.com/llvm/llvm-project/pull/89051
>From 69a584119d8978d0ea3177c59d8772f00df3a68e Mon Sep 17 00:00:00 2001
From: Jinjin Li
Date: Wed, 17 Apr 2024 16:44:50 +0800
Subject: [PATCH] [clang] Fix half && bfloat16 convert node expr codegen
Data type
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (JinjinLi868)
Changes
Data type conversion between fp16 and bf16 will generate fptrunc and fpextend
nodes, but they are actually bitcast nodes.
---
Full diff: https://github.com/llvm/llvm-project/pull/89051.diff
1 Files Affected:
github-actions[bot] wrote:
Thank you for submitting a Pull Request (PR) to the LLVM Project!
This PR will be automatically labeled and the relevant teams will be
notified.
If you wish to, you can add reviewers by using the "Reviewers" section on this
page.
If this is not working for you, it
https://github.com/JinjinLi868 created
https://github.com/llvm/llvm-project/pull/89051
Data type conversion between fp16 and bf16 will generate fptrunc and fpextend
nodes, but they are actually bitcast nodes.
>From 02c11a9db49dd34839feb8329cfb8dbe4bc45763 Mon Sep 17 00:00:00 2001
From: Jinjin
68 matches
Mail list logo