[PATCH] Canonicalize addrspacecast ConstExpr between different pointer types

Jingyue Wu jingyue at google.com
Fri Jun 13 10:21:02 PDT 2014


Hi arsenm, eliben, meheff,

As a follow-up to r210375 which canonicalizes addrspacecast
instructions, this patch canonicalizes addrspacecast constant
expressions.

Given clang uses ConstantExpr::getAddrSpaceCast to emit addrspacecast
cosntant expressions, this patch is also a step towards having the
frontend emit canonicalized addrspacecasts.

Update three affected tests in addrspacecast-alias.ll,
access-non-generic.ll and constant-fold-gep.ll and added one new test in
constant-fold-address-space-pointer.ll

http://reviews.llvm.org/D4138

Files:
  lib/IR/ConstantFold.cpp
  lib/IR/Constants.cpp
  test/Assembler/addrspacecast-alias.ll
  test/CodeGen/NVPTX/access-non-generic.ll
  test/Other/constant-fold-gep.ll
  test/Transforms/InstCombine/constant-fold-address-space-pointer.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4138.10397.patch
Type: text/x-patch
Size: 4770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140613/b97975c6/attachment.bin>


More information about the llvm-commits mailing list