llvm-mirror/test/CodeGen/X86/foldmem_cycle.ll
Nirav Dave 8f7ea6d7d0 [DAG, X86] Improve Dependency analysis when doing multi-node
Instruction Selection

Cleanup cycle/validity checks in ISel (IsLegalToFold,
HandleMergeInputChains) and X86 (isFusableLoadOpStore). Now do a full
search for cycles / dependencies pruning the search when topological
property of NodeId allows.

As part of this propogate the NodeId-based cutoffs to narrow
hasPreprocessorHelper searches.

Reviewers: craig.topper, bogner

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D41293

llvm-svn: 324359
2018-02-06 16:14:29 +00:00

35 lines
877 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s --check-prefix=X64
; The load should not be merged with the and asit causes a cycle in the DAG.
define void @foo() {
; X64-LABEL: foo:
; X64: # %bb.0: # %entry
; X64-NEXT: pushq %rbx
; X64-NEXT: .cfi_def_cfa_offset 16
; X64-NEXT: .cfi_offset %rbx, -16
; X64-NEXT: movl (%rax), %ebx
; X64-NEXT: callq bar
; X64-NEXT: testl %ebx, %eax
; X64-NEXT: jne .LBB0_2
; X64-NEXT: # %bb.1: # %if.then
; X64-NEXT: popq %rbx
; X64-NEXT: retq
; X64-NEXT: .LBB0_2: # %if.end
entry:
%0 = load i32, i32* undef
%call = tail call i32 @bar()
%and = and i32 %call, %0
%tobool = icmp eq i32 %and, 0
br i1 %tobool, label %if.then, label %if.end
if.then:
ret void
if.end:
unreachable
}
declare i32 @bar()