mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Fix use after free (pr16103).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182482 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
431c73bc33
commit
812789dd3d
@ -259,20 +259,35 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void visitCallInst(CallInst &I) {
|
void visitCallInst(CallInst &I) {
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.tex")
|
StringRef Name = I.getCalledFunction()->getName();
|
||||||
|
if (Name == "llvm.AMDGPU.tex") {
|
||||||
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.tex", "llvm.R600.texc");
|
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.tex", "llvm.R600.texc");
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.txl")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.txl") {
|
||||||
ReplaceTexIntrinsic(I, true, TexSign, "llvm.R600.txl", "llvm.R600.txlc");
|
ReplaceTexIntrinsic(I, true, TexSign, "llvm.R600.txl", "llvm.R600.txlc");
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.txb")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.txb") {
|
||||||
ReplaceTexIntrinsic(I, true, TexSign, "llvm.R600.txb", "llvm.R600.txbc");
|
ReplaceTexIntrinsic(I, true, TexSign, "llvm.R600.txb", "llvm.R600.txbc");
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.txf")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.txf") {
|
||||||
ReplaceTXF(I);
|
ReplaceTXF(I);
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.txq")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.txq") {
|
||||||
ReplaceTexIntrinsic(I, false, TexQSign, "llvm.R600.txq", "llvm.R600.txq");
|
ReplaceTexIntrinsic(I, false, TexQSign, "llvm.R600.txq", "llvm.R600.txq");
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.ddx")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.ddx") {
|
||||||
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.ddx", "llvm.R600.ddx");
|
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.ddx", "llvm.R600.ddx");
|
||||||
if (I.getCalledFunction()->getName() == "llvm.AMDGPU.ddy")
|
return;
|
||||||
|
}
|
||||||
|
if (Name == "llvm.AMDGPU.ddy") {
|
||||||
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.ddy", "llvm.R600.ddy");
|
ReplaceTexIntrinsic(I, false, TexSign, "llvm.R600.ddy", "llvm.R600.ddy");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user