lewis-revill updated this revision to Diff 215414. lewis-revill edited the summary of this revision. lewis-revill added a comment. Herald added subscribers: s.egerton, lenary, MaskRay.
Rebased prior to commit. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D54295/new/ https://reviews.llvm.org/D54295 Files: lib/Basic/Targets/RISCV.cpp test/CodeGen/riscv-inline-asm.c Index: test/CodeGen/riscv-inline-asm.c =================================================================== --- test/CodeGen/riscv-inline-asm.c +++ test/CodeGen/riscv-inline-asm.c @@ -38,3 +38,9 @@ // CHECK: call void asm sideeffect "", "f"(double [[FLT_ARG]]) asm volatile ("" :: "f"(d)); } + +void test_A(int *p) { +// CHECK-LABEL: define void @test_A(i32* %p) +// CHECK: call void asm sideeffect "", "*A"(i32* %p) + asm volatile("" :: "A"(*p)); +} Index: lib/Basic/Targets/RISCV.cpp =================================================================== --- lib/Basic/Targets/RISCV.cpp +++ lib/Basic/Targets/RISCV.cpp @@ -75,6 +75,10 @@ // A floating-point register. Info.setAllowsRegister(); return true; + case 'A': + // An address that is held in a general-purpose register. + Info.setAllowsMemory(); + return true; } }
Index: test/CodeGen/riscv-inline-asm.c =================================================================== --- test/CodeGen/riscv-inline-asm.c +++ test/CodeGen/riscv-inline-asm.c @@ -38,3 +38,9 @@ // CHECK: call void asm sideeffect "", "f"(double [[FLT_ARG]]) asm volatile ("" :: "f"(d)); } + +void test_A(int *p) { +// CHECK-LABEL: define void @test_A(i32* %p) +// CHECK: call void asm sideeffect "", "*A"(i32* %p) + asm volatile("" :: "A"(*p)); +} Index: lib/Basic/Targets/RISCV.cpp =================================================================== --- lib/Basic/Targets/RISCV.cpp +++ lib/Basic/Targets/RISCV.cpp @@ -75,6 +75,10 @@ // A floating-point register. Info.setAllowsRegister(); return true; + case 'A': + // An address that is held in a general-purpose register. + Info.setAllowsMemory(); + return true; } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits