From ef307b8c262735dafd69b6acf5a11456c83d1473 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Thu, 20 Dec 2018 18:49:09 +0000 Subject: [LAA] Avoid generating RT checks for known deps preventing vectorization. If we found unsafe dependences other than 'unknown', we already know at compile time that they are unsafe and the runtime checks should always fail. So we can avoid generating them in those cases. This should have no negative impact on performance as the runtime checks that would be created previously should always fail. As a sanity check, I measured the test-suite, spec2k and spec2k6 and there were no regressions. Reviewers: Ayal, anemet, hsaito Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D55798 llvm-svn: 349794 --- llvm/test/Transforms/LoopVectorize/runtime-check.ll | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/test/Transforms') diff --git a/llvm/test/Transforms/LoopVectorize/runtime-check.ll b/llvm/test/Transforms/LoopVectorize/runtime-check.ll index 19bfa50f769..332e3efb65d 100644 --- a/llvm/test/Transforms/LoopVectorize/runtime-check.ll +++ b/llvm/test/Transforms/LoopVectorize/runtime-check.ll @@ -117,7 +117,9 @@ loopexit: ret void } -; Check we do generate unnecessary runtime checks. They will always fail. +; Check we do not generate runtime checks if we found a known dependence preventing +; vectorization. In this case, it is a read of c[i-1] followed by a write of c[i]. +; The runtime checks would always fail. ; void test_runtime_check2(float *a, float b, unsigned offset, unsigned offset2, unsigned n, float *c) { ; for (unsigned i = 1; i < n; i++) { @@ -127,7 +129,7 @@ loopexit: ; } ; ; CHECK-LABEL: test_runtime_check2 -; CHECK: <4 x float> +; CHECK-NOT: <4 x float> define void @test_runtime_check2(float* %a, float %b, i64 %offset, i64 %offset2, i64 %n, float* %c) { entry: br label %for.body -- cgit v1.2.3