Skip to content

Conversation

F-Stuckmann
Copy link
Collaborator

Minor Performance improvements: -0.03%

Core_Compute_Insn_Count Core_PMSize_absolute Core_StackSize_absolute

%483:_(s32) = COPY $r6
%484:_(s32) = G_AIE_ZEXT_EXTRACT_VECTOR_ELT %4(<16 x s32>), %483(s32)
%485:_(s32) = G_ASSERT_SEXT %484, 16
%486:_(s32) = G_ASSERT_ZEXT %485, 16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we really produces this IR? Is looks illegal: the G_AIE_ZEXT_EXTRACT_VECTOR_ELT guarantees to zero-extend the vector element it extracts (or doesn't do any extension if the element type size matches the destination type size).
Having two asserts that claim the same value is both sign and zero extended looks wrong:

    %485:_(s32) = G_ASSERT_SEXT %484, 16
    %486:_(s32) = G_ASSERT_ZEXT %485, 16

Note that G_ASSERT_SEXT/G_ASSERT_ZEXT does not perform any operation. It simply tells the optimizers that they can remove redundant extensions

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we produce it unfortunately.
The second unit test (VEXTBCST_SEXT_CHAIN) is constructed to test the symmetry of the G_ASSERT_[S/Z]EXT removal.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you investigate how it ends up in this situation? I don't think this is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants