1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 22:42:52 +01:00
llvm-mirror/lib/Transforms/Scalar
Chris Lattner 098fb42690 * Eliminate calls to CastInst::createInferredCast.
* Add support for promoting unions with fp values in them.  This produces
   our new int<->fp bitcast instructions, implementing
   Transforms/ScalarRepl/union-fp-int.ll

As an example, this allows us to compile this:

union intfloat { int i; float f; };
float invsqrt(const float arg_x) {
    union intfloat x = { .f = arg_x };
    const float xhalf = arg_x * 0.5f;
    x.i = 0x5f3759df - (x.i >> 1);
    return x.f * (1.5f - xhalf * x.f * x.f);
}

into:

_invsqrt:
        movss 4(%esp), %xmm0
        movd %xmm0, %eax
        sarl %eax
        movl $1597463007, %ecx
        subl %eax, %ecx
        movd %ecx, %xmm1
        mulss LCPI1_0, %xmm0
        mulss %xmm1, %xmm0
        movss LCPI1_1, %xmm2
        mulss %xmm1, %xmm0
        subss %xmm0, %xmm2
        movl 8(%esp), %eax
        mulss %xmm2, %xmm1
        movss %xmm1, (%eax)
        ret

instead of:

_invsqrt:
        subl $4, %esp
        movss 8(%esp), %xmm0
        movss %xmm0, (%esp)
        movl (%esp), %eax
        movl $1597463007, %ecx
        sarl %eax
        subl %eax, %ecx
        movl %ecx, (%esp)
        mulss LCPI1_0, %xmm0
        movss (%esp), %xmm1
        mulss %xmm1, %xmm0
        mulss %xmm1, %xmm0
        movss LCPI1_1, %xmm2
        subss %xmm0, %xmm2
        mulss %xmm2, %xmm1
        movl 12(%esp), %eax
        movss %xmm1, (%eax)
        addl $4, %esp
        ret

llvm-svn: 32418
2006-12-10 23:56:50 +00:00
..
ADCE.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
BasicBlockPlacement.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
CondPropagate.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
ConstantProp.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
CorrelatedExprs.cpp Removing even more <iostream> includes. 2006-12-07 20:04:42 +00:00
DCE.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
DeadStoreElimination.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
GCSE.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
IndVarSimplify.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
InstructionCombining.cpp Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
LICM.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
LoopStrengthReduce.cpp Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
LoopUnroll.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
LoopUnswitch.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
LowerGC.cpp For PR950: 2006-11-27 01:05:10 +00:00
LowerPacked.cpp Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
Makefile DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now 2005-10-24 02:26:13 +00:00
PredicateSimplifier.cpp Removing even more <iostream> includes. 2006-12-07 20:04:42 +00:00
Reassociate.cpp Removing even more <iostream> includes. 2006-12-07 20:04:42 +00:00
Reg2Mem.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
ScalarReplAggregates.cpp * Eliminate calls to CastInst::createInferredCast. 2006-12-10 23:56:50 +00:00
SCCP.cpp Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are 2006-12-07 01:30:32 +00:00
SimplifyCFG.cpp Incorporate any changes in the successor blocks into the result of 2006-12-08 21:52:01 +00:00
TailDuplication.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00
TailRecursionElimination.cpp Detemplatize the Statistic class. The only type it is instantiated with 2006-12-06 17:46:33 +00:00