-
Notifications
You must be signed in to change notification settings - Fork 821
[SM6.9] Fix LV cast crash #8008
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
Conversation
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned in the issue here:
I don't understand why vectors should come into play at all, unless there's another bug. Why would you expect to add up the mantissa bits from multiple scalars in a vector to see if it's representable by a scalar int type? Am I missing something?
In the issue:
MinBW for a float2 is 65 so it fails the check and early exits as expected.
But what if it were half? Why is the vector size relevant at all for what should be a scalar transformation?
For |
Ok, so I had mistakenly thought we were adding up mantissa bit widths or something. The real issue is that the pass can't handle vectors at all, breaking when calling |
You can test this locally with the following command:git-clang-format --diff 2b90cd383384366273ba2e84edd48630e974acfd bdcbe891f5025e63c1df6d4e06e455f7179dd0bd -- lib/Transforms/Scalar/Float2Int.cppView the diff from clang-format here.diff --git a/lib/Transforms/Scalar/Float2Int.cpp b/lib/Transforms/Scalar/Float2Int.cpp
index 8cbe3895..e3beb07b 100644
--- a/lib/Transforms/Scalar/Float2Int.cpp
+++ b/lib/Transforms/Scalar/Float2Int.cpp
@@ -136,7 +136,8 @@ void Float2Int::findRoots(Function &F, SmallPtrSet<Instruction*,8> &Roots) {
if (isa<VectorType>(I.getType()))
continue;
switch (I.getOpcode()) {
- default: break;
+ default:
+ break;
case Instruction::FPToUI:
case Instruction::FPToSI:
Roots.insert(&I);
|
tex3d
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the right fix!
Fixes #7915
There is a detailed writeup in the issue but in summary, native vectors in SM6.9 shouldn't be optimized in the way this path enables and weren't cleanly being rejected. This change now rejects them