Skip to content

Commit be39dca

Browse files
committed
Define the behavior if passed param is VP intrinsic.
1 parent 165f0bc commit be39dca

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

llvm/include/llvm/IR/IntrinsicInst.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,9 @@ class VPIntrinsic : public IntrinsicInst {
569569
/// The llvm.vp.* intrinsics for this instruction Opcode
570570
static Intrinsic::ID getForOpcode(unsigned OC);
571571

572-
/// The llvm.vp.* intrinsics for this intrinsic ID.
573-
static Intrinsic::ID getForIntrinsic(Intrinsic::ID);
572+
/// The llvm.vp.* intrinsics for this intrinsic ID \p Id. Return \p Id if it
573+
/// is already a VP intrinsic.
574+
static Intrinsic::ID getForIntrinsic(Intrinsic::ID Id);
574575

575576
// Whether \p ID is a VP intrinsic ID.
576577
static bool isVPIntrinsic(Intrinsic::ID);

llvm/lib/IR/IntrinsicInst.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,9 @@ Intrinsic::ID VPIntrinsic::getForOpcode(unsigned IROPC) {
600600
}
601601

602602
Intrinsic::ID VPIntrinsic::getForIntrinsic(Intrinsic::ID Id) {
603+
if (isVPIntrinsic(Id))
604+
return Id;
605+
603606
switch (Id) {
604607
default:
605608
break;

0 commit comments

Comments
 (0)