Codegen: Do not crash when seeing debug intrinsics
We now skip the debug intrinsics which is a lot better than crashing due to
uncopied metadata references. We should step by step investigate which debug
intrinsics we can copy without trouble.
We still keep the debug location metadata.
llvm-svn: 201860
diff --git a/polly/lib/CodeGen/BlockGenerators.cpp b/polly/lib/CodeGen/BlockGenerators.cpp
index b66b034..a5d1f0f 100644
--- a/polly/lib/CodeGen/BlockGenerators.cpp
+++ b/polly/lib/CodeGen/BlockGenerators.cpp
@@ -25,6 +25,7 @@
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ScalarEvolutionExpander.h"
+#include "llvm/IR/IntrinsicInst.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
using namespace llvm;
@@ -219,6 +220,13 @@
void BlockGenerator::copyInstScalar(const Instruction *Inst, ValueMapT &BBMap,
ValueMapT &GlobalMap, LoopToScevMapT <S) {
+
+ // We do not generate debug intrinsics as we did not investigate how to
+ // copy them correctly. At the current state, they just crash the code
+ // generation as the meta-data operands are not correctly copied.
+ if (isa<DbgInfoIntrinsic>(Inst))
+ return;
+
Instruction *NewInst = Inst->clone();
// Replace old operands with the new ones.