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

Ray Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 19:31:00 PDT 2022


wangleiat accepted this revision.
wangleiat added a comment.
This revision is now accepted and ready to land.

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?


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