Skip to content

Commit 06918a9

Browse files
authored
[MLIR][NFC] Mark barrier elimination helper static (#65303)
Make local helper functions static to avoid symbol name collision.
1 parent c86bb3d commit 06918a9

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

mlir/lib/Dialect/GPU/TransformOps/GPUTransformOps.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,10 @@ collectEffects(Operation *op,
360360
/// set. Returns `true` if the memory effects added to `effects` are exact,
361361
/// `false` if they are a conservative over-approximation. The latter means that
362362
/// `effects` contain instances not associated with a specific value.
363-
bool getEffectsBefore(Operation *op,
364-
SmallVectorImpl<MemoryEffects::EffectInstance> &effects,
365-
bool stopAtBarrier) {
363+
static bool
364+
getEffectsBefore(Operation *op,
365+
SmallVectorImpl<MemoryEffects::EffectInstance> &effects,
366+
bool stopAtBarrier) {
366367
if (!op->getBlock())
367368
return true;
368369

@@ -439,9 +440,10 @@ bool getEffectsBefore(Operation *op,
439440
/// set. Returns `true` if the memory effects added to `effects` are exact,
440441
/// `false` if they are a conservative over-approximation. The latter means that
441442
/// `effects` contain instances not associated with a specific value.
442-
bool getEffectsAfter(Operation *op,
443-
SmallVectorImpl<MemoryEffects::EffectInstance> &effects,
444-
bool stopAtBarrier) {
443+
static bool
444+
getEffectsAfter(Operation *op,
445+
SmallVectorImpl<MemoryEffects::EffectInstance> &effects,
446+
bool stopAtBarrier) {
445447
if (!op->getBlock())
446448
return true;
447449

@@ -584,7 +586,7 @@ static std::optional<bool> getKnownCapturingStatus(Operation *op, Value v) {
584586
/// the user may be storing this value into memory. This makes aliasing analysis
585587
/// more conservative as it cannot assume the pointer-like value is only passed
586588
/// around through SSA use-def.
587-
bool maybeCaptured(Value v) {
589+
static bool maybeCaptured(Value v) {
588590
SmallVector<Value> todo = {v};
589591
while (!todo.empty()) {
590592
Value v = todo.pop_back_val();
@@ -704,7 +706,7 @@ static bool mayAlias(Value first, Value second) {
704706
/// Returns `true` if the effect may be affecting memory aliasing the value. If
705707
/// the effect is not associated with any value, it is assumed to affect all
706708
/// memory and therefore aliases with everything.
707-
bool mayAlias(MemoryEffects::EffectInstance a, Value v2) {
709+
static bool mayAlias(MemoryEffects::EffectInstance a, Value v2) {
708710
if (Value v = a.getValue()) {
709711
return mayAlias(v, v2);
710712
}
@@ -715,8 +717,8 @@ bool mayAlias(MemoryEffects::EffectInstance a, Value v2) {
715717
/// an effect is not associated with any value, it is assumed to affect all
716718
/// memory and therefore aliases with everything. Effects on different resources
717719
/// cannot alias.
718-
bool mayAlias(MemoryEffects::EffectInstance a,
719-
MemoryEffects::EffectInstance b) {
720+
static bool mayAlias(MemoryEffects::EffectInstance a,
721+
MemoryEffects::EffectInstance b) {
720722
if (a.getResource()->getResourceID() != b.getResource()->getResourceID())
721723
return false;
722724
if (Value v2 = b.getValue()) {

0 commit comments

Comments
 (0)