Skip to content

release/19.x: [MC][LoongArch] Change default cpu in MCSubtargetInfo. (#114922) #117105

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

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lld/test/ELF/emulation-loongarch.s
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# LA32-NEXT: StringTableSectionIndex:
# LA32-NEXT: }

# RUN: llvm-mc -filetype=obj -triple=loongarch64 %s -o %t.o
# RUN: llvm-mc -filetype=obj -triple=loongarch64 -mattr=+d %s -o %t.o
# RUN: ld.lld %t.o -o %t
# RUN: llvm-readobj --file-headers %t | FileCheck --check-prefix=LA64 %s
# RUN: ld.lld -m elf64loongarch %t.o -o %t
Expand Down
4 changes: 2 additions & 2 deletions lld/test/ELF/loongarch-interlink.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

# RUN: yaml2obj %t/blob.yaml -o %t/blob.o
# RUN: yaml2obj %t/v0-lp64d.yaml -o %t/v0-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu %t/start.s -o %t/v1-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu --mattr=+d %t/start.s -o %t/v1-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnusf %t/start.s -o %t/v1-lp64s.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu %t/bar.s -o %t/v1-b-lp64d.o
# RUN: llvm-mc --filetype=obj --triple=loongarch64-unknown-gnu --mattr=+d %t/bar.s -o %t/v1-b-lp64d.o

## Check that binary input results in e_flags=0 output.
# RUN: ld.lld -m elf64loongarch -b binary %t/blob.bin -o %t/blob.out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static MCInstrInfo *createLoongArchMCInstrInfo() {
static MCSubtargetInfo *
createLoongArchMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) {
if (CPU.empty() || CPU == "generic")
CPU = TT.isArch64Bit() ? "la464" : "generic-la32";
CPU = TT.isArch64Bit() ? "generic-la64" : "generic-la32";
return createLoongArchMCSubtargetInfoImpl(TT, CPU, /*TuneCPU*/ CPU, FS);
}

Expand Down
6 changes: 6 additions & 0 deletions llvm/test/CodeGen/LoongArch/e_flags.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
; RUN: llc --mtriple=loongarch32 --filetype=obj %s -o %t-la32s
; RUN: llvm-readelf -h %t-la32s | FileCheck %s --check-prefixes=ILP32,ABI-S --match-full-lines

; RUN: llc --mtriple=loongarch32 -mattr=+d --filetype=obj %s -o %t-la32
; RUN: llvm-readelf -h %t-la32 | FileCheck %s --check-prefixes=ILP32,ABI-D --match-full-lines

Expand All @@ -10,6 +13,9 @@
; RUN: llc --mtriple=loongarch32 -mattr=+d --filetype=obj %s --target-abi=ilp32d -o %t-ilp32d
; RUN: llvm-readelf -h %t-ilp32d | FileCheck %s --check-prefixes=ILP32,ABI-D --match-full-lines

; RUN: llc --mtriple=loongarch64 -mattr=+d --filetype=obj %s -o %t-la64d
; RUN: llvm-readelf -h %t-la64d | FileCheck %s --check-prefixes=LP64,ABI-D --match-full-lines

; RUN: llc --mtriple=loongarch64 -mattr=+d --filetype=obj %s -o %t-la64
; RUN: llvm-readelf -h %t-la64 | FileCheck %s --check-prefixes=LP64,ABI-D --match-full-lines

Expand Down