]> granicus.if.org Git - clang/commit
[inlineasm] Attach readonly and readnone to inline-asm instructions.
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 10 Jul 2015 18:44:40 +0000 (18:44 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 10 Jul 2015 18:44:40 +0000 (18:44 +0000)
commit7812f26e3326d5855e11f0169694706844c9a1d6
treeaf816b99996dc76cf93b24ac07f41f2a2568d626
parenta474e699b6c58689840f549cc88c08a4099b98da
[inlineasm] Attach readonly and readnone to inline-asm instructions.

Previously, clang/llvm treated inline-asm instructions conservatively,
choosing not to eliminate the instructions or hoisting them out of a loop
even when it was safe to do so. This commit makes changes to attach a
readonly or readnone attribute to an inline-asm instruction, which enables
passes such as LICM and EarlyCSE to move or optimize away the instruction.

rdar://problem/11358192

Differential Revision: http://reviews.llvm.org/D10546

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241930 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmt.cpp
test/CodeGen/asm-attrs.c [new file with mode: 0644]