Skip to content
Merged
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/docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Changes to the LLVM IR
Changes to LLVM infrastructure
------------------------------

* Removed TypePromoteFloat legalization from SelectionDAG

Changes to building LLVM
------------------------

Expand Down
29 changes: 7 additions & 22 deletions llvm/include/llvm/CodeGen/TargetLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,15 +218,14 @@ class LLVM_ABI TargetLoweringBase {
TypeScalarizeVector, // Replace this one-element vector with its element.
TypeSplitVector, // Split this vector into two of half the size.
TypeWidenVector, // This vector should be widened into a larger vector.
TypePromoteFloat, // Replace this float with a larger one.
TypeSoftPromoteHalf, // Soften half to i16 and use float to do arithmetic.
TypeScalarizeScalableVector, // This action is explicitly left unimplemented.
// While it is theoretically possible to
// legalize operations on scalable types with a
// loop that handles the vscale * #lanes of the
// vector, this is non-trivial at SelectionDAG
// level and these types are better to be
// widened or promoted.
TypeScalarizeScalableVector, // This action is explicitly left
// unimplemented. While it is theoretically
// possible to legalize operations on scalable
// types with a loop that handles the vscale *
// #lanes of the vector, this is non-trivial at
// SelectionDAG level and these types are
// better to be widened or promoted.
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't seem like there is anything changed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

clang-format wanted to reindent everything

};

/// LegalizeKind holds the legalization kind that needs to happen to EVT
Expand Down Expand Up @@ -546,20 +545,6 @@ class LLVM_ABI TargetLoweringBase {
return TypePromoteInteger;
}

/// Warning: this option is problem-prone and tends to introduce
/// float miscompilations:
///
/// - https://github.com/llvm/llvm-project/issues/97975
/// - https://github.com/llvm/llvm-project/issues/97981
///
/// It should not be overridden to `false` except for special cases.
///
/// Return true if the half type should be promoted using soft promotion rules
/// where each operation is promoted to f32 individually, then converted to
/// fp16. The default behavior is to promote chains of operations, keeping
/// intermediate results in f32 precision and range.
virtual bool softPromoteHalfType() const { return true; }

// Return true if, for soft-promoted half, the half type should be passed to
// and returned from functions as f32. The default behavior is to pass as
// i16. If soft-promoted half is not used, this function is ignored and
Expand Down
Loading
Loading