-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[IVDescriptor][LV] Return Instruction::Or for IAnyOf/FAnyOf in getOpcode(), nfc #140242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-llvm-transforms @llvm/pr-subscribers-vectorizers Author: Mel Chen (Mel-Chen) ChangesFull diff: https://github.com/llvm/llvm-project/pull/140242.diff 2 Files Affected:
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index a216b0347b9fa..a273338670164 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -1154,6 +1154,8 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
return Instruction::Add;
case RecurKind::Mul:
return Instruction::Mul;
+ case RecurKind::IAnyOf:
+ case RecurKind::FAnyOf:
case RecurKind::Or:
return Instruction::Or;
case RecurKind::And:
@@ -1169,7 +1171,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
case RecurKind::SMin:
case RecurKind::UMax:
case RecurKind::UMin:
- case RecurKind::IAnyOf:
case RecurKind::IFindLastIV:
return Instruction::ICmp;
case RecurKind::FMax:
@@ -1178,7 +1179,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
case RecurKind::FMinimum:
case RecurKind::FMaximumNum:
case RecurKind::FMinimumNum:
- case RecurKind::FAnyOf:
case RecurKind::FFindLastIV:
return Instruction::FCmp;
default:
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index fc1ee89e81c75..f77bd8c3c7713 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -679,9 +679,6 @@ Value *VPInstruction::generate(VPTransformState &State) {
// Reduce all of the unrolled parts into a single vector.
Value *ReducedPartRdx = RdxParts[0];
unsigned Op = RdxDesc.getOpcode();
- if (RecurrenceDescriptor::isAnyOfRecurrenceKind(RK))
- Op = Instruction::Or;
-
if (PhiR->isOrdered()) {
ReducedPartRdx = RdxParts[UF - 1];
} else {
|
@llvm/pr-subscribers-llvm-analysis Author: Mel Chen (Mel-Chen) ChangesFull diff: https://github.com/llvm/llvm-project/pull/140242.diff 2 Files Affected:
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index a216b0347b9fa..a273338670164 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -1154,6 +1154,8 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
return Instruction::Add;
case RecurKind::Mul:
return Instruction::Mul;
+ case RecurKind::IAnyOf:
+ case RecurKind::FAnyOf:
case RecurKind::Or:
return Instruction::Or;
case RecurKind::And:
@@ -1169,7 +1171,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
case RecurKind::SMin:
case RecurKind::UMax:
case RecurKind::UMin:
- case RecurKind::IAnyOf:
case RecurKind::IFindLastIV:
return Instruction::ICmp;
case RecurKind::FMax:
@@ -1178,7 +1179,6 @@ unsigned RecurrenceDescriptor::getOpcode(RecurKind Kind) {
case RecurKind::FMinimum:
case RecurKind::FMaximumNum:
case RecurKind::FMinimumNum:
- case RecurKind::FAnyOf:
case RecurKind::FFindLastIV:
return Instruction::FCmp;
default:
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index fc1ee89e81c75..f77bd8c3c7713 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -679,9 +679,6 @@ Value *VPInstruction::generate(VPTransformState &State) {
// Reduce all of the unrolled parts into a single vector.
Value *ReducedPartRdx = RdxParts[0];
unsigned Op = RdxDesc.getOpcode();
- if (RecurrenceDescriptor::isAnyOfRecurrenceKind(RK))
- Op = Instruction::Or;
-
if (PhiR->isOrdered()) {
ReducedPartRdx = RdxParts[UF - 1];
} else {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
cc312b7
to
936886e
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/11551 Here is the relevant piece of the build log for the reference
|
…ctionResult, nfc (#140245) When reducing unrolled parts, explicitly check for min/max reductions using the function RecurrenceDescriptor::isMinMaxRecurrenceKind. Only if the reduction is not min/max reduction, call RecurrenceDescriptor::getOpcode() to handle other cases via CreateBinOp. Based on #140242 Related to #118393
…ComputeReductionResult, nfc (#140245) When reducing unrolled parts, explicitly check for min/max reductions using the function RecurrenceDescriptor::isMinMaxRecurrenceKind. Only if the reduction is not min/max reduction, call RecurrenceDescriptor::getOpcode() to handle other cases via CreateBinOp. Based on llvm/llvm-project#140242 Related to llvm/llvm-project#118393
…ctionResult, nfc (llvm#140245) When reducing unrolled parts, explicitly check for min/max reductions using the function RecurrenceDescriptor::isMinMaxRecurrenceKind. Only if the reduction is not min/max reduction, call RecurrenceDescriptor::getOpcode() to handle other cases via CreateBinOp. Based on llvm#140242 Related to llvm#118393
No description provided.