Skip to content

[Hexagon][DAG][FREEZE] Fix bug 117337 #119042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/lib/Target/Hexagon/HexagonISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ class HexagonTargetLowering : public TargetLowering {
return AtomicExpansionKind::LLSC;
}

bool softPromoteHalfType() const override { return true; }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeGen/Hexagon/isel-buildvector-v2f16.ll fails with this change.

private:
void initializeHVXLowering();
unsigned getPreferredHvxVectorAction(MVT VecTy) const;
Expand Down
48 changes: 48 additions & 0 deletions llvm/test/CodeGen/Hexagon/fp16-promote.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=hexagon < %s | FileCheck %s

define half @freeze_half_undef() nounwind {
; CHECK-LABEL: freeze_half_undef:
; CHECK: // %bb.0:
; CHECK-NEXT: {
; CHECK-NEXT: call __truncsfhf2
; CHECK-NEXT: r0 = #0
; CHECK-NEXT: allocframe(#0)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: call __extendhfsf2
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: call __truncsfhf2
; CHECK-NEXT: r0 = sfadd(r0,r0)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: r31:30 = dealloc_return(r30):raw
; CHECK-NEXT: }
%y1 = freeze half undef
%t1 = fadd half %y1, %y1
ret half %t1
}

define half @freeze_half_poison(half %maybe.poison) {
; CHECK-LABEL: freeze_half_poison:
; CHECK: .cfi_startproc
; CHECK-NEXT: // %bb.0:
; CHECK-NEXT: .cfi_def_cfa r30, 8
; CHECK-NEXT: .cfi_offset r31, -4
; CHECK-NEXT: .cfi_offset r30, -8
; CHECK-NEXT: {
; CHECK-NEXT: call __extendhfsf2
; CHECK-NEXT: allocframe(r29,#0):raw
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: call __truncsfhf2
; CHECK-NEXT: r0 = sfadd(r0,r0)
; CHECK-NEXT: }
; CHECK-NEXT: {
; CHECK-NEXT: r31:30 = dealloc_return(r30):raw
; CHECK-NEXT: }
%y1 = freeze half %maybe.poison
%t1 = fadd half %y1, %y1
ret half %t1
}
Loading