-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GlobalISel] Do not generate illegal G_SEXTLOADs after legalization
The sext_inreg_of_load combine did not have the isLegalOrBeforeLegalizer check, leading to the generation of potentially illegal G_SEXTLOADs when run after legalization. Reviewed By: foad Differential Revision: https://reviews.llvm.org/D108626
- Loading branch information
1 parent
ea08c4c
commit 4b4bc1e
Showing
2 changed files
with
34 additions
and
0 deletions.
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
22 changes: 22 additions & 0 deletions
22
llvm/test/CodeGen/AMDGPU/GlobalISel/postlegalizer-combiner-sextload-from-sextinreg.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 -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -run-pass=amdgpu-postlegalizer-combiner -verify-machineinstrs -o - %s | FileCheck %s | ||
|
||
# Post-legalizer should not generate illegal extending loads | ||
--- | ||
name: sextload_from_inreg | ||
tracksRegLiveness: true | ||
legalized: true | ||
body: | | ||
bb.0: | ||
liveins: $vgpr0_vgpr1 | ||
; CHECK-LABEL: name: sextload_from_inreg | ||
; CHECK: liveins: $vgpr0_vgpr1 | ||
; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1 | ||
; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[COPY]](p1) :: (load (s64), addrspace 1) | ||
; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[LOAD]], 8 | ||
; CHECK: $vgpr0_vgpr1 = COPY [[SEXT_INREG]](s64) | ||
%0:_(p1) = COPY $vgpr0_vgpr1 | ||
%1:_(s64) = G_LOAD %0 :: (load (s64), align 8, addrspace 1) | ||
%2:_(s64) = G_SEXT_INREG %1, 8 | ||
$vgpr0_vgpr1 = COPY %2 | ||
... |