This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add necessary check isReg() when updating LiveVariables in convertToThreeAddress
ClosedPublic

Authored by yubing on Nov 3 2022, 11:21 PM.

Diff Detail

Event Timeline

yubing created this revision.Nov 3 2022, 11:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 11:21 PM
yubing requested review of this revision.Nov 3 2022, 11:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2022, 11:21 PM
yubing added a reviewer: foad.Nov 3 2022, 11:21 PM

I found my reproducer can't work for llvm-project's code.
could we merge it without adding a testcase?

RKSimon added inline comments.Nov 4 2022, 9:25 AM
llvm/lib/Target/X86/X86InstrInfo.cpp
1772

By inspection - the getReg below will assert if its isn't a register so this should be OK.

@foad might have a suggestion regarding alternative ways to test though?

foad added inline comments.Nov 4 2022, 9:31 AM
llvm/lib/Target/X86/X86InstrInfo.cpp
1772

The instruction that @yubing cited in D136596 was: %22:vr512 = VPBROADCASTDZrmk %21:vr512(tied-def 0), killed %20:vk16wm, %stack.1, 1, $noreg, 0, $noreg :: (load (s32) from %stack.1, align 64)

So I guess maybe any of these *rmk instructions handled at line 1690 could have an operand that is %stack.n instead of a register?

No success in creating a mir test?

No success in creating a mir test?

yeah, i may not have time to create a reproducer.

RKSimon accepted this revision.Nov 10 2022, 2:07 AM

LGTM - by inspection this works to avoid the assert

This revision is now accepted and ready to land.Nov 10 2022, 2:07 AM