[PATCH] D59730: [GVN] teach ConstantFolding correct handling of non-integral addrspace casts

Jameson Nash via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 17:58:00 PDT 2019


vtjnash created this revision.
vtjnash added a reviewer: reames.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
vtjnash added a parent revision: D59729: [GVN] non-functional code movement.
vtjnash added a child revision: D59661: [GVN] Try to be more principled about non-integral pointers.

  Here we teach the ConstantFolding analysis pass that it is 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).
  
  But also teach it that certain bit patterns are always known and convertable (a fact it already uses elsewhere). This requires us to also fix a globalopt test, since, after this change, LLVM is able to realize that the test actually is a valid transform (NULL is always a known bit-pattern) and so it doesn't need to emit the failure remarks for it.
  
  Also simplify some of the negative tests for transforms by avoiding a type change in their bitcast, and add positive versions of the same tests, to show that they otherwise should work.


Repository:
  rL LLVM

https://reviews.llvm.org/D59730

Files:
  lib/Analysis/ConstantFolding.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: D59730.191978.patch
Type: text/x-patch
Size: 11227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190323/2527e1c3/attachment.bin>


More information about the llvm-commits mailing list