[PATCH] D125328: [BasicAA] Fix order in which we pass MemoryLocations to alias()

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 10:23:52 PDT 2022


aeubanks created this revision.
Herald added subscribers: jeroen.dobbelaere, hiraditya.
Herald added a project: All.
aeubanks requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

D98718 <https://reviews.llvm.org/D98718> caused the order of Values/MemoryLocations we pass to alias() to
be significant due to storing the offset in the PartialAlias case. But
some callers weren't audited and were still passing swapped arguments,
causing the returned PartialAlias offset to be negative in some
cases. For example, the newly added unittests would return -1
instead of 1.

Fixes #55343, a miscompile.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125328

Files:
  llvm/include/llvm/IR/IRBuilder.h
  llvm/lib/Analysis/BasicAliasAnalysis.cpp
  llvm/unittests/Analysis/BasicAliasAnalysisTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125328.428426.patch
Type: text/x-patch
Size: 5910 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220510/770e70a1/attachment.bin>


More information about the llvm-commits mailing list