Implementing llvm.memory.barrier on PowerPC

Hi all,

I'm trying to implement llvm.memory.barrier on PowerPC. I've modelled
my patch (attached) on the implementation in X86, but when I try and
compile my test file (also attached) with llc I get the error "Cannot
yet select: 0x10fa4ad0: ch = MemBarrier 0x10fa4828, 0x10fa4c68,
0x10fa4be0, 0x10fa4be0, 0x10fa4be0, 0x10fa4be0". This presumably
means my "membarrier" pattern isn't being found... but why?

Thanks in advance,
Gary

memory-barrier.patch (2.13 KB)

test.bc (236 Bytes)

Hi all,

I'm trying to implement llvm.memory.barrier on PowerPC. I've modelled
my patch (attached) on the implementation in X86, but when I try and
compile my test file (also attached) with llc I get the error "Cannot
yet select: 0x10fa4ad0: ch = MemBarrier 0x10fa4828, 0x10fa4c68,
0x10fa4be0, 0x10fa4be0, 0x10fa4be0, 0x10fa4be0". This presumably
means my "membarrier" pattern isn't being found... but why?

Thanks in advance,
Gary

Because the i1's in the .bc file get promoted to i32 on ppc, instead of i8.
I've forgotten why this is, there's a setting somewhere. If you change the
i8's in membarrier to i32's it works.
Thanks for doing this btw.

memory-barrier.patch (2.13 KB)

test.bc (236 Bytes)

Dale Johannesen wrote:

> I'm trying to implement llvm.memory.barrier on PowerPC. I've
> modelled my patch (attached) on the implementation in X86, but
> when I try and compile my test file (also attached) with llc I
> get the error "Cannot yet select: 0x10fa4ad0: ch = MemBarrier
> 0x10fa4828, 0x10fa4c68, 0x10fa4be0, 0x10fa4be0, 0x10fa4be0,
> 0x10fa4be0". This presumably means my "membarrier" pattern
> isn't being found... but why?

Because the i1's in the .bc file get promoted to i32 on ppc,
instead of i8. I've forgotten why this is, there's a setting
somewhere. If you change the i8's in membarrier to i32's it
works.

Thanks for that. Attached is a working implementation of
llvm.memory.barrier.

Thanks for doing this btw.

No problem, I need it! :wink:

Cheers,
Gary

memory-barrier-take2.patch (2.95 KB)

This looks OK to check in, do you have write access?

memory-barrier-take2.patch (2.95 KB)

No, I don't.

Cheers,
Gary

Dale Johannesen wrote:

I think Gary should have it. :slight_smile: Please contact Chris about it.

Thanks,

Evan

OK, I've checked it in for you, thanks. Please do contact Chris about write access.

Thanks. One thing though, who's Chris?

Cheers,
Gary

Dale Johannesen wrote:

Thanks. One thing though, who's Chris?

Me :slight_smile:

I'll follow up offline, thanks Gary,

-Chris