-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][PowerPC] Add getScalarIntVT to return MVT based on arch #115203
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
Changes from all commits
cfee1a7
aa7bdbd
fe993b4
4b53143
d75004c
d810c08
3bb9a2b
74674a3
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 |
---|---|---|
|
@@ -216,8 +216,8 @@ class PPCSubtarget : public PPCGenSubtargetInfo { | |
bool isSVR4ABI() const { return !isAIXABI(); } | ||
bool isELFv2ABI() const; | ||
|
||
bool is64BitELFABI() const { return isSVR4ABI() && isPPC64(); } | ||
bool is32BitELFABI() const { return isSVR4ABI() && !isPPC64(); } | ||
bool is64BitELFABI() const { return isSVR4ABI() && isPPC64(); } | ||
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. Unrelated changes? 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. Yes this is. It was auto updated by clang-format. Not sure why it was identified as needing change but I left it since its a valid format update. 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. Fair enough, thanks Lei. |
||
bool is32BitELFABI() const { return isSVR4ABI() && !isPPC64(); } | ||
bool isUsingPCRelativeCalls() const; | ||
|
||
/// Originally, this function return hasISEL(). Now we always enable it, | ||
|
@@ -246,6 +246,8 @@ class PPCSubtarget : public PPCGenSubtargetInfo { | |
/// True if the GV will be accessed via an indirect symbol. | ||
bool isGVIndirectSymbol(const GlobalValue *GV) const; | ||
|
||
MVT getScalarIntVT() const { return isPPC64() ? MVT::i64 : MVT::i32; } | ||
|
||
/// Calculates the effective code model for argument GV. | ||
CodeModel::Model getCodeModel(const TargetMachine &TM, | ||
const GlobalValue *GV) const; | ||
|
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.
Is the reason why we don't use
Subtarget.getScalarIntVT()
here because we haveIsPPC64
, so if we don't use it in the function, the argument becomes unused?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 is cause this is a static function that doesn't have access to
Subtarget
. This function is also called from another static function that has no access toSubtarget
and usesisPPC64
in a different way. I didn't think this patch should include trying to fix those dependencies. I updated the var since it didn't follow the variable name guideline where variables should start with a capital.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.
Yeah, I agree that this patch should not fix those dependencies. Thanks for explaining.