Duncan Sands
bbc7016c60
Transform code like this
...
%V = mul i64 %N, 4
%t = getelementptr i8* bitcast (i32* %arr to i8*), i32 %V
into
%t1 = getelementptr i32* %arr, i32 %N
%t = bitcast i32* %t1 to i8*
incorporating the multiplication into the getelementptr.
This happens all the time in dragonegg, for example for
int foo(int *A, int N) {
return A[N];
}
because gcc turns this into byte pointer arithmetic before it hits the plugin:
D.1590_2 = (long unsigned int) N_1(D);
D.1591_3 = D.1590_2 * 4;
D.1592_5 = A_4(D) + D.1591_3;
D.1589_6 = *D.1592_5;
return D.1589_6;
The D.1592_5 line is a POINTER_PLUS_EXPR, which is turned into a getelementptr
on a bitcast of A_4 to i8*, so this becomes exactly the kind of IR that the
transform fires on.
An analogous transform (with no testcases!) already existed for bitcasts of
arrays, so I rewrote it to share code with this one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166474 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23 08:28:26 +00:00
..
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-08-07 22:35:16 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-04-23 17:39:52 +00:00
2012-05-05 07:09:40 +00:00
2012-06-07 20:28:57 +00:00
2012-05-01 00:20:38 +00:00
2012-04-24 20:18:49 +00:00
2012-04-30 11:56:58 +00:00
2012-05-27 22:03:32 +00:00
2012-05-28 19:18:16 +00:00
2012-06-07 01:02:13 +00:00
2012-07-25 09:45:37 +00:00
2012-07-30 07:25:20 +00:00
2012-08-30 11:23:20 +00:00
2012-09-18 09:31:44 +00:00
2012-09-24 17:22:43 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-09-27 10:14:43 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-10-04 13:36:31 +00:00
2012-06-26 13:39:21 +00:00
2012-10-02 15:49:34 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-04-26 23:29:14 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-04-23 17:39:52 +00:00
2012-07-02 19:09:46 +00:00
2012-09-27 10:14:43 +00:00
2012-09-27 10:14:43 +00:00
2012-07-06 23:09:25 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-10-23 08:28:26 +00:00
2012-07-02 19:09:46 +00:00
2012-08-10 20:55:20 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-05-22 15:25:31 +00:00
2012-09-21 16:26:41 +00:00
2012-07-02 12:47:22 +00:00
2012-08-18 22:04:34 +00:00
2012-08-30 23:11:49 +00:00
2012-07-02 12:47:22 +00:00
2012-06-10 20:35:00 +00:00
2012-07-06 23:09:25 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-06 23:09:25 +00:00
2012-09-27 21:21:21 +00:00
2012-09-27 21:21:21 +00:00
2012-08-21 08:39:44 +00:00
2012-07-02 12:47:22 +00:00
2012-08-15 03:49:59 +00:00
2012-09-27 21:21:25 +00:00
2012-09-27 21:21:25 +00:00
2012-07-02 19:09:46 +00:00
2012-09-27 21:21:18 +00:00
2012-09-27 21:21:18 +00:00
2012-07-02 19:09:46 +00:00
2012-06-26 22:03:13 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-10-16 21:29:38 +00:00
2012-07-06 23:09:25 +00:00
2012-08-17 19:26:41 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-04-27 17:50:22 +00:00
2012-07-02 12:47:22 +00:00
2012-06-08 22:30:05 +00:00
2012-07-27 18:03:57 +00:00
2012-07-02 12:47:22 +00:00
2012-10-20 08:43:52 +00:00
2012-07-02 19:09:46 +00:00
2012-04-23 17:39:52 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-10-13 16:45:32 +00:00
2012-10-13 16:45:32 +00:00
2012-10-13 16:45:32 +00:00
2012-10-13 16:45:37 +00:00
2012-10-13 16:45:37 +00:00
2012-10-15 03:47:37 +00:00
2012-10-15 03:47:37 +00:00
2012-10-18 18:12:40 +00:00
2012-09-27 21:21:28 +00:00
2012-10-18 18:12:40 +00:00
2012-10-18 18:12:40 +00:00
2012-10-13 16:45:32 +00:00
2012-10-13 16:45:32 +00:00
2012-10-13 16:45:32 +00:00
2012-10-15 03:47:37 +00:00
2012-10-15 03:47:37 +00:00
2012-09-27 21:21:31 +00:00
2012-09-27 21:21:31 +00:00
2012-10-13 16:45:37 +00:00
2012-10-13 16:45:37 +00:00
2012-10-11 02:05:23 +00:00
2012-06-22 16:36:43 +00:00
2012-07-02 12:47:22 +00:00
2012-08-28 10:01:43 +00:00
2012-07-02 12:47:22 +00:00
2012-09-27 08:33:56 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-09-28 09:33:53 +00:00
2012-07-02 12:47:22 +00:00
2012-07-02 12:47:22 +00:00
2012-10-15 03:47:37 +00:00
2012-07-02 19:09:46 +00:00
2012-07-02 12:47:22 +00:00
2012-06-26 22:03:13 +00:00
2012-07-02 12:47:22 +00:00