r344765 added those intrinsics, but used the wrong types.
This affects the release_80 branch.
Paths
| Differential D57636
[COFF, ARM64] Fix types for _ReadStatusReg, _WriteStatusReg ClosedPublic Authored by glandium on Feb 1 2019, 7:59 PM.
Details
Summary r344765 added those intrinsics, but used the wrong types. This affects the release_80 branch.
Diff Detail
Event TimelineComment Actions Missing testcase changes. (It should be possible to check that we aren't inserting incorrect truncation/extension operations in the IR.) Comment Actions Thanks for finding out and fixing this. Seems there is also issue in expanding _WriteStatusReg in CodeGenFunction::EmitAArch64BuiltinExpr. The last argument for _WriteStatusReg is zero extended to __in64, which is not expected (see below link). Comment Actions Yes, we should fix CodeGenFunction::EmitAArch64BuiltinExpr to eliminated the unnecessary calls to CreateZext/CreateTrunc. (With this patch, they're no-ops, but better to clean up the code.) Comment Actions
I don't know how to do that. Comment Actions In test/CodeGen/arm64-microsoft-status-reg.cpp, you can write something like // CHECK-IR: %[[VAR:.*]] = call i64 @llvm.read_register.i64(metadata ![[MD2:.*]]), then // CHECK-IR-NEXT: store i64 %[[VAR]] on the next line. See also http://llvm.org/docs/CommandGuide/FileCheck.html . Comment Actions Updated EmitAArch64BuiltinExpr per https://reviews.llvm.org/D57636#1383751 and the testcase per https://reviews.llvm.org/D57636#1384348 Comment Actions @efriedma can you take another look? Ideally, this should be backported to the release_80 branch, so that would need to be landed asap. This revision is now accepted and ready to land.Feb 7 2019, 4:56 PM Comment Actions
Yes, please. Thank you. Closed by commit rL353493: [COFF, ARM64] Fix types for _ReadStatusReg, _WriteStatusReg (authored by efriedma). · Explain WhyFeb 7 2019, 5:17 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 185899 cfe/trunk/include/clang/Basic/BuiltinsAArch64.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/lib/Headers/intrin.h
cfe/trunk/test/CodeGen/arm64-microsoft-status-reg.cpp
|