[AsmPrinter] defer %c to base class for ARM, PPC, and Hexagon. NFC
Summary:
None of these derived classes do anything that the base class cannot.
If we remove these case statements, then the base class can handle them
just fine.
Reviewers: peter.smith, echristo
Reviewed By: echristo
Subscribers: nemanjai, javed.absar, eraman, kristof.beyls, hiraditya, kbarton, jsji, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60803
llvm-svn: 358603
2019-04-18 02:22:48 +08:00
|
|
|
; RUN: llc -mtriple=armv7-linux-gnueabi < %s | FileCheck %s
|
|
|
|
|
|
|
|
; Test that %c works with immediates
|
|
|
|
; CHECK-LABEL: test_inlineasm_c_output_template0
|
|
|
|
; CHECK: @TEST 42
|
|
|
|
define dso_local i32 @test_inlineasm_c_output_template0() {
|
|
|
|
tail call void asm sideeffect "@TEST ${0:c}", "i"(i32 42)
|
|
|
|
ret i32 42
|
|
|
|
}
|
|
|
|
|
[AsmPrinter] refactor to support %c w/ GlobalAddress'
Summary:
Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
printing the address of a MachineOperand::MO_GlobalAddress. Move that
handling into a new overriden method in each base class. A virtual
method was added to the base class for handling the generic case.
Refactors a few subclasses to support the target independent %a, %c, and
%n.
The patch also contains small cleanups for AVRAsmPrinter and
SystemZAsmPrinter.
It seems that NVPTXTargetLowering is possibly missing some logic to
transform GlobalAddressSDNodes for
TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
inline assembly asm constraints.
Fixes:
- https://bugs.llvm.org/show_bug.cgi?id=41402
- https://github.com/ClangBuiltLinux/linux/issues/449
Reviewers: echristo, void
Reviewed By: void
Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60887
llvm-svn: 359337
2019-04-27 02:45:04 +08:00
|
|
|
; Test that %c works with global address
|
|
|
|
; CHECK-LABEL: test_inlineasm_c_output_template2
|
|
|
|
; CHECK: @TEST baz
|
|
|
|
@baz = internal global i32 0, align 4
|
|
|
|
define dso_local i32 @test_inlineasm_c_output_template2() {
|
|
|
|
tail call void asm sideeffect "@TEST ${0:c}", "i"(i32* nonnull @baz)
|
|
|
|
ret i32 42
|
|
|
|
}
|
|
|
|
|
[AsmPrinter] defer %c to base class for ARM, PPC, and Hexagon. NFC
Summary:
None of these derived classes do anything that the base class cannot.
If we remove these case statements, then the base class can handle them
just fine.
Reviewers: peter.smith, echristo
Reviewed By: echristo
Subscribers: nemanjai, javed.absar, eraman, kristof.beyls, hiraditya, kbarton, jsji, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60803
llvm-svn: 358603
2019-04-18 02:22:48 +08:00
|
|
|
; Test that %n works with immediates
|
|
|
|
; CHECK-LABEL: test_inlineasm_c_output_template1
|
|
|
|
; CHECK: @TEST -42
|
|
|
|
define dso_local i32 @test_inlineasm_c_output_template1() {
|
|
|
|
tail call void asm sideeffect "@TEST ${0:n}", "i"(i32 42)
|
|
|
|
ret i32 42
|
|
|
|
}
|