[llvm] [InstCombine] Implement vp.reverse elimination through binop/unop (PR #143963)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 16:58:50 PDT 2025
================
@@ -3582,6 +3582,42 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
}
break;
}
+ case Intrinsic::experimental_vp_reverse: {
+ Value *BO0, *BO1, *X, *Y;
+ Value *Vec = II->getArgOperand(0);
+ Value *Mask = II->getArgOperand(1);
+ Value *EVL = II->getArgOperand(2);
+ auto m_VPReverse = [&](Value *&Vec) {
+ return m_Intrinsic<Intrinsic::experimental_vp_reverse>(
+ m_Value(Vec), m_Specific(Mask), m_Specific(EVL));
----------------
topperc wrote:
The mask is kind of weird. The inner vp.reverse would poison any elements where the mask is 0. The mask of the outer vp.reverse would need to be the reverse of the inner mask to not consume the poison elements.
https://github.com/llvm/llvm-project/pull/143963
More information about the llvm-commits
mailing list