-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MIPS] Fix failing to legalize load+call with vector of non-p2 intege… #109625
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
@@ -124,7 +124,8 @@ unsigned MipsTargetLowering::getNumRegistersForCallingConv(LLVMContext &Context, | |||
unsigned MipsTargetLowering::getVectorTypeBreakdownForCallingConv( | |||
LLVMContext &Context, CallingConv::ID CC, EVT VT, EVT &IntermediateVT, | |||
unsigned &NumIntermediates, MVT &RegisterVT) const { | |||
if (VT.isPow2VectorType()) { | |||
|
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.
Stray empty line.
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.
Applied.
@@ -0,0 +1,30 @@ | |||
; RUN: llc -mtriple=mips-linux-gnu -mcpu=mips32 < %s | FileCheck %s --check-prefix=MIPS32 | |||
|
|||
define void @call_v1i80() { |
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.
Add nounwind to suppress cfi.
; MIPS32-NEXT: jr $ra | ||
; MIPS32-NEXT: addiu $sp, $sp, 8 | ||
Entry: | ||
%0 = load <1 x i80>, ptr null, align 16 |
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.
This test case is over-reduced. Does the problem still reproduce if you replace the nulls here with a real pointer and a real function declaration?
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.
Yes, this situation you mentioned also can be solved and the reported bug info was same as null pointer situation. I tested the following test case.
$ cat 1.ll
target datalayout = "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
target triple = "mipsel-unknown-linux-unknown"
define void @arg_v1i80(<1 x i80> %vec, ptr %p) {
store <1 x i80> %vec, ptr %p
ret void
}
define void @_start(ptr %p) nounwind{
Entry:
%0 = load <1 x i80>, ptr %p, align 16
call void @arg_v1i80(<1 x i80> %0)
ret void
}
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'd add this to the illegal-vectors.ll test, which has a lot of related coverage.
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.
Need I added call_v1i80
to this file?
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.
Move test to illegal-vectors.ll done.
…r type Add a condition to check whether the vector element type is a power of 2. Fix llvm#102870.
85cb620
to
8c0a0f8
Compare
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.
LGTM
…r type
Add a condition to check whether the vector element type is a power of 2.
Fix #102870.