[llvm] [SandboxIR] Add ShuffleVectorInst (PR #104891)
Jorge Gorbe Moya via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 21 10:18:45 PDT 2024
================
@@ -739,6 +740,401 @@ define void @foo(i8 %v0, i8 %v1, <2 x i8> %vec) {
llvm::InsertElementInst::isValidOperands(LLVMArg0, LLVMArgVec, LLVMZero));
}
+TEST_F(SandboxIRTest, ShuffleVectorInst) {
+ parseIR(C, R"IR(
+define void @foo(<2 x i8> %v1, <2 x i8> %v2) {
+ %ins0 = shufflevector <2 x i8> %v1, <2 x i8> %v2, <2 x i32> <i32 0, i32 2>
+ ret void
+}
+)IR");
+ Function &LLVMF = *M->getFunction("foo");
+ sandboxir::Context Ctx(C);
+ auto &F = *Ctx.createFunction(&LLVMF);
+ auto *ArgV1 = F.getArg(0);
+ auto *ArgV2 = F.getArg(1);
+ auto *BB = &*F.begin();
+ auto It = BB->begin();
+ auto *SI = cast<sandboxir::ShuffleVectorInst>(&*It++);
----------------
slackito wrote:
I've done some grepping and `SI` is also used for `SwitchInst`, `SelectInst`, `SectionInfo`, `StandardInstrumentations` and some others. None of these in sight in the scope of this variable, FWIW.
`SVI` seems like a more common abbreviation, so I'll change it to that.
https://github.com/llvm/llvm-project/pull/104891
More information about the llvm-commits
mailing list