diff options
author | Simon Moll <simon.moll@emea.nec.com> | 2021-04-30 13:43:48 +0200 |
---|---|---|
committer | Simon Moll <simon.moll@emea.nec.com> | 2021-05-04 11:47:52 +0200 |
commit | 1db4dbba24dd36bd5a91ed58bd9d92dce2060c9f (patch) | |
tree | 8ad31058cc5ff067f6e36f0974559936473dcbc1 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | f800ac8309417b78c084f2eabfd54d43a66b64a2 (diff) | |
download | llvm-1db4dbba24dd36bd5a91ed58bd9d92dce2060c9f.zip llvm-1db4dbba24dd36bd5a91ed58bd9d92dce2060c9f.tar.gz llvm-1db4dbba24dd36bd5a91ed58bd9d92dce2060c9f.tar.bz2 |
Recommit "[VP,Integer,#2] ExpandVectorPredication pass"
This reverts the revert 02c5ba8679873e878ae7a76fb26808a47940275b
Fix:
Pass was registered as DUMMY_FUNCTION_PASS causing the newpm-pass
functions to be doubly defined. Triggered in -DLLVM_ENABLE_MODULE=1
builds.
Original commit:
This patch implements expansion of llvm.vp.* intrinsics
(https://llvm.org/docs/LangRef.html#vector-predication-intrinsics).
VP expansion is required for targets that do not implement VP code
generation. Since expansion is controllable with TTI, targets can switch
on the VP intrinsics they do support in their backend offering a smooth
transition strategy for VP code generation (VE, RISC-V V, ARM SVE,
AVX512, ..).
Reviewed By: rogfer01
Differential Revision: https://reviews.llvm.org/D78203
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 14b8732..2dd8c98 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -262,6 +262,11 @@ Value *VPIntrinsic::getMaskParam() const { return nullptr; } +void VPIntrinsic::setMaskParam(Value *NewMask) { + auto MaskPos = GetMaskParamPos(getIntrinsicID()); + setArgOperand(*MaskPos, NewMask); +} + Value *VPIntrinsic::getVectorLengthParam() const { auto vlenPos = GetVectorLengthParamPos(getIntrinsicID()); if (vlenPos) @@ -269,6 +274,11 @@ Value *VPIntrinsic::getVectorLengthParam() const { return nullptr; } +void VPIntrinsic::setVectorLengthParam(Value *NewEVL) { + auto EVLPos = GetVectorLengthParamPos(getIntrinsicID()); + setArgOperand(*EVLPos, NewEVL); +} + Optional<int> VPIntrinsic::GetMaskParamPos(Intrinsic::ID IntrinsicID) { switch (IntrinsicID) { default: |