Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64][GlobalISel] Legalize + select v2p0 -> v264 G_PTRTOINT
1) Just mark this case as legal because it can just be a copy. 2) Ensure the copy in the existing code actually gets selected. Without doing this, we'll crash because the destination won't have a register class. This fell back 35 times in a build of clang with GISel for AArch64. Differential Revision: https://reviews.llvm.org/D108610
- Loading branch information
Jessica Paquette
committed
Aug 24, 2021
1 parent
1275ee3
commit db232de
Showing
4 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
llvm/test/CodeGen/AArch64/GlobalISel/legalize-ptrtoint.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -march=aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
... | ||
--- | ||
name: v2s64_v2p0_legal | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $q0 | ||
; CHECK-LABEL: name: v2s64_v2p0_legal | ||
; CHECK: liveins: $q0 | ||
; CHECK: %ptr:_(<2 x p0>) = COPY $q0 | ||
; CHECK: %int:_(<2 x s64>) = G_PTRTOINT %ptr(<2 x p0>) | ||
; CHECK: $q0 = COPY %int(<2 x s64>) | ||
; CHECK: RET_ReallyLR implicit $q0 | ||
%ptr:_(<2 x p0>) = COPY $q0 | ||
%int:_(<2 x s64>) = G_PTRTOINT %ptr(<2 x p0>) | ||
$q0 = COPY %int(<2 x s64>) | ||
RET_ReallyLR implicit $q0 | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters