This is an archive of the discontinued LLVM Phabricator instance.

[X86][LWP] Add llvm support for LWP instructions.
ClosedPublic

Authored by RKSimon on May 2 2017, 4:17 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper added inline comments.May 2 2017, 10:45 PM
test/CodeGen/X86/lwp-intrinsics-x86_64.ll
15

That immediate seems way out of range of 32-bit value. Is that intentional?

RKSimon added inline comments.May 3 2017, 2:29 AM
test/CodeGen/X86/lwp-intrinsics-x86_64.ll
15

Yes, I was trying to check that it truncated correctly. Should I comment it? Add it as a separate test?

filcab added inline comments.May 3 2017, 2:45 AM
lib/Target/X86/X86ISelLowering.cpp
20297

Can you split this refactor, please?

test/CodeGen/X86/lwp-intrinsics-x86_64.ll
15

I'm not sure this is useful, does it even make it past the IR reader?
Truncating a too large constant seems like it should be tested somewhere else.

RKSimon added inline comments.May 3 2017, 3:35 AM
test/CodeGen/X86/lwp-intrinsics-x86_64.ll
15

OK, I'll strip them down.

RKSimon updated this revision to Diff 97595.May 3 2017, 4:10 AM

Rebased and removed implicit truncation from tests' immediate value arguments

andreadb edited edge metadata.May 3 2017, 4:11 AM

I noticed that according to X86GenInstrInfo.inc, the new LWPINS instructions don't have "UnmodeledSideEffects".
However, all the other LWP instructions have flag UnmodeledSideEffects set.
My understanding is that this is because LWPVAL/LLWPCB/SLWPCB are directly matched from x86 intrinsics with side effects, while LWPINS* are firstly lowered to X86ISD::LWPINS nodes.

Shouldn't we set hasSideEffects = 1 for the LWPINS variants too? After all, those instructions modify memory by pushing new events in the ring buffer. So, those can both read and write.

I noticed that according to X86GenInstrInfo.inc, the new LWPINS instructions don't have "UnmodeledSideEffects".
However, all the other LWP instructions have flag UnmodeledSideEffects set.
My understanding is that this is because LWPVAL/LLWPCB/SLWPCB are directly matched from x86 intrinsics with side effects, while LWPINS* are firstly lowered to X86ISD::LWPINS nodes.

Shouldn't we set hasSideEffects = 1 for the LWPINS variants too? After all, those instructions modify memory by pushing new events in the ring buffer. So, those can both read and write.

I think I just need to add SDNPSideEffect to X86lwpins.

RKSimon updated this revision to Diff 97629.May 3 2017, 6:53 AM

Fixed lwpins sideffects issue and added disassembler tests

andreadb accepted this revision.May 3 2017, 6:59 AM

LGTM. Thanks!

This revision is now accepted and ready to land.May 3 2017, 6:59 AM
This revision was automatically updated to reflect the committed changes.