Bill Wendling
43a6c5e2fc
We have a chance for an optimization. Consider this code:
...
int x(int t) {
if (t & 256)
return -26;
return 0;
}
We generate this:
tst.w r0, #256
mvn r0, #25
it eq
moveq r0, #0
while gcc generates this:
ands r0, r0, #256
it ne
mvnne r0, #25
bx lr
Scandalous really!
During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):
%r0 = ISD::AND ...
ARMISD::CMPZ %r0, 0 @ sets [CPSR]
%r0 = ARMISD::MOVCC 0, -26 @ reads [CPSR]
All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 22:41:22 +00:00
..
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-15 19:04:29 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-15 19:04:29 +00:00
2009-09-09 00:09:15 +00:00
2010-06-17 15:18:27 +00:00
2010-06-15 19:04:29 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-07-14 16:43:47 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-07-30 02:41:01 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-20 00:54:38 +00:00
2010-06-22 01:18:16 +00:00
2010-08-10 19:30:19 +00:00
2010-07-17 03:30:54 +00:00
2010-04-22 23:24:18 +00:00
2009-09-09 00:09:15 +00:00
2010-08-11 17:32:46 +00:00
2010-08-27 17:13:24 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-08-11 07:17:46 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-06-17 15:18:27 +00:00
2010-03-16 16:19:07 +00:00
2010-06-24 15:04:11 +00:00
2010-04-17 16:29:15 +00:00
2010-06-17 15:18:27 +00:00
2010-08-27 17:13:24 +00:00
2010-08-27 17:13:24 +00:00
2009-09-09 00:09:15 +00:00
2010-06-17 15:18:27 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-11-22 15:18:27 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2010-01-05 17:55:26 +00:00
2010-07-20 16:16:48 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2010-07-30 02:41:01 +00:00
2010-08-11 06:22:01 +00:00
2009-11-01 18:13:29 +00:00
2009-10-27 06:31:02 +00:00
2009-09-09 00:09:15 +00:00
2010-05-03 14:35:47 +00:00
2010-08-13 22:43:33 +00:00
2010-06-03 21:57:48 +00:00
2010-06-18 23:09:54 +00:00
2009-10-27 06:31:02 +00:00
2009-10-27 06:31:02 +00:00
2009-11-22 15:18:27 +00:00
2009-09-09 00:09:15 +00:00
2010-08-25 16:58:05 +00:00
2009-10-27 06:31:02 +00:00
2010-06-24 16:50:20 +00:00
2010-08-13 22:43:33 +00:00
2010-06-04 00:03:37 +00:00
2010-06-18 23:09:54 +00:00
2010-06-29 00:55:23 +00:00
2009-11-17 21:24:11 +00:00
2010-06-03 21:53:01 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2010-03-17 17:52:21 +00:00
2009-09-09 00:09:15 +00:00
2009-09-27 09:46:04 +00:00
2010-03-17 17:52:21 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-11-22 15:18:27 +00:00
2009-11-22 15:18:27 +00:00
2009-10-31 22:20:56 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2010-08-31 22:41:22 +00:00
2009-09-09 00:09:15 +00:00
2009-11-22 15:18:27 +00:00
2009-11-22 15:35:28 +00:00
2009-11-22 15:35:28 +00:00
2009-09-09 00:09:15 +00:00
2010-08-17 17:23:19 +00:00
2009-09-09 00:09:15 +00:00
2010-05-05 23:44:43 +00:00
2009-09-09 00:09:15 +00:00
2009-11-22 15:18:27 +00:00
2009-11-22 15:18:27 +00:00
2009-11-22 15:18:27 +00:00
2010-07-14 17:45:16 +00:00
2010-06-18 23:32:07 +00:00
2009-09-09 00:09:15 +00:00
2010-05-05 23:44:43 +00:00
2010-05-05 23:44:43 +00:00
2010-05-05 23:44:43 +00:00
2010-08-27 17:13:24 +00:00
2009-10-27 06:31:02 +00:00
2010-03-17 17:52:21 +00:00
2010-03-17 17:52:21 +00:00
2010-03-17 17:52:21 +00:00
2010-03-17 17:52:21 +00:00
2009-11-22 15:18:27 +00:00
2010-07-14 17:45:16 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00
2010-05-05 23:44:43 +00:00
2009-09-09 00:09:15 +00:00
2010-06-17 15:18:27 +00:00
2009-11-16 20:04:15 +00:00
2009-11-22 15:18:27 +00:00
2009-09-09 00:09:15 +00:00
2009-11-22 15:18:27 +00:00
2010-05-05 23:44:43 +00:00
2010-07-20 16:16:48 +00:00
2009-09-09 00:09:15 +00:00
2009-09-09 00:09:15 +00:00