1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Go to file
Daniel Sanders 1eaf2533cd [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText.
Summary:
This is one possible solution to the problem of ignoring constraints that Simon
raised in D21473 but it's a bit of a hack.

The integrated assembler currently ignores violations of the tied register
constraints when the operands involved in a tie are both present in the AsmText.
For example, 'dati $rs, $rt, $imm' with the '$rs = $rt' will silently replace
$rt with $rs. So 'dati $2, $3, 1' is processed as if the user provided
'dati $2, $2, 1' without any diagnostic being emitted.

This is difficult to solve properly because there are multiple parts of the
matcher that are silently forcing these constraints to be met. Tied operands are
rendered to instructions by cloning previously rendered operands but this is
unnecessary because the matcher was already instructed to render the operand it
would have cloned. This is also unnecessary because earlier code has already
replaced the MCParsedOperand with the one it was tied to (so the parsed input
is matched as if it were 'dati <RegIdx 2>, <RegIdx 2>, <Imm 1>'). As a result,
it looks like fixing this properly amounts to a rewrite of the tied operand
handling which affects all targets.

This patch however, merely inserts a checking hook just before the
substitution of MCParsedOperands and the Mips target overrides it. It's not
possible to accurately check the registers are the same this early (because
numeric registers haven't been bound to a register class yet) so it cheats a
bit and checks that the tokens that produced the operand are lexically
identical. This works because tied registers need to have the same register
class but it does have a flaw. It will reject 'dati $4, $a0, 1' for violating
the constraint even though $a0 ends up as the same register as $4.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

Differential Revision: https://reviews.llvm.org/D21994

llvm-svn: 276867
2016-07-27 13:49:44 +00:00
bindings [OCaml] Add functions for accessing metadata nodes. 2016-06-22 03:30:24 +00:00
cmake [llvm-go] parameterize $GOPATH construction 2016-07-27 03:21:51 +00:00
docs [mips] Update the link to the MIPS documentation in CompilerWriterInfo.rst. 2016-07-27 08:52:15 +00:00
examples [Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3. 2016-07-15 01:39:49 +00:00
include [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText. 2016-07-27 13:49:44 +00:00
lib [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText. 2016-07-27 13:49:44 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources In MSVC builds embed a VERSIONINFO resource in our exe and DLL files. 2015-06-12 15:58:29 +00:00
runtimes [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
test [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText. 2016-07-27 13:49:44 +00:00
tools [llvm-cov] Escape '\' in strings when emitting JSON 2016-07-27 04:08:32 +00:00
unittests MIRParser: Use dot instead of colon to mark subregisters 2016-07-26 21:49:34 +00:00
utils [mips][ias] Check '$rs = $rd' constraints when both registers are in AsmText. 2016-07-27 13:49:44 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.clang-format Test commit. 2014-03-02 13:08:46 +00:00
.clang-tidy Don't use misc-unused-parameters check on LLVM. 2016-04-13 08:58:52 +00:00
.gitignore [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
CMakeLists.txt [CMake] Support feeding DYLD_LIBRARY_PATH into archiver calls 2016-07-25 23:46:08 +00:00
CODE_OWNERS.TXT CODE_OWNERS: Take ownership of the MIPS backend 2016-07-23 17:40:48 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT Update my email address. 2016-05-10 16:23:54 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:41:06 +00:00
llvm.spec.in [Sparc] Implement i64 load/store support for 32-bit sparc. 2015-08-10 19:11:39 +00:00
LLVMBuild.txt
README.txt Revert previous test commit. 2016-01-04 19:13:29 +00:00
RELEASE_TESTERS.TXT Adding RELEASE_TESTERS.TXT 2016-07-21 16:46:44 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.