-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[LV] Remove common extends and selects in CSE #147731
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,6 +804,10 @@ int FunctionComparator::cmpOperations(const Instruction *L, | |
return Res; | ||
} | ||
} | ||
if (const CastInst *Cast = dyn_cast<CastInst>(L)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps I'm missing something here, but I'm surprised this isn't already caught by
above? Wouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just asked myself the same question, because it is surprising this requires explicit code, but my understanding is that a return value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you're right about this being caught by the earlier check. Added a test to make sure. |
||
const CastInst *CastR = cast<CastInst>(R); | ||
return cmpTypes(Cast->getDestTy(), CastR->getDestTy()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @SamTebbs33 do we need a separate test for the FunctionComparator change? (I don't think that's currently tested?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed because it's caught by
and I've added a test to make sure. |
||
} | ||
return 0; | ||
} | ||
|
||
|
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.
It would be good to have a PR for these changes in isolation with some non-vectoriser tests that show the improvement.
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.
FWIW, I couldn't find any dedicated tests for
Instruction::isSameOperationAs
, so perhaps the changes to existing tests would be sufficient?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.
It seems as though this change isn't actually necessary and I've added some tests with different destination types to show that.