Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIPS: fix build from IR files, nan2008 and FpAbi
When we use llc or lld to compiler IR files, the features +nan2008 and +fpxx/+fp64 are not used. Thus wrong format files are produced. In IR files, the attributes are only set for function while not the whole compile units. So we extract the attributes from the first function and use it for the whole unit. isFPXXDefault: for o32, the FPXX should always be the default, no matter about the vendors. Of course some distributions with FP64 default enabled should be listed explicit. Let's add them in future if we know about one. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D140270
- Loading branch information
Showing
5 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
;; When we compile object with "-flto", the info of "-mnan=2008" | ||
;; and "-mfp32/-mfpxx/-mfp64" will be missing in the result IR file. | ||
;; Thus the asm/obj files will have wrong format. | ||
;; With D140270 we extract these info from the first function, | ||
;; and set it for the whole compile unit. | ||
; RUN: llc %s -o - | FileCheck %s | ||
|
||
target triple = "mipsel-unknown-linux-gnu" | ||
|
||
define dso_local void @test() #0 { | ||
ret void | ||
} | ||
|
||
attributes #0 = { "target-cpu"="mips32r2" "target-features"="+fp64,+mips32r2,+nan2008" } | ||
|
||
|
||
; CHECK: .nan 2008 | ||
; CHECK: .module fp=64 |