IBM Support

IZ33205: PERFORMANCE ISSUES WITH VECTOR IMPLEMENTATION

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • When using vector implementation for certain routines extra
    'store' instructions are being generated by the compiler.
    
    eg:
    ===============Start of vxor.c===============
    unsigned long vxor(void *bp, long len, unsigned long y)
    {
       vector unsigned int  x = (vector unsigned int) (0);
       vector unsigned int *p = (vector unsigned int *) bp;
       long           c = len/(sizeof(vector unsigned int)*4);
    
       while (c--) {
    #if XXX
            x = vec_xor(vec_xor(vec_xor(vec_xor(x, *p++), *p++),
    *p++),*p++);
    #else
            x = vec_xor(x, *p++);
            x = vec_xor(x, *p++);
            x = vec_xor(x, *p++);
            x = vec_xor(x, *p++);
    #endif
       }
    
       return ((*(unsigned long *) &x) ^ (*(((unsigned long *)
    &x)+1)));
    }
    
    ===========End of vxor.c===========================
    
    When the above test case is compiled with:
    $xlc -qarch=pwr6 -qcompact -O3 -q64 -qenablevmx
    -qaltivec -c vxor.c -qlist
    
    the following .lst file shows the extra store instructions.
    $cat vxor.lst
    .
    .
    .
    11| 000064 stvx     7C0101CE   1     VSTQ      x(gr1,gr0,0)=vr0
                  ^----extra store instruction
        0| 000068 ori      60210000   1     XNOP
       13| 00006C vxor     10411CC4   1     VXOR   vr2=vr1,vr3
        0| 000070 ori      60210000   1     XNOP
       12| 000074 stvx     7C2101CE   1     VSTQ   x(gr1,gr0,0)=vr1
                  ^----extra store instruction
        0| 000078 ori      60210000   1     XNOP
       14| 00007C vxor     100224C4   1     VXOR   vr0=vr2,vr4
       13| 000080 stvx     7C4101CE   1     VSTQ   x(gr1,gr0,0)=vr2
                  ^----extra store instruction
        0| 000084 ori      60210000   1     XNOP
       14| 000088 stvx     7C0101CE   1     VSTQ   x(gr1,gr0,0)=vr0
                  ^----extra store instruction
    .
    .
    .
    

Local fix

  • n/a.
    

Problem summary

  • Users of PPC970 or POWER6 VMX vector types are affected by this
    issue.
    
    Optimization sometimes failed to remove
    redundant vector store instructions, or move vector
    store instructions down out of loops, affecting
    performance.
    

Problem conclusion

  • When optimization removes a redundant
    address-taken in a function with vector operations, it now
    also eliminates unnecessary stores and moves stores
    down out of loops if possible.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IZ33205

  • Reported component name

    XLC C++ AIX

  • Reported component ID

    5724S7100

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-09-23

  • Closed date

    2008-10-02

  • Last modified date

    2009-01-27

Fix information

  • Fixed component name

    XL C AIX

  • Fixed component ID

    5724S7000

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
27 January 2009