LLVM 6+'s llvm::LoopInfo::erase(), unlike its predecessor 
llvm::LoopInfo::markAsRemoved(), doesn't necessarily remove the loop it 
erases from the to-be-processed queue.  Do this explicitly, as trying to 
process an erased (0-block) loop is likely to crash, e.g. in getHeader().

Signed-off-by: Rebecca N. Palmer <[email protected]>
---
Looks like I introduced this (in 6e60548a) - sorry.

Examples at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=913141

diff --git a/backend/src/llvm/llvm_unroll.cpp b/backend/src/llvm/llvm_unroll.cpp
index 813e116d..f378b63d 100644
--- a/backend/src/llvm/llvm_unroll.cpp
+++ b/backend/src/llvm/llvm_unroll.cpp
@@ -206,6 +206,7 @@ namespace gbe {
             //Don't change the unrollID if doesn't force unroll.
             //setUnrollID(parentL, false);
 #if LLVM_VERSION_MAJOR >= 6
+            LPM.markLoopAsDeleted(*parentL);
             loopInfo.erase(parentL);
 #elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
             loopInfo.markAsRemoved(parentL);

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to