[PATCH] Avoid FP conversions when calling bitcasted / alias functions

Eli Friedman eli.friedman at gmail.com
Tue Jul 30 13:25:37 PDT 2013


On Tue, Jul 30, 2013 at 1:19 PM, Matt Arsenault
<Matthew.Arsenault at amd.com> wrote:
>
>   Where would be the best place to put a version / wrapper for getCastOpcode that would be aware of the pointer sizes? getCastOpcode asserts on invalid casts, and the FIXME I added is to add an assertion for casts between address spaces. There are a few places around that can hit that assertion when called with a pointer. (e.g., one place in SCEV where the sizes are known to match, and will try to get a bitcast but it will fail on the assertion)
>
>   Should I do something similar to what isEliminableCastPair does, and add parameters to optionally provide the int types that the pointers use?
>
> http://llvm-reviews.chandlerc.com/D1058

CastInst::getCastOpcode should just die.  We generally don't want the
full generality of getCastOpcode; LLVM IR isn't C.

-Eli




More information about the llvm-commits mailing list