forked from OSchip/llvm-project
b080b630b1
Summary: Now when you ask clang to link in a bitcode module, you can tell it to set attributes on that module's functions to match what we would have set if we'd emitted those functions ourselves. This is particularly important for fast-math attributes in CUDA compilations. Each CUDA compilation links in libdevice, a bitcode library provided by nvidia as part of the CUDA distribution. Without this patch, if we have a user-function F that is compiled with -ffast-math that calls a function G from libdevice, F will have the unsafe-fp-math=true (etc.) attributes, but G will have no attributes. Since F calls G, the inliner will merge G's attributes into F's. It considers the lack of an unsafe-fp-math=true attribute on G to be tantamount to unsafe-fp-math=false, so it "merges" these by setting unsafe-fp-math=false on F. This then continues up the call graph, until every function that (transitively) calls something in libdevice gets unsafe-fp-math=false set, thus disabling fastmath in almost all CUDA code. Reviewers: echristo Subscribers: hfinkel, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D28538 llvm-svn: 293097 |
||
---|---|---|
.. | ||
ARCMigrate | ||
AST | ||
ASTMatchers | ||
Analysis | ||
Basic | ||
CodeGen | ||
Driver | ||
Edit | ||
Format | ||
Frontend | ||
FrontendTool | ||
Headers | ||
Index | ||
Lex | ||
Parse | ||
Rewrite | ||
Sema | ||
Serialization | ||
StaticAnalyzer | ||
Tooling | ||
CMakeLists.txt |