[all-commits] [llvm/llvm-project] 5a4c6f: [Loads] Check context instruction for context-sens...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Sep 23 00:13:32 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a4c6f97997f3cdfa9d98f7f0b546e331ee9cc4a
      https://github.com/llvm/llvm-project/commit/5a4c6f97997f3cdfa9d98f7f0b546e331ee9cc4a
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-09-23 (Mon, 23 Sep 2024)

  Changed paths:
    M clang/test/CodeGenOpenCL/builtins-amdgcn.cl
    M llvm/include/llvm/Analysis/ValueTracking.h
    M llvm/lib/Analysis/Loads.cpp
    M llvm/lib/Analysis/MemDerefPrinter.cpp
    M llvm/lib/CodeGen/MachineOperand.cpp
    M llvm/test/Transforms/SimplifyCFG/speculate-derefable-load.ll

  Log Message:
  -----------
  [Loads] Check context instruction for context-sensitive derefability (#109277)

If a dereferenceability fact is provided through `!dereferenceable` (or
similar), it may only hold on the given control flow path. When we use
`isSafeToSpeculativelyExecute()` to check multiple instructions, we
might make use of `!dereferenceable` information that does not hold at
the speculation target. This doesn't happen when speculating
instructions one by one, because `!dereferenceable` will be dropped
while speculating.

Fix this by checking whether the instruction with `!dereferenceable`
dominates the context instruction. If this is not the case, it means we
are speculating, and cannot guarantee that it holds at the speculation
target.

Fixes https://github.com/llvm/llvm-project/issues/108854.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list