[VE] Correct LVLGen (LVL instruction insert pass)
authorKazushi (Jam) Marukawa <marukawa@nec.com>
Sat, 5 Dec 2020 07:53:39 +0000 (16:53 +0900)
committerKazushi (Jam) Marukawa <marukawa@nec.com>
Tue, 8 Dec 2020 21:33:53 +0000 (06:33 +0900)
commit95ea50e4adf76b75fcc0ad29cacd10642db091a6
treeeb69a3eeaef751c7ab2a81b0c3f80e8ba988df0e
parent85c18d3521e87a22c742be512245665d6bb5bfe2
[VE] Correct LVLGen (LVL instruction insert pass)

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.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D92716
llvm/lib/Target/VE/LVLGen.cpp
llvm/test/CodeGen/VE/VELIntrinsics/lvlgen.ll