forked from OSchip/llvm-project
a0003984e5
Consider the following instruction: "inst.eq $dst, $src" where ".eq" is an optional flag operand. The $src and $dst operands are registers. If we parse the instruction "inst r0, r1", the flag is not present and it will be marked in the "OptionalOperandsMask" variable. After the matching is complete we call the "convertToMCInst" method. The current implementation works only if the optional operands are at the end of the array. The "Operands" array looks like [token:"inst", reg:r0, reg:r1]. The first operand that must be added to the MCInst is the destination, the r0 register. The "OpIdx" (in the Operands array) for this register is 2. However, since the flag is not present in the Operands, the actual index for r0 should be 1. The flag is not present since we rely on the default value. This patch removes the "NumDefaults" variable and replaces it with an array (DefaultsOffset). This array contains an index for each operand (excluding the mnemonic). At each index, the array contains the number of optional operands that should be subtracted. For the previous example, this array looks like this: [0, 1, 1]. When we need to access the r0 register, we compute its index as 2 - DefaultsOffset[1] = 1. Patch by Alexandru Guduleasa! Reviewers: SamWot, nhaustov, niravd Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35998 llvm-svn: 309949 |
||
---|---|---|
.. | ||
FileCheck | ||
KillTheDoctor | ||
LLVMVisualizers | ||
Misc | ||
PerfectShuffle | ||
TableGen | ||
Target/ARM | ||
bugpoint | ||
count | ||
crosstool | ||
docker | ||
emacs | ||
fpcmp | ||
gdb-scripts | ||
git | ||
git-svn | ||
jedit | ||
kate | ||
lint | ||
lit | ||
llvm-build | ||
llvm-lit | ||
not | ||
release | ||
sanitizers | ||
testgen | ||
textmate | ||
unittest | ||
valgrind | ||
vim | ||
vscode | ||
yaml-bench | ||
DSAclean.py | ||
DSAextract.py | ||
GenLibDeps.pl | ||
GetRepositoryPath | ||
GetSourceVersion | ||
LLVMBuild.txt | ||
UpdateCMakeLists.pl | ||
abtest.py | ||
bisect | ||
bisect-skip-count | ||
check-each-file | ||
clang-parse-diagnostics-file | ||
codegen-diff | ||
countloc.sh | ||
create_ladder_graph.py | ||
extract_symbols.py | ||
findmisopt | ||
findoptdiff | ||
findsym.pl | ||
getsrcs.sh | ||
lldbDataFormatters.py | ||
llvm-compilers-check | ||
llvm-native-gxx | ||
llvm.grm | ||
llvmdo | ||
llvmgrep | ||
makellvm | ||
prepare-code-coverage-artifact.py | ||
schedcover.py | ||
shuffle_fuzz.py | ||
sort_includes.py | ||
test_debuginfo.pl | ||
update_llc_test_checks.py | ||
update_test_checks.py | ||
wciia.py |