[ConstantFold] Don't fold ppc_fp128 <-> int bitcasts
authorHal Finkel <hfinkel@anl.gov>
Sat, 28 Mar 2015 16:44:57 +0000 (16:44 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 28 Mar 2015 16:44:57 +0000 (16:44 +0000)
commit836000290478ae1083486ddb4189fb930d87f2c3
tree0dc215576188c3a044ed1ae174be5971ff37a5bb
parent5ce6ef629e1dfdf78bab0e359a7963ee30511041
[ConstantFold] Don't fold ppc_fp128 <-> int bitcasts

PPC_FP128 is really the sum of two consecutive doubles, where the first double
is always stored first in memory, regardless of the target endianness. The
memory layout of i128, however, depends on the target endianness, and so we
can't fold this without target endianness information. As a result, we must not
do this folding in lib/IR/ConstantFold.cpp (it could be done instead in
Analysis/ConstantFolding.cpp, but that's not done now).

Fixes PR23026.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233481 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/ConstantFold.cpp
test/Transforms/SROA/ppcf128-no-fold.ll [new file with mode: 0644]