diff options
author | dim <dim@FreeBSD.org> | 2015-02-22 16:04:37 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-02-22 16:04:37 +0000 |
commit | 9bd5a747dd2c968d97a8932065fb94723bbeae9c (patch) | |
tree | 62a36bf13e95aeb90982314c4943a29b289e60ee /contrib/llvm/patches | |
parent | 1e024675bcd5e4ace8bffb2dd6afd3fa8b8ad7f3 (diff) | |
parent | 88c4104dd7fac3a58708a6de5dcd21610a7f0316 (diff) | |
download | FreeBSD-src-9bd5a747dd2c968d97a8932065fb94723bbeae9c.zip FreeBSD-src-9bd5a747dd2c968d97a8932065fb94723bbeae9c.tar.gz |
Merge ^/head r279023 through r279162.
Diffstat (limited to 'contrib/llvm/patches')
-rw-r--r-- | contrib/llvm/patches/patch-08-llvm-r230058-indirectbrs-assert.diff | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-08-llvm-r230058-indirectbrs-assert.diff b/contrib/llvm/patches/patch-08-llvm-r230058-indirectbrs-assert.diff new file mode 100644 index 0000000..f3e0112 --- /dev/null +++ b/contrib/llvm/patches/patch-08-llvm-r230058-indirectbrs-assert.diff @@ -0,0 +1,55 @@ +Pull in r230058 from upstream llvm trunk (by Benjamin Kramer): + + LoopRotate: When reconstructing loop simplify form don't split edges + from indirectbrs. + + Yet another chapter in the endless story. While this looks like we + leave the loop in a non-canonical state this replicates the logic in + LoopSimplify so it doesn't diverge from the canonical form in any way. + + PR21968 + +This fixes a "Cannot split critical edge from IndirectBrInst" assertion +failure when building the devel/radare2 port. + +Introduced here: https://svnweb.freebsd.org/changeset/base/279161 + +Index: lib/Transforms/Scalar/LoopRotation.cpp +=================================================================== +--- lib/Transforms/Scalar/LoopRotation.cpp ++++ lib/Transforms/Scalar/LoopRotation.cpp +@@ -498,6 +498,8 @@ bool LoopRotate::rotateLoop(Loop *L, bool Simplifi + Loop *PredLoop = LI->getLoopFor(*PI); + if (!PredLoop || PredLoop->contains(Exit)) + continue; ++ if (isa<IndirectBrInst>((*PI)->getTerminator())) ++ continue; + SplitLatchEdge |= L->getLoopLatch() == *PI; + BasicBlock *ExitSplit = SplitCriticalEdge(*PI, Exit, this); + ExitSplit->moveBefore(Exit); +Index: test/Transforms/LoopRotate/crash.ll +=================================================================== +--- test/Transforms/LoopRotate/crash.ll ++++ test/Transforms/LoopRotate/crash.ll +@@ -153,3 +153,21 @@ entry: + "5": ; preds = %"3", %entry + ret void + } ++ ++; PR21968 ++define void @test8(i1 %C, i8* %P) #0 { ++entry: ++ br label %for.cond ++ ++for.cond: ; preds = %for.inc, %entry ++ br i1 %C, label %l_bad, label %for.body ++ ++for.body: ; preds = %for.cond ++ indirectbr i8* %P, [label %for.inc, label %l_bad] ++ ++for.inc: ; preds = %for.body ++ br label %for.cond ++ ++l_bad: ; preds = %for.body, %for.cond ++ ret void ++} |