FailedChanges

Summary

  1. [lldb] Print the load command that wasn't found in TestSimulatorPlatform (details)
  2. [DebugInfo] Emit DW_OP_implicit_value for Floating point constants (details)
  3. [AArch64][GlobalISel] Handle rtcGPR64RegClassID in AArch64RegisterBankInfo::getRegBankFromRegClass() (details)
  4. Revert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants" (details)
Commit 9f5210aacfec8602beb60f309389e2261b4d3c75 by Jonas Devlieghere
[lldb] Print the load command that wasn't found in TestSimulatorPlatform

Print which load command we were looking for when the sanity check
fails:

  AssertionError: 0 != 1 : wrong number of load commands for
  LC_VERSION_MIN_MACOSX
The file was modifiedlldb/test/API/macosx/simulator/TestSimulatorPlatform.py (diff)
Commit 15801f16194a3da6bc9ae5b869815178993303e7 by SourabhSingh.Tomar
[DebugInfo] Emit DW_OP_implicit_value for Floating point constants

llvm is missing support for DW_OP_implicit_value operation.
DW_OP_implicit_value op is indispensable for cases such as
optimized out long double variables.

For intro refer: DWARFv5 Spec Pg: 40 2.6.1.1.4 Implicit Location Descriptions

Consider the following example:
```
int main() {
        long double ld = 3.14;
        printf("dummy\n");
        ld *= ld;
        return 0;
}
```
when compiled with tunk `clang` as
`clang test.c -g -O1` produces following location description
of variable `ld`:
```
DW_AT_location        (0x00000000:
                     [0x0000000000201691, 0x000000000020169b): DW_OP_constu 0xc8f5c28f5c28f800, DW_OP_stack_value, DW_OP_piece 0x8, DW_OP_constu 0x4000, DW_OP_stack_value, DW_OP_bit_piece 0x10 0x40, DW_OP_stack_value)
                  DW_AT_name    ("ld")
```
Here one may notice that this representation is incorrect(DWARF4
stack could only hold integers(and only up to the size of address)).
Here the variable size itself is `128` bit.
GDB and LLDB confirms this:
```
(gdb) p ld
$1 = <invalid float value>
(lldb) frame variable ld
(long double) ld = <extracting data from value failed>
```

GCC represents/uses DW_OP_implicit_value in these sort of situations.
Based on the discussion with Jakub Jelinek regarding GCC's motivation
for using this, I concluded that DW_OP_implicit_value is most appropriate
in this case.

Link: https://gcc.gnu.org/pipermail/gcc/2020-July/233057.html

GDB seems happy after this patch:(LLDB doesn't have support
for DW_OP_implicit_value)
```
(gdb) p ld
p ld
$1 = 3.14000000000000012434
```

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D83560
The file was addedllvm/test/DebugInfo/X86/implicit_value-double.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfExpression.h (diff)
The file was addedllvm/test/DebugInfo/X86/implicit_value-float.ll
The file was modifiedllvm/test/DebugInfo/X86/float_const_loclist.ll (diff)
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp (diff)
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (diff)
Commit e887d0e89b837be37b4279735a9c1ac57e90c995 by Jessica Paquette
[AArch64][GlobalISel] Handle rtcGPR64RegClassID in AArch64RegisterBankInfo::getRegBankFromRegClass()

TargetRegisterInfo::getMinimalPhysRegClass() returns rtcGPR64RegClassID for X16
and X17, as it's the last matching class. This in turn gets passed to
AArch64RegisterBankInfo::getRegBankFromRegClass(), which hits an unreachable.

It seems sensible to handle this case, so copies from X16 and X17 work.
Copying from X17 is used in inline assembly in libunwind for pointer
authentication.

Differential Revision: https://reviews.llvm.org/D85720
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp (diff)
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/regbankselect-default.mir (diff)
Commit 9937872c02ba1b088a27a880301b6d816d971d16 by SourabhSingh.Tomar
Revert "[DebugInfo] Emit DW_OP_implicit_value for Floating point constants"

This reverts commit 15801f16194a3d.
arc's land messed up! It removed the new commit message and took it
from revision.
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp (diff)
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfExpression.h (diff)
The file was removedllvm/test/DebugInfo/X86/implicit_value-double.ll
The file was removedllvm/test/DebugInfo/X86/implicit_value-float.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (diff)
The file was modifiedllvm/test/DebugInfo/X86/float_const_loclist.ll (diff)