summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2017-07-19 17:54:29 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2017-07-19 17:54:29 +0000
commit93fdaca5ac327b08f8be188f2404e064ce7ae478 (patch)
tree043a826387e3347795f0da7b30fb3663bbe8128a /llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
parent6531df41ae53493cddf12ced62427b54fa7e0570 (diff)
downloadbcm5719-llvm-93fdaca5ac327b08f8be188f2404e064ce7ae478.tar.gz
bcm5719-llvm-93fdaca5ac327b08f8be188f2404e064ce7ae478.zip
ThinLTOBitcodeWriter: Do not rewrite intrinsic functions when splitting modules.
Changing the type of an intrinsic may invalidate the IR. Differential Revision: https://reviews.llvm.org/D35593 llvm-svn: 308500
Diffstat (limited to 'llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp')
-rw-r--r--llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
index 8ef6bb65230..c33ce14c759 100644
--- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
+++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp
@@ -141,7 +141,9 @@ void simplifyExternals(Module &M) {
continue;
}
- if (!F.isDeclaration() || F.getFunctionType() == EmptyFT)
+ if (!F.isDeclaration() || F.getFunctionType() == EmptyFT ||
+ // Changing the type of an intrinsic may invalidate the IR.
+ F.getName().startswith("llvm."))
continue;
Function *NewF =
OpenPOWER on IntegriCloud