mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Split up subtracts into add+negate if they have a reassociable use or operand
that is also a subtract. This implements PR2047 and Transforms/Reassociate/subtest2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47241 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
13
test/Transforms/Reassociate/subtest2.ll
Normal file
13
test/Transforms/Reassociate/subtest2.ll
Normal file
@@ -0,0 +1,13 @@
|
||||
; With sub reassociation, constant folding can eliminate the uses of %a.
|
||||
;
|
||||
; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep %a | count 1
|
||||
; PR2047
|
||||
|
||||
define i32 @test(i32 %a, i32 %b, i32 %c) nounwind {
|
||||
entry:
|
||||
%tmp3 = sub i32 %a, %b ; <i32> [#uses=1]
|
||||
%tmp5 = sub i32 %tmp3, %c ; <i32> [#uses=1]
|
||||
%tmp7 = sub i32 %tmp5, %a ; <i32> [#uses=1]
|
||||
ret i32 %tmp7
|
||||
}
|
||||
|
Reference in New Issue
Block a user