[clang][LoongArch] Ensure target("lasx")
implies LSX support (#153542)
Currently, `__attribute__((target("lasx")))` does not automatically enable LSX support, causing Clang to fail with `-mno-lsx`. Since LASX depends on LSX, enabling LASX should implicitly enable LSX to avoid clang error. Fixes #149512. Depends on #153541 (cherry picked from commit a1b6e7ff393533a5c4f3bdfd4efe5da106e2de2b)
This commit is contained in:
parent
9bf61a610c
commit
08b5797556
@ -461,6 +461,8 @@ LoongArchTargetInfo::parseTargetAttr(StringRef Features) const {
|
||||
|
||||
case AttrFeatureKind::Feature:
|
||||
Ret.Features.push_back("+" + Value.str());
|
||||
if (Value == "lasx")
|
||||
Ret.Features.push_back("+lsx");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ __attribute__((target("lasx")))
|
||||
// CHECK: #[[ATTR0:[0-9]+]] {
|
||||
void testlasx() {}
|
||||
|
||||
// CHECK: attributes #[[ATTR0]] = { {{.*}}"target-features"="+64bit,+lasx,-lsx"{{.*}} }
|
||||
// CHECK: attributes #[[ATTR0]] = { {{.*}}"target-features"="+64bit,+lasx,+lsx"{{.*}} }
|
||||
|
Loading…
x
Reference in New Issue
Block a user