Issue 63851
Summary memcpyopt fails with Assertion `Parent == Other->Parent && "cross-BB instruction order comparison"' failed.
Labels new issue
Assignees
Reporter serge-sans-paille
    While compiling firefox with clang from 253a52988fe37887ba1f7741271d602083fe7dd7 , I hit an assert.

The following (reduced) test case fails on `opt '-passes=early-cse,memcpyopt' -S cross-block.ll`  where `cross-block.ll` contains

```llvm
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

define void @test_case(ptr %this, ptr %aFrame, i1 %call14) unnamed_addr {
entry:
  %r = alloca %struct.nsRect
  %ref.tmp18 = alloca %struct.nsRect
  %x = getelementptr inbounds %struct.nsRect, ptr %r, i32 0, i32 0
  store i32 0, ptr %x
  br i1 %call14, label %if.then17, label %if.end21

if.then17:
  call void @fwd_decl(ptr %ref.tmp18, ptr %r)
  call void @llvm.memcpy.p0.p0.i64(ptr %r, ptr %ref.tmp18, i64 16, i1 false)
  br label %if.end21

if.end21:
  ret void
}

declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg)

declare hidden void @fwd_decl(ptr, ptr )
```

I couldn't remove the `ealy-cse` pass :-/
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to