mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-10 22:46:20 +00:00
7a1e93493d
Summary: ValueTracking used to overwrite the analysis results computed from assumes and dominating conditions. This patch fixes this issue. Test Plan: test/Analysis/ValueTracking/assume.ll Reviewers: hfinkel, majnemer Reviewed By: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10283 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239718 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
339 B
LLVM
15 lines
339 B
LLVM
; RUN: opt < %s -instcombine -S | FileCheck %s
|
|
|
|
define i32 @assume_add(i32 %a, i32 %b) {
|
|
; CHECK-LABEL: @assume_add(
|
|
%1 = add i32 %a, %b
|
|
%last_two_digits = and i32 %1, 3
|
|
%2 = icmp eq i32 %last_two_digits, 0
|
|
call void @llvm.assume(i1 %2)
|
|
%3 = add i32 %1, 3
|
|
; CHECK: %3 = or i32 %1, 3
|
|
ret i32 %3
|
|
}
|
|
|
|
declare void @llvm.assume(i1)
|