[PATCH] Value soft float calls as more expensive in the inliner.

Eric Christopher echristo at gmail.com
Fri Jan 23 17:10:11 PST 2015


Yeah, not so much. Testcases like that need to be in the backend. No
optimization testcases in the front end if we can help it. (i.e. testing
options)

Thanks!

-eric

On Fri Jan 23 2015 at 4:58:11 PM Cameron Esfahani <dirty at apple.com> wrote:

> It's in the CodeGen directory.  Here's the current testcase:
>
> [dirty at girlyouknowitstrue work]$ cat llvm/tools/clang/test/CodeGen/
> inline-fp.c
> // RUN: %clang -Oz -target armv7-apple-macosx10.8.0 -mcpu=cortex-a8
> -march=armv7 -S -emit-llvm %s -o - | FileCheck %s
> // RUN: %clang -Oz -target armv7-apple-macosx10.8.0 -mcpu=cortex-m3
> -march=armv7 -S -emit-llvm %s -o - | FileCheck -check-prefix NO-FP %s
>
> extern float powf(float x, float y);
> extern float fabsf(float x);
>
> static float f1(int response, unsigned char value1) {
>
>   float value2 = 2620.0f * powf(1.01f, value1 - 1);
>   float responseDelta = (response - value2) / value2;
>
>   return (responseDelta);
>
> }
>
> extern void getX(int *responseX, unsigned char *valueX);
> extern void getY(int *responseY, unsigned char *valueY);
> extern void getZ(int *responseZ, unsigned char *valueZ);
>
> // CHECK-NOT: define internal arm_aapcscc float @f1(
> // NO-FP: define internal arm_aapcscc float @f1(
> int test_all(void) {
>
>   int responseX;
>   int responseY;
>   int responseZ;
>   unsigned char valueX;
>   unsigned char valueY;
>   unsigned char valueZ;
>
>   getX(&responseX, &valueX);
>   getY(&responseY, &valueY);
>   getZ(&responseZ, &valueZ);
>
>   float responseDeltaX = f1(responseX, valueX);
>   float responseDeltaY = f1(responseY, valueY);
>   float responseDeltaZ = f1(responseZ, valueZ);
>
>   int success = 1;
>
>   if (fabsf(responseDeltaX) > 0.14f)
>     success = 0;
>   else if (fabsf(responseDeltaY) > 0.14f)
>     success = 0;
>   else if (fabsf(responseDeltaZ) > 0.14f)
>     success = 0;
>
>   return (success);
>
> }
>
> Cameron Esfahani
> dirty at apple.com
>
> "Americans are very skilled at creating a custom meaning from something
> that's mass-produced."
>
> Ann Powers
>
>
> http://reviews.llvm.org/D6936
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150124/d63d91b4/attachment.html>


More information about the llvm-commits mailing list