[PATCH] D142970: [IR] Don't consider interposable globals to be dereferenceable

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 03:02:35 PST 2023


nikic created this revision.
nikic added reviewers: efriedma, jdoerfert.
Herald added subscribers: kosarev, StephenFan, okura, kuter, steven.zhang, pengfei, asbirlea, hiraditya, kristof.beyls, tpr.
Herald added a project: All.
nikic requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

According to D78952 <https://reviews.llvm.org/D78952>, we should not be making assumption about the size (and thus dereferencability) of globals that don't have a definitive initializer.

This is a draft patch to make the implementation comply with the specification, though I haven't fixed all test failures yet:

  Failed Tests (17):
    LLVM :: CodeGen/AArch64/GlobalISel/constant-dbg-loc.ll
    LLVM :: CodeGen/AArch64/GlobalISel/localizer-arm64-tti.ll
    LLVM :: CodeGen/AArch64/csr-split.ll
    LLVM :: CodeGen/AMDGPU/GlobalISel/irtranslator-invariant.ll
    LLVM :: CodeGen/PowerPC/GlobalISel/ppc-irtranslator-stackprotect.ll
    LLVM :: CodeGen/PowerPC/aix-cc-abi.ll
    LLVM :: CodeGen/PowerPC/aix-cc-byval.ll
    LLVM :: CodeGen/PowerPC/ctrloops-pseudo.ll
    LLVM :: CodeGen/PowerPC/lower-globaladdr32-aix.ll
    LLVM :: CodeGen/PowerPC/lower-globaladdr64-aix.ll
    LLVM :: CodeGen/PowerPC/out-of-range-dform.ll
    LLVM :: CodeGen/SystemZ/int-cmp-59.ll
    LLVM :: CodeGen/X86/fold-sext-trunc.ll
    LLVM :: CodeGen/X86/pr32610.ll
    LLVM :: CodeGen/X86/pr37916.ll
    LLVM :: CodeGen/X86/remat-constant.ll
    LLVM-Unit :: Analysis/./AnalysisTests/LoadsTest/CanReplacePointersIfEqual

Alternatively, we should change the spec to permit our current assumption of a minimum size


https://reviews.llvm.org/D142970

Files:
  llvm/lib/IR/Value.cpp
  llvm/test/Analysis/ValueTracking/memory-dereferenceable.ll
  llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll
  llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll
  llvm/test/Transforms/Attributor/memory_locations.ll
  llvm/test/Transforms/Attributor/noalias.ll
  llvm/test/Transforms/Attributor/nosync.ll
  llvm/test/Transforms/Attributor/returned.ll
  llvm/test/Transforms/InstCombine/atomic.ll
  llvm/test/Transforms/LICM/2008-07-22-LoadGlobalConstant.ll
  llvm/test/Transforms/LICM/lcssa-ssa-promoter.ll
  llvm/test/Transforms/LICM/promote-single-thread.ll
  llvm/test/Transforms/LICM/scalar-promote-memmodel.ll
  llvm/test/Transforms/LoopVectorize/single-value-blend-phis.ll
  llvm/test/Transforms/SROA/phi-with-duplicate-pred.ll
  llvm/test/Transforms/SimplifyCFG/X86/PR29163.ll
  llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll
  llvm/test/Transforms/TailCallElim/reorder_load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142970.493541.patch
Type: text/x-patch
Size: 16584 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230131/ed332742/attachment.bin>


More information about the llvm-commits mailing list