mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
4de471dd0a
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
22 lines
491 B
LLVM
22 lines
491 B
LLVM
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
|
|
|
%ST = type { i8, i8 }
|
|
|
|
define i8* @test1(%ST* %x, i8* %y) nounwind {
|
|
entry:
|
|
%cmp = icmp eq %ST* %x, null
|
|
br i1 %cmp, label %if.then, label %if.end
|
|
|
|
if.then:
|
|
%incdec.ptr = getelementptr %ST* %x, i32 0, i32 1
|
|
br label %if.end
|
|
|
|
if.end:
|
|
%x.addr = phi i8* [ %incdec.ptr, %if.then ], [ %y, %entry ]
|
|
ret i8* %x.addr
|
|
|
|
; CHECK-LABEL: @test1(
|
|
; CHECK: %incdec.ptr.y = select i1 %cmp, i8* %incdec.ptr, i8* %y
|
|
; CHECK: ret i8* %incdec.ptr.y
|
|
}
|