mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 23:18:51 +00:00
3a4fa31d34
Differential Revision: https://reviews.llvm.org/D22648 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276349 91177308-0d34-0410-b5e6-96231b3b80d8
16 lines
485 B
LLVM
16 lines
485 B
LLVM
; RUN: opt < %s -nary-reassociate -S | FileCheck %s
|
|
; RUN: opt < %s -passes='nary-reassociate' -S | FileCheck %s
|
|
|
|
define i32 @foo(i32 %tmp4) {
|
|
; CHECK-LABEL: @foo(
|
|
entry:
|
|
%tmp5 = add i32 %tmp4, 8
|
|
%tmp13 = add i32 %tmp4, -128 ; deleted
|
|
%tmp14 = add i32 %tmp13, 8 ; => %tmp5 + -128
|
|
%tmp21 = add i32 119, %tmp4
|
|
; do not rewrite %tmp23 against %tmp13 because %tmp13 is already deleted
|
|
%tmp23 = add i32 %tmp21, -128
|
|
; CHECK: %tmp23 = add i32 %tmp21, -128
|
|
ret i32 %tmp23
|
|
}
|