[PATCH] D59661: [GVN] Try to be more principled about non-integral pointers

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 12:04:17 PDT 2019


vtjnash created this revision.
vtjnash added a reviewer: reames.
Herald added subscribers: llvm-commits, jfb.
Herald added a project: LLVM.

Very similar to the recent work, such as "Fix a crash bug w/non-integral pointers and memtransfers". But try to be more precise about what should and should not be permitted, and consolidate all users into calling `canCoerceMustAliasedValueToLoad` (since that is the predicate that VNCoercion will check). Similarly, teach the ConstantFolding analysis pass that's it's not legal to replace a load of a bitcast constant (having a non-integral addrspace) with a bitcast of the value of that constant (with a different non-integral addrspace).

Also simplify some of the negative tests for transforms by avoiding a type change in their bitcast, and add some positive versions of the same tests, to test that they otherwise should work. We need to also fix a globalopt test, since after this change, LLVM is able to realize that that test actually is a valid transform (NULL is always a known bit-pattern) and doesn't emit the failure remarks.


Repository:
  rL LLVM

https://reviews.llvm.org/D59661

Files:
  lib/Analysis/ConstantFolding.cpp
  lib/Transforms/Scalar/GVN.cpp
  lib/Transforms/Utils/VNCoercion.cpp
  test/Transforms/GVN/non-integral-pointers.ll
  test/Transforms/GlobalOpt/evaluate-call-errors.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59661.191755.patch
Type: text/x-patch
Size: 26010 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190321/908395d6/attachment.bin>


More information about the llvm-commits mailing list