Skip to content

Commit

Permalink
ValueTracking, InstSimplify: fix nits
Browse files Browse the repository at this point in the history
  • Loading branch information
artagnon committed Oct 13, 2024
1 parent 831c877 commit 74e8e34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions llvm/include/llvm/Analysis/ValueTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,7 @@ bool onlyUsedByLifetimeMarkers(const Value *V);
/// droppable instructions.
bool onlyUsedByLifetimeMarkersOrDroppableInsts(const Value *V);

/// Return true if the instruction doesn't potentially cross vector lanes. This
/// is useful to make GVN-replacements for vector types.
/// Return true if the instruction doesn't potentially cross vector lanes.
bool isNotCrossLaneOperation(const Instruction *I);

/// Return true if the instruction does not have any effects besides
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4343,9 +4343,9 @@ static Value *simplifyWithOpReplaced(Value *V, Value *Op, Value *RepOp,
if (isa<PHINode>(I))
return nullptr;

// For vector types, the simplification must hold per-lane, so forbid
// potentially cross-lane operations like shufflevector.
if (Op->getType()->isVectorTy() && !isNotCrossLaneOperation(I))
// For vector types, the simplification must hold per-lane, so forbid
// potentially cross-lane operations like shufflevector.
return nullptr;

// Don't fold away llvm.is.constant checks based on assumptions.
Expand Down

0 comments on commit 74e8e34

Please sign in to comment.