Copy some of the DataLayout checking, for int/ptr conversions, into BasicTTI and fix the assumption that all bitcasts of the same type sizes are free. We now only assume that bitcasts between ints and ptrs of the same size are free. This allows TTImpl->getUserCost to just call the concrete implementation of getCastInstrCost.
Details
Diff Detail
Event Timeline
llvm/test/Analysis/CostModel/ARM/cast.ll | ||
---|---|---|
1871 | These do sound better to me, at least on ARM. |
llvm/include/llvm/CodeGen/BasicTTIImpl.h | ||
---|---|---|
692 | This line says isIntegerTy twice. |
LGTM, but give @craig.topper / @RKSimon a day at least to comment further. I can't tell if there are any target-specific issues that can arise from a change like this.
llvm/test/Transforms/SLPVectorizer/X86/load-merge.ll | ||
---|---|---|
115–122 | I looked at this diff through x86 codegen, and it seems like an improvement to create the vector trunc here. But it's likely a moot point in the motivating real-world example from the bug report because instcombine reduces the IR before SLP sees this form. We may be able to add some load-combining transforms to -vector-combine to catch this. |
This line says isIntegerTy twice.