llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.76k stars 11.89k forks source link

[Struct Opt] A structure array accesses its member variables, the base address of the structure array is recalculated each time #112830

Open LiqinWeng opened 1 week ago

LiqinWeng commented 1 week ago

Test case from spec2006 sjen, pls see this link: https://godbolt.org/z/hbnKz33r6

I debugged it and found that the main reason was that the alias analysis (TBAA) between the numb_move variable and MustNotAliasInsts (storeInst in the figure below) resulted in MayAlias, making it impossible to optimize. image

I haven't thought of a better solution yet. Does anyone have any ideas?:)

llvmbot commented 1 week ago

@llvm/issue-subscribers-backend-risc-v

Author: LiqinWeng (LiqinWeng)

Test case from spec2006 sjen: **test case**: https://godbolt.org/z/hbnKz33r6
LiqinWeng commented 1 week ago

@nikic @nikita-kud @fhahn