Hal Finkel
6809724935
[InlineAsm] Remove EarlyClobber on registers that are also inputs
...
When an inline asm call has an output register marked as early-clobber, but
that same register is also an input operand, what should we do? GCC accepts
this, and is documented to accept this for read/write operands saying,
"Furthermore, if the earlyclobber operand is also a read/write operand, then
that operand is written only after it's used." For write-only operands, the
situation seems less clear, but I have at least one existing codebase that
assumes this will work, in part because it has syscall macros like this:
({ \
register uint64_t r0 __asm__ ("r0") = (__NR_ ## name); \
register uint64_t r3 __asm__ ("r3") = ((uint64_t) (arg0)); \
register uint64_t r4 __asm__ ("r4") = ((uint64_t) (arg1)); \
register uint64_t r5 __asm__ ("r5") = ((uint64_t) (arg2)); \
__asm__ __volatile__ \
("sc" \
: "=&r"(r0),"=&r"(r3),"=&r"(r4),"=&r"(r5) \
: "0"(r0), "1"(r3), "2"(r4), "3"(r5) \
: "r6","r7","r8","r9","r10","r11","r12","cr0","memory"); \
r3; \
})
Furthermore, with register aliases and subregister relationships that only the
backend knows about, rejecting this in the frontend seems like a difficult
proposition (if we wanted to do so). However, keeping the early-clobber flag on
the INLINEASM MI does not work for us, because it will cause the register's
live interval to end to soon (so it will not appear defined to be used as an
input).
Fortunately, fixing this does not seem hard: When forming the INLINEASM MI,
check to see if any of the early-clobber outputs are also inputs, and if so,
remove the early-clobber flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-20 00:01:30 +00:00
..
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-17 14:50:32 +00:00
2014-10-19 21:29:21 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2014-12-15 19:07:53 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-17 14:50:32 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-19 22:48:57 +00:00
2015-01-06 16:46:37 +00:00
2015-02-27 21:17:42 +00:00
2014-12-15 19:07:53 +00:00
2015-04-11 13:40:36 +00:00
2015-02-27 21:17:42 +00:00
2014-10-03 18:04:36 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-31 10:33:14 +00:00
2015-01-01 02:53:29 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-12-04 00:46:20 +00:00
2015-01-03 01:16:37 +00:00
2015-01-03 01:16:37 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-01-05 03:41:38 +00:00
2014-10-17 01:41:22 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-04 20:44:33 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-27 20:46:33 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-09 23:54:37 +00:00
2015-04-09 23:54:37 +00:00
2015-02-27 21:17:42 +00:00
2014-12-15 19:07:53 +00:00
2015-04-20 00:01:30 +00:00
2015-03-05 18:55:50 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-10 03:39:00 +00:00
2014-10-19 21:29:21 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 18:32:11 +00:00
2015-04-04 02:26:47 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 18:32:11 +00:00
2015-02-27 21:17:42 +00:00
2014-10-17 01:41:22 +00:00
2014-11-24 23:45:21 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-09 18:29:32 +00:00
2015-04-09 18:29:32 +00:00
2014-10-21 13:02:37 +00:00
2014-10-19 20:27:56 +00:00
2014-10-21 23:01:01 +00:00
2014-10-21 23:01:01 +00:00
2014-10-19 21:29:21 +00:00
2014-10-19 21:29:21 +00:00
2014-10-19 21:29:21 +00:00
2015-04-11 10:40:42 +00:00
2015-02-27 21:17:42 +00:00
2015-01-06 06:01:57 +00:00
2014-12-26 16:42:47 +00:00
2015-02-27 21:17:42 +00:00
2014-10-17 01:41:22 +00:00
2014-10-17 01:41:22 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-25 19:36:23 +00:00
2015-01-05 21:10:24 +00:00
2014-10-19 21:29:21 +00:00
2015-02-27 21:17:42 +00:00
2015-01-13 19:43:45 +00:00
2015-01-13 19:43:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-04-10 15:05:02 +00:00
2015-02-27 21:17:42 +00:00
2015-04-12 17:18:56 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-19 02:40:56 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-17 01:41:22 +00:00
2015-04-16 15:43:26 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-17 01:41:22 +00:00
2015-02-27 21:17:42 +00:00
2015-04-15 15:59:37 +00:00
2015-04-16 15:43:26 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:58:28 +00:00
2015-03-31 20:35:26 +00:00
2015-03-31 20:56:09 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2014-12-15 19:07:53 +00:00
2014-12-15 19:07:53 +00:00
2014-12-15 19:07:53 +00:00
2015-02-01 15:03:28 +00:00
2015-02-01 15:03:28 +00:00
2014-12-15 19:07:53 +00:00
2014-12-15 19:07:53 +00:00
2015-02-27 21:17:42 +00:00
2015-02-12 01:02:52 +00:00
2015-02-27 21:17:42 +00:00
2015-04-01 00:40:48 +00:00
2015-02-27 21:17:42 +00:00
2015-02-01 17:52:16 +00:00
2015-04-11 00:33:08 +00:00
2015-02-27 21:17:42 +00:00
2014-12-03 00:19:17 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-17 06:45:15 +00:00
2015-02-27 18:32:11 +00:00
2015-01-18 12:08:47 +00:00
2015-01-19 07:20:27 +00:00
2015-02-27 21:17:42 +00:00
2015-01-14 20:17:10 +00:00
2015-01-14 20:17:10 +00:00
2015-03-05 19:47:50 +00:00
2015-01-15 21:17:34 +00:00
2015-04-16 23:24:18 +00:00
2014-08-23 23:21:04 +00:00
2015-02-01 15:03:28 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-03-05 19:47:50 +00:00
2014-12-11 22:51:06 +00:00
2015-03-13 18:20:45 +00:00
2015-01-25 18:05:42 +00:00
2015-03-05 18:55:50 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-02 22:34:22 +00:00
2015-03-21 03:36:02 +00:00
2015-03-26 00:57:33 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2014-07-31 19:50:53 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 23:29:57 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-25 01:06:45 +00:00
2015-02-25 01:06:45 +00:00
2015-02-25 01:26:59 +00:00
2015-02-27 21:17:42 +00:00
2015-02-25 01:06:45 +00:00
2015-02-25 01:06:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-25 01:26:59 +00:00
2015-02-27 21:17:42 +00:00
2015-03-23 08:22:43 +00:00
2015-02-25 01:26:59 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-21 13:02:37 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-04-16 23:24:18 +00:00
2015-03-13 18:20:45 +00:00
2015-02-10 19:09:05 +00:00
2015-02-27 21:17:42 +00:00
2014-12-16 05:51:41 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-17 01:41:22 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2014-12-23 08:38:50 +00:00
2014-11-12 15:16:30 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 19:29:02 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-02-27 21:17:42 +00:00
2015-02-25 21:36:59 +00:00
2015-02-27 21:17:42 +00:00
2015-03-13 18:20:45 +00:00
2015-04-16 23:24:18 +00:00
2014-10-17 15:13:38 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-10-19 21:29:21 +00:00
2015-03-03 17:24:31 +00:00
2015-02-27 21:17:42 +00:00
2015-04-16 23:24:18 +00:00
2015-02-27 21:17:42 +00:00
2015-03-14 01:43:57 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-05 15:24:47 +00:00
2014-08-04 13:13:57 +00:00
2015-03-03 19:55:45 +00:00
2015-04-03 13:48:24 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-03-03 19:55:45 +00:00
2015-02-27 21:17:42 +00:00
2015-03-10 19:49:38 +00:00
2015-03-10 19:49:38 +00:00
2015-02-27 21:17:42 +00:00
2015-02-04 20:00:04 +00:00
2015-03-05 16:24:38 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-08-04 14:55:26 +00:00
2015-02-20 15:54:58 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-04-03 10:02:21 +00:00
2014-10-19 21:29:21 +00:00
2015-02-12 22:43:52 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-12-05 20:32:05 +00:00
2015-02-27 21:17:42 +00:00
2015-03-27 06:10:13 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2014-12-05 20:32:05 +00:00
2015-04-16 23:24:18 +00:00
2014-12-05 20:32:05 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00
2015-02-18 16:21:46 +00:00
2015-02-27 21:17:42 +00:00
2015-02-27 21:17:42 +00:00