Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][LoopVectorize] Inccorrect code generation in case of vectorize_predicate(enable) #76069

Closed
futog opened this issue Dec 20, 2023 · 1 comment · Fixed by #81609
Closed

Comments

@futog
Copy link
Contributor

futog commented Dec 20, 2023

Configuration:
--target=armv7a-none-eabihf -march=v7-a -mthumb -mfloat-abi=hard -mfpu=neon -O3

In vectorize.c:
var_27 will be set to '1', which is not correct.

The reason is that in BasicBlock for.cond.for.cond.cleanup_crit_edge (pred is middle.block) the arr_14 array is overindexed.

I think that the problem is that tail-fold by masking happens, even though the loop induction variable is used outside of the loop.

vectorize.zip

@github-actions github-actions bot added the clang Clang issues not falling into any other category label Dec 20, 2023
@EugeneZelenko EugeneZelenko added miscompilation vectorization and removed clang Clang issues not falling into any other category labels Dec 20, 2023
@fhahn
Copy link
Contributor

fhahn commented Feb 13, 2024

Looks the same as #51677

fhahn pushed a commit that referenced this issue Mar 4, 2024
When induction variable are used outside the loop body, tail folding
by masking mis-compiles, because for users outside of the loop the
final value of the induction is computed separately from the vector
loop.

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

Successfully merging a pull request may close this issue.

3 participants