[PATCH] Reject bitcasts between address spaces with different sizes

Eli Friedman eli.friedman at gmail.com
Mon Jul 22 15:18:09 PDT 2013


I can't figure out how the change to lib/AsmParser/LLParser.cpp is relevant.

Is the walk of the users of each global still necessary?

If we are going to assume that all pointers have the same size without
a data layout, you should document that in LangRef.

On Mon, Jul 22, 2013 at 2:55 PM, Matt Arsenault
<Matthew.Arsenault at amd.com> wrote:
>   Check for illegal bitcasts where the original source pointer is an inttoptr from a constant integer. This is a pain because these can be almost anywhere, so this searches global initializers and ConstantExpr pointer operands of instructions.
>
>   Add helper functions to reduce duplication in all the places bitcasts need to be checked.
>
>   Remove autoupgrade parts since it isn't necessary when bitcasts between address spaces of the same size are going to be allowed, removing the compatibility problem.
>
>   Allow bitcasts without a datalayout. The approach in other places without DataLayout seems to be that all pointers are the maximum pointer size of 64-bits, so I think it makes sense to assume that without DataLayout, all pointers are the same size.
>
>   Make verifier tests use llvm-as instead of opt -verify which aborts.
>
> Hi eli.friedman,
>
> http://llvm-reviews.chandlerc.com/D1083
>
> CHANGE SINCE LAST DIFF
>   http://llvm-reviews.chandlerc.com/D1083?vs=2703&id=2952#toc
>
> Files:
>   docs/LangRef.rst
>   lib/AsmParser/LLParser.cpp
>   lib/IR/Verifier.cpp
>   test/Transforms/InstCombine/memset2.ll
>   test/Verifier/bitcast-address-space-nested-global-cycle.ll
>   test/Verifier/bitcast-address-space-nested-global.ll
>   test/Verifier/bitcast-address-space-through-constant-inttoptr-inside-gep-instruction.ll
>   test/Verifier/bitcast-address-space-through-constant-inttoptr.ll
>   test/Verifier/bitcast-address-space-through-gep-2.ll
>   test/Verifier/bitcast-address-space-through-gep.ll
>   test/Verifier/bitcast-address-space-through-inttoptr.ll
>   test/Verifier/bitcast-address-spaces.ll
>   test/Verifier/bitcast-vector-pointer-as.ll



More information about the llvm-commits mailing list