aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-09-05 18:37:45 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-09-05 18:37:45 +0000
commit791cdd5fe08162f982e013057b587c9a8ff0bd03 (patch)
tree786e4f70a27d83a10e65ba0efd5ccd00ee0ec3f1
parent577056f89c840537b059ea4cef8d2ae18513cda0 (diff)
downloadexternal_llvm-791cdd5fe08162f982e013057b587c9a8ff0bd03.zip
external_llvm-791cdd5fe08162f982e013057b587c9a8ff0bd03.tar.gz
external_llvm-791cdd5fe08162f982e013057b587c9a8ff0bd03.tar.bz2
R600: Fix segfault in R600TextureIntrinsicReplacer
This pass was segfaulting when it ran into a non-intrinsic function call. Function calls are not supported, so now instead of segfaulting, we will get an assertion failure with a nice error message. I'm not sure how to test this using lit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190076 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/R600/R600TextureIntrinsicsReplacer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp b/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp
index 37d9059..d4b8ec0 100644
--- a/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp
+++ b/lib/Target/R600/R600TextureIntrinsicsReplacer.cpp
@@ -260,6 +260,9 @@ public:
}
void visitCallInst(CallInst &I) {
+ if (!I.getCalledFunction()) {
+ return;
+ }
StringRef Name = I.getCalledFunction()->getName();
if (Name == "llvm.AMDGPU.tex") {
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.tex", "llvm.R600.texc");