r344765 added those intrinsics, but used the wrong types.
This affects the release_80 branch.
Differential D57636
[COFF, ARM64] Fix types for _ReadStatusReg, _WriteStatusReg glandium on Feb 1 2019, 7:59 PM. Authored by
Details
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 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. |