-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[VPlan] Add incoming_[blocks,values] iterators to VPPhiAccessors (NFC) #138472
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
Changes from all commits
b357af4
9113022
c61233f
a73a137
90b2d4d
f768b97
d6d6bb5
8dfd569
595b057
a2b4ebb
46780ab
5fee077
450901e
996af30
904998b
bcd9064
7291b0e
2c318e6
260e727
fc8cf8b
4b705f8
14a6b44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,14 +238,11 @@ void VPPredicator::convertPhisToBlends(VPBasicBlock *VPBB) { | |
// optimizations will clean it up. | ||
|
||
SmallVector<VPValue *, 2> OperandsWithMask; | ||
unsigned NumIncoming = PhiR->getNumIncoming(); | ||
for (unsigned In = 0; In < NumIncoming; In++) { | ||
const VPBasicBlock *Pred = PhiR->getIncomingBlock(In); | ||
OperandsWithMask.push_back(PhiR->getIncomingValue(In)); | ||
VPValue *EdgeMask = getEdgeMask(Pred, VPBB); | ||
for (const auto &[InVPV, InVPBB] : PhiR->incoming_values_and_blocks()) { | ||
OperandsWithMask.push_back(InVPV); | ||
VPValue *EdgeMask = getEdgeMask(InVPBB, VPBB); | ||
if (!EdgeMask) { | ||
assert(In == 0 && "Both null and non-null edge masks found"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess there's not an easy way to preserve this assert? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope unfortunately not :( |
||
assert(all_equal(PhiR->operands()) && | ||
assert(all_equal(PhiR->incoming_values()) && | ||
"Distinct incoming values with one having a full mask"); | ||
break; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,17 +250,15 @@ bool VPlanVerifier::verifyVPBasicBlock(const VPBasicBlock *VPBB) { | |
for (const VPUser *U : V->users()) { | ||
auto *UI = cast<VPRecipeBase>(U); | ||
if (auto *Phi = dyn_cast<VPPhiAccessors>(UI)) { | ||
for (unsigned Idx = 0; Idx != Phi->getNumIncoming(); ++Idx) { | ||
VPValue *IncomingVPV = Phi->getIncomingValue(Idx); | ||
for (const auto &[IncomingVPV, IncomingVPBB] : | ||
Phi->incoming_values_and_blocks()) { | ||
Comment on lines
+253
to
+254
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not majorly important but if you wanted to preserve the error message you could do |
||
if (IncomingVPV != V) | ||
continue; | ||
|
||
const VPBasicBlock *IncomingVPBB = Phi->getIncomingBlock(Idx); | ||
if (VPDT.dominates(VPBB, IncomingVPBB)) | ||
continue; | ||
|
||
errs() << "Incoming def at index " << Idx | ||
<< " does not dominate incoming block!\n"; | ||
errs() << "Incoming def does not dominate incoming block!\n"; | ||
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) | ||
VPSlotTracker Tracker(VPBB->getPlan()); | ||
IncomingVPV->getDefiningRecipe()->print(errs(), " ", Tracker); | ||
|
Uh oh!
There was an error while loading. Please reload this page.