Skip to content

[LoopPredication] Wrong widenable branch identification #66418

@aleks-tmb

Description

@aleks-tmb

We met a testcase with a widenable branch in the form of br(c0 && (c1 && WC)):

  %wc = call i1 @llvm.experimental.widenable.condition()
  %and0 = and i1 %wc, %cond0
  %and1 = and i1 %and0, %cond1
  br i1 %and1, label %loop, label %deopt

That form is going to be supported after we finish GuardWidening reworking from branch widening to widenable conditions widening. But for now we still need to check that widenable branch is in the form of:

br(widenable_condition & (...))

That's why the one of the changes in the d6e7c16 was introduced too early:

 bool llvm::isWidenableBranch(const User *U) {
-  Value *Condition, *WidenableCondition;
-  BasicBlock *GuardedBB, *DeoptBB;
-  return parseWidenableBranch(U, Condition, WidenableCondition, GuardedBB,
-                              DeoptBB);
+  return extractWidenableCondition(U) != nullptr;
 }

We need to revert that change to state that branch above isn't widenable.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions