mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
Use pattern information to determine whether the use expects this
instruction to produce a result. e.g MUL8m, the instruction does not produce a explicit result. However it produces an implicit result in AL which would be copied to a temp. The root operator of the matching pattern is a mul so the use would expect it to produce a result. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25458 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dc8d2ab3e9
commit
7419de89fb
@ -2255,10 +2255,13 @@ public:
|
||||
OS << " CodeGenMap[N.getValue(" << ValNo << ")] = InFlag;\n";
|
||||
|
||||
if (AddedChain && HasOutFlag) {
|
||||
if (NumResults == 0) {
|
||||
// Is this pattern expected to produce a result?
|
||||
if (Pattern->getTypeNum(0) == MVT::isVoid ||
|
||||
Pattern->getTypeNum(0) == MVT::Flag) {
|
||||
OS << " return Result.getValue(N.ResNo+1);\n";
|
||||
} else {
|
||||
OS << " if (N.ResNo < " << NumResults << ")\n";
|
||||
OS << " if (N.ResNo < "
|
||||
<< ((NumResults > 1) ? NumResults : 1) << ")\n";
|
||||
OS << " return Result.getValue(N.ResNo);\n";
|
||||
OS << " else\n";
|
||||
OS << " return Result.getValue(N.ResNo+1);\n";
|
||||
|
Loading…
Reference in New Issue
Block a user