mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-24 21:42:54 +02:00
98a3974775
Summary: In the benchmark (https://github.com/vetter/shoc) we are researching, the duplicated load is not eliminated because MemoryDependenceAnalysis hit the BlockScanLimit. This patch change it into a command line option instead of a hardcoded value. Patched by Xuetian Weng. Test Plan: test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll Reviewers: jingyue, reames Subscribers: reames, llvm-commits Differential Revision: http://reviews.llvm.org/D11366 llvm-svn: 242842
16 lines
427 B
LLVM
16 lines
427 B
LLVM
; RUN: opt -S -memdep -gvn -basicaa < %s | FileCheck %s
|
|
; RUN: opt -S -memdep -memdep-block-scan-limit=1 -gvn -basicaa < %s | FileCheck %s --check-prefix=WITH-LIMIT
|
|
; CHECK-LABEL: @test(
|
|
; CHECK: load
|
|
; CHECK-NOT: load
|
|
; WITH-LIMIT-LABEL: @test(
|
|
; WITH-LIMIT-CHECK: load
|
|
; WITH-LIMIT-CHECK: load
|
|
define i32 @test(i32* %p) {
|
|
%1 = load i32, i32* %p
|
|
%2 = add i32 %1, 3
|
|
%3 = load i32, i32* %p
|
|
%4 = add i32 %2, %3
|
|
ret i32 %4
|
|
}
|