This is an archive of the discontinued LLVM Phabricator instance.

[VE] Correct LVLGen (LVL instruction insert pass)
ClosedPublic

Authored by kaz7 on Dec 4 2020, 11:55 PM.

Details

Summary

SX Aurora VE uses an intermediate representation similar to VP as its MIR.
VE itself uses invidiual VL register as its own vector length register at
the hardware level. So, LLVM needs to insert load VL (LVL) instruction just
before vector instructions if the value of VL is changed. This LVLGen pass
generates LVL instructions for such purpose. Previously, a bug is pointed
out in D91416. This patch correct this bug and add a regression test.

Diff Detail

Event Timeline

kaz7 created this revision.Dec 4 2020, 11:55 PM
kaz7 requested review of this revision.Dec 4 2020, 11:55 PM
craig.topper added inline comments.Dec 5 2020, 1:33 AM
llvm/lib/Target/VE/LVLGen.cpp
55

getReg will assert this internally. Is this just to get a better error message?

77

regsiters->registers

98

This almost repeats the debug message but says "previous" instead of "current".

108

Is "killed" the right word to use here now?

kaz7 planned changes to this revision.Dec 5 2020, 2:19 AM

Updates.

llvm/lib/Target/VE/LVLGen.cpp
55

This is not a really better error message. I'll remove this assertion. Thanks.

77

Will do. Thanks.

98

That's truth. I'll remove comment.

108

Probablly, need to be updated is much better I think.

I was checking other implementations, and I noticed that I needed to check not only definesRegister but also modifiesRegister.

kaz7 updated this revision to Diff 309724.Dec 5 2020, 2:28 AM

Update following suggestions. Thank you so much.

simoll added a comment.Dec 8 2020, 1:20 AM

@craig.topper does this LGTM to you?

This revision is now accepted and ready to land.Dec 8 2020, 10:01 AM
This revision was landed with ongoing or failed builds.Dec 8 2020, 1:34 PM
This revision was automatically updated to reflect the committed changes.