mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
analysis. We're already using TTI in SimplifyCFG, so remove the hard-baked "cheapness" heuristic and use TTI directly. Generally NFC intended, but we're using a slightly different heuristic now so there is a slight test churn. Test changes: * combine-comparisons-by-cse.ll: Removed unneeded branch check. * 2014-08-04-muls-it.ll: Test now doesn't branch but emits muleq. * coalesce-subregs.ll: Superfluous block check. * 2008-01-02-hoist-fp-add.ll: fadd is safe to speculate. Change to udiv. * PhiBlockMerge.ll: Superfluous CFG checking code. Main checks still present. * select-gep.ll: A variable GEP is not expensive, just TCC_Basic, according to the TTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228826 91177308-0d34-0410-b5e6-96231b3b80d8
24 lines
620 B
LLVM
24 lines
620 B
LLVM
; RUN: llc -mtriple thumbv7-eabi -arm-restrict-it -filetype asm -o - %s \
|
|
; RUN: | FileCheck %s
|
|
|
|
define arm_aapcscc i32 @function(i32 %i, i32 %j) {
|
|
entry:
|
|
%cmp = icmp eq i32 %i, %j
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
if.then: ; preds = %entry
|
|
%mul = mul nsw i32 %i, %i
|
|
br label %if.end
|
|
|
|
if.end: ; preds = %if.then, %entry
|
|
%i.addr.0 = phi i32 [ %mul, %if.then ], [ %i, %entry ]
|
|
ret i32 %i.addr.0
|
|
}
|
|
|
|
; CHECK-LABEL: function
|
|
; CHECK: cmp r0, r1
|
|
; CHECK-NOT: mulseq r0, r0, r0
|
|
; CHECK: muleq r0, r0, r0
|
|
; CHECK: bx lr
|
|
|