After land D136362, we found that:
On Loongarch, g++ is killed by the OOM-killer due to using too many resources, while clang++ is not.
I suspect the cause is that g++ tries to instantiate these generic lambdas inside std::visit(), which consumes N^2 the size memory when there's nested-std::visit()
It could cause a potential build error since the RISCVInst contains more and more Insts. (It means N will increase.)
So I tried to overload operator== to replace use std::visit(), here are my codes and results.