Skip to content

[QC] WaveActiveAllEqual includes inactive lanes for vector inputs in if conditions #1045

@bob80905

Description

@bob80905

For Qualcomm machines, in either Clang or DXC compilation runs, WaveActiveAllEqual will behave incorrectly when waves are size 64 or 128.
Consider this code:

// Sixth and finally, test that identical vectors pass 
  // in the right conditions. Expect [true, true] for relevant threads.
  bool2 Result6 = false;
  if (TID.x != 0)
      Result6 = WaveActiveAllEqual(InVec2[TID.x]);

  Out6[TID.x] = Result6;

InVec2 is composed of int2 vectors. The first vector has {x, y} components, where x is different than all other x components in subsequent vectors in InVec2, and y is the same as all other y components in subsequent vectors in InVec2.
So, the if condition should block the first lane, and the rest of the lanes should all be active and identical, and we expect Result6 to be {true, true} for those lanes.
However, for those lanes, the results are {false, true}, which probably means that when computing WaveActiveAllEqual, the first lane is treated as active.

# | Name:            ExpectedOut6
# | Format:          Bool
# | Stride:          8
# | Data:            [ 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
# |                    1, 1 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...
# | Got:
# | ---
# | Name:            Out6
# | Format:          Bool
# | Stride:          8
# | Data:            [ 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 
# |                    0, 1 ]
# | OutputProps:
# |   Height:          0
# |   Width:           0
# |   Depth:           0
# | ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions