1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

LegacyDivergenceAnalysis: fix uninitialized value

Change-Id: I014502e431a68f7beddf169f6a3d19dac5dd2c26
llvm-svn: 348051
This commit is contained in:
Nicolai Haehnle 2018-11-30 23:07:49 +00:00
parent 823fb6a6a7
commit a2aef02f31

View File

@ -356,7 +356,7 @@ void LegacyDivergenceAnalysis::print(raw_ostream &OS, const Module *) const {
if ((!gpuDA || !gpuDA->hasDivergence()) && DivergentValues.empty())
return;
const Function *F;
const Function *F = nullptr;
if (!DivergentValues.empty()) {
const Value *FirstDivergentValue = *DivergentValues.begin();
if (const Argument *Arg = dyn_cast<Argument>(FirstDivergentValue)) {
@ -370,6 +370,8 @@ void LegacyDivergenceAnalysis::print(raw_ostream &OS, const Module *) const {
} else if (gpuDA) {
F = &gpuDA->getFunction();
}
if (!F)
return;
// Dumps all divergent values in F, arguments and then instructions.
for (auto &Arg : F->args()) {