[PATCH] D129977: [LoongArch] Support load/store of dso_local PIC global values

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 19:36:36 PDT 2022


MaskRay added a comment.

In D129977#3670576 <https://reviews.llvm.org/D129977#3670576>, @wangleiat wrote:

> In D129977#3658733 <https://reviews.llvm.org/D129977#3658733>, @MaskRay wrote:
>
>> In D129977#3658602 <https://reviews.llvm.org/D129977#3658602>, @wangleiat wrote:
>>
>>> Thanks!
>>>
>>>> load-store.ll has UB due to out-of-bounds load/store. Fix the UB in the variable
>>>> test and add an array test. Note: PIC array index is currently wrong.
>>>
>>> Spelling mistakes? Is NONPIC?
>>
>> I pick NOPIC because `-fno-pic` is usually used to refer the position-dependent codegen. NOPIC should be fine.
>>
>>> The wrong array index is due to constant folding with `GlobalAddress` when `isDSOLocal()`.
>>> The interface function of the common layer is `TargetLowering::isOffsetFoldingLegal`.
>>
>> Thanks!
>
> LGTM
>
> Will you fix wrong array index in this patch or in separate one?

If you have a patch, please just fix it :) otherwise I may be interested in fixing it in my spare time... Thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129977/new/

https://reviews.llvm.org/D129977



More information about the llvm-commits mailing list