mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-25 14:32:53 +00:00
3e84ad28d4
Previously, the DAGISel function WalkChainUsers was spotting that it had entered already-selected territory by whether a node was a MachineNode (amongst other things). Since it's fairly common practice to insert MachineNodes during ISelLowering, this was not the correct check. Looking around, it seems that other nodes get their NodeId set to -1 upon selection, so this makes sure the same thing happens to all MachineNodes and uses that characteristic to determine whether we should stop looking for a loop during selection. This should fix PR15840. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191165 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
888 B
LLVM
35 lines
888 B
LLVM
; RUN: llc < %s -mtriple=i686-linux -mattr=-sse | FileCheck %s
|
|
; PR11768
|
|
|
|
@ptr = external global i8*
|
|
|
|
define void @baz() nounwind ssp {
|
|
entry:
|
|
%0 = load i8** @ptr, align 4
|
|
%cmp = icmp eq i8* %0, null
|
|
fence seq_cst
|
|
br i1 %cmp, label %if.then, label %if.else
|
|
|
|
; Make sure the fence comes before the comparison, since it
|
|
; clobbers EFLAGS.
|
|
|
|
; CHECK: lock
|
|
; CHECK-NEXT: orl {{.*}}, (%esp)
|
|
; CHECK-NEXT: testl [[REG:%e[a-z]+]], [[REG]]
|
|
|
|
if.then: ; preds = %entry
|
|
tail call void bitcast (void (...)* @foo to void ()*)() nounwind
|
|
br label %if.end
|
|
|
|
if.else: ; preds = %entry
|
|
tail call void bitcast (void (...)* @bar to void ()*)() nounwind
|
|
br label %if.end
|
|
|
|
if.end: ; preds = %if.else, %if.then
|
|
ret void
|
|
}
|
|
|
|
declare void @foo(...)
|
|
|
|
declare void @bar(...)
|