diff options
author | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-06-23 14:31:31 +0000 |
---|---|---|
committer | Michael Zolotukhin <mzolotukhin@apple.com> | 2016-06-23 14:31:31 +0000 |
commit | 2d3592d481716a095291acf960c5ff381fe667a6 (patch) | |
tree | cf8784ed5aa38038c795641fa3ff8f7ad3e83124 /llvm/test/Transforms/LoopUnroll | |
parent | a852d695b8919771b35d196221a063a8f974353f (diff) | |
download | bcm5719-llvm-2d3592d481716a095291acf960c5ff381fe667a6.tar.gz bcm5719-llvm-2d3592d481716a095291acf960c5ff381fe667a6.zip |
[LoopUnrollAnalyzer] Fix a bug in UnrolledInstAnalyzer::visitLoad.
When simplifying a load we need to make sure that the type of the
simplified value matches the type of the instruction we're processing.
In theory, we can handle casts here as we deal with constant data, but
since it's not implemented at the moment, we at least need to bail out.
This fixes PR28262.
llvm-svn: 273562
Diffstat (limited to 'llvm/test/Transforms/LoopUnroll')
-rw-r--r-- | llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll b/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll index 54f0f817695..f5c7734de96 100644 --- a/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll +++ b/llvm/test/Transforms/LoopUnroll/full-unroll-crashers.ll @@ -204,3 +204,21 @@ for.body: for.end: ret void } + +define void @load_type_mismatch() { +entry: + br label %for.body + +for.body: + %iv.0 = phi i64 [ 0, %entry ], [ %iv.1, %for.body ] + %arrayidx1 = getelementptr inbounds [10 x i32], [10 x i32]* @known_constant, i64 0, i64 %iv.0 + %bc = bitcast i32* %arrayidx1 to i64* + %x1 = load i64, i64* %bc, align 4 + %x2 = add i64 10, %x1 + %iv.1 = add nuw nsw i64 %iv.0, 1 + %exitcond = icmp eq i64 %iv.1, 10 + br i1 %exitcond, label %for.end, label %for.body + +for.end: + ret void +} |