-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[IR] Add TargetExtType::CanBeLocal property #99016
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 2 commits
c2eda0a
7383934
c2e94ea
99b4a5f
db1bba8
f834c16
44fafe6
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 |
|---|---|---|
|
|
@@ -826,12 +826,14 @@ static TargetTypeInfo getTargetTypeInfo(const TargetExtType *Ty) { | |
| return TargetTypeInfo(PointerType::get(C, 0), TargetExtType::CanBeGlobal); | ||
|
||
| if (Name.starts_with("spirv.")) | ||
| return TargetTypeInfo(PointerType::get(C, 0), TargetExtType::HasZeroInit, | ||
| TargetExtType::CanBeGlobal); | ||
| TargetExtType::CanBeGlobal, | ||
| TargetExtType::CanBeLocal); | ||
|
|
||
| // Opaque types in the AArch64 name space. | ||
| if (Name == "aarch64.svcount") | ||
| return TargetTypeInfo(ScalableVectorType::get(Type::getInt1Ty(C), 16), | ||
| TargetExtType::HasZeroInit); | ||
| TargetExtType::HasZeroInit, | ||
| TargetExtType::CanBeLocal); | ||
|
|
||
| return TargetTypeInfo(Type::getVoidTy(C)); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2021,6 +2021,12 @@ void Verifier::verifyParameterAttrs(AttributeSet Attrs, Type *Ty, | |
| SmallPtrSet<Type *, 4> Visited; | ||
| Check(Attrs.getByValType()->isSized(&Visited), | ||
| "Attribute 'byval' does not support unsized types!", V); | ||
| // Check if it's a target extension type that disallows being used on the | ||
| // stack. | ||
| if (auto *TTy = dyn_cast<TargetExtType>(Attrs.getByValType())) { | ||
| Check(TTy->hasProperty(TargetExtType::CanBeLocal), | ||
| "'byval' argument has illegal target extension type", V); | ||
| } | ||
| Check(DL.getTypeAllocSize(Attrs.getByValType()).getKnownMinValue() < | ||
| (1ULL << 32), | ||
| "huge 'byval' arguments are unsupported", V); | ||
|
|
@@ -4285,6 +4291,12 @@ void Verifier::visitAllocaInst(AllocaInst &AI) { | |
| SmallPtrSet<Type*, 4> Visited; | ||
| Check(AI.getAllocatedType()->isSized(&Visited), | ||
| "Cannot allocate unsized type", &AI); | ||
| // Check if it's a target extension type that disallows being used on the | ||
| // stack. | ||
| if (auto *TTy = dyn_cast<TargetExtType>(AI.getAllocatedType())) { | ||
| Check(TTy->hasProperty(TargetExtType::CanBeLocal), | ||
| "Alloca has illegal target extension type", &AI); | ||
|
||
| } | ||
| Check(AI.getArraySize()->getType()->isIntegerTy(), | ||
| "Alloca array size must have integer type", &AI); | ||
| if (MaybeAlign A = AI.getAlign()) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.