-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
State.UF is not needed any longer after 8ec4067 (#95842). Clean it up, simplifying ::execute of existing recipes.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,7 +256,6 @@ struct VPTransformState { | |
|
||
/// The chosen Vectorization and Unroll Factors of the loop being vectorized. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
fhahn
Author
Contributor
|
||
ElementCount VF; | ||
unsigned UF; | ||
|
||
/// Hold the indices to generate specific scalar instructions. Null indicates | ||
/// that all instances are to be generated, using either scalar or vector | ||
|
@@ -309,7 +308,7 @@ struct VPTransformState { | |
assert((VF.isScalar() || V->getType()->isVectorTy()) && | ||
"scalar values must be stored as (Part, 0)"); | ||
if (!Data.PerPartOutput.count(Def)) { | ||
DataState::PerPartValuesTy Entry(UF); | ||
DataState::PerPartValuesTy Entry(1); | ||
Data.PerPartOutput[Def] = Entry; | ||
} | ||
Data.PerPartOutput[Def][Part] = V; | ||
|
@@ -1306,11 +1305,10 @@ class VPInstruction : public VPRecipeWithIRFlags, | |
/// needed. | ||
bool canGenerateScalarForFirstLane() const; | ||
|
||
/// Utility methods serving execute(): generates a single instance of the | ||
/// modeled instruction for a given part. \returns the generated value for \p | ||
/// Part. In some cases an existing value is returned rather than a generated | ||
/// one. | ||
Value *generatePerPart(VPTransformState &State, unsigned Part); | ||
/// Utility methods serving execute(): generates a single vector instance of | ||
/// the modeled instruction. \returns the generated value. . In some cases an | ||
/// existing value is returned rather than a generated one. | ||
Value *generate(VPTransformState &State); | ||
|
||
/// Utility methods serving execute(): generates a scalar single instance of | ||
/// the modeled instruction for a given lane. \returns the scalar generated | ||
|
@@ -1616,7 +1614,7 @@ class VPScalarCastRecipe : public VPSingleDefRecipe { | |
|
||
Type *ResultTy; | ||
|
||
Value *generate(VPTransformState &State, unsigned Part); | ||
Value *generate(VPTransformState &State); | ||
|
||
public: | ||
VPScalarCastRecipe(Instruction::CastOps Opcode, VPValue *Op, Type *ResultTy) | ||
|
4 comments
on commit 06c3a7d
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.
Hi @fhahn,
There is something funny going on.
Starting with this NFC patch, the following
clang -O2 -ffast-math -g bbi-99425.c
fails with
invalid fpmath accuracy!
%vec.ind.next = fadd fast <2 x float> %step.add, <float 2.000000e+00, float 2.000000e+00>, !dbg !25, !fpmath !25
clang-20: ../lib/Transforms/Vectorize/LoopVectorize.cpp:10207: bool llvm::LoopVectorizePass::processLoop(llvm::Loop *): Assertion `!verifyFunction(*L->getHeader()->getParent(), &dbgs())' failed.
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.
Reduced opt reproducer:
opt -passes=loop-vectorize bbi-99425.ll -o /dev/null
Removing the debug info from
%arrayidx.real = phi float [ 0.000000e+00, %entry ], [ %add.r, %for.body ], !dbg !4
makes the failure disappear.
bbi-99425.ll.gz
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.
The problem is fixed with 040bb37
[VPlan] Fix incorrect argument for CreateBinOp after 06c3a7d2d764.
06c3a7d2d764 incorrectly updated CreateBinOp to pass the debug location,
which gets interpreted as FPMath node. Remove the argument.
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.
@mikaelholmen yes that should be the one, thanks for the reproducer
Drop "of all UF parts".
Worth searching for "UF" and "part" throughout documentation.