-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RISCV] Don't create BuildPairF64 or SplitF64 nodes without D or Zdin…
…x. (#116159) The fix in ReplaceNodeResults is the only one really required for the known crash. I couldn't hit the case in LowerOperation because that requires (f64 (bitcast i64)), but the result type is softened before the input so we don't get a chance to legalize the input. The change to the setOperationAction call was an observation that a i64<->vector cast should not be custom legalized on RV32. The custom code already calls isTypeLegal on the scalar type.
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc < %s -mtriple=riscv32 -mattr=+zve32f,+zvl128b | FileCheck %s | ||
|
||
; This bitcast previously incorrectly produce a SplitF64 node. | ||
|
||
define i64 @foo(double %x) { | ||
; CHECK-LABEL: foo: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: addi sp, sp, -16 | ||
; CHECK-NEXT: .cfi_def_cfa_offset 16 | ||
; CHECK-NEXT: sw ra, 12(sp) # 4-byte Folded Spill | ||
; CHECK-NEXT: .cfi_offset ra, -4 | ||
; CHECK-NEXT: lui a3, 261888 | ||
; CHECK-NEXT: li a2, 0 | ||
; CHECK-NEXT: call __adddf3 | ||
; CHECK-NEXT: lw ra, 12(sp) # 4-byte Folded Reload | ||
; CHECK-NEXT: addi sp, sp, 16 | ||
; CHECK-NEXT: ret | ||
%a = fadd double %x, 1.0 | ||
%b = bitcast double %a to i64 | ||
ret i64 %b | ||
} |