wuying225 / softart

Automatically exported from code.google.com/p/softart
Other
0 stars 0 forks source link

Eliminate unnecessary load instruction. #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Description:
  Now we found following code:

    float test_dot_f3( float3 lhs, float3 rhs ){
    return dot( lhs, rhs );
    }

  generates LLVM IR:

define void @"Mtest_dot_f3@@QV3F@@QV3F@@"(float* %.ret, %1* %lhs, %1* %rhs) {
.body:
  %0 = load %1* %lhs
  %1 = load %1* %lhs
  %2 = load %1* %lhs
  %3 = extractvalue %1 %2, 0
 // ...
}

  obviously, the top two instructions should be removed. So, check the code to fixes this.

Original issue reported on code.google.com by wuye9036 on 21 Nov 2011 at 1:20

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 15 Dec 2011 at 2:53

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 15 Dec 2011 at 3:21

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 5 Mar 2012 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 7 Mar 2012 at 2:40

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 7 Mar 2012 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 7 Mar 2012 at 2:43

GoogleCodeExporter commented 9 years ago

Original comment by wuye9036 on 4 Dec 2012 at 6:35