[llvm] 03954a1 - [AMDGPU] Fix DS_WRITE_B32 patterns
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 19 13:42:27 PST 2020
Author: Stanislav Mekhanoshin
Date: 2020-02-19T13:42:16-08:00
New Revision: 03954a12aecbe77afb9c3ad47620305ec2675858
URL: https://github.com/llvm/llvm-project/commit/03954a12aecbe77afb9c3ad47620305ec2675858
DIFF: https://github.com/llvm/llvm-project/commit/03954a12aecbe77afb9c3ad47620305ec2675858.diff
LOG: [AMDGPU] Fix DS_WRITE_B32 patterns
It uses VGPR_32.RegTypes which includes 16 bit types. As a
result DS_WRITE_B32 may be generated for "store i16" which
is a bug. The only reason we do not hit it now is relative
patterns complexity and sorting. Should DS_WRITE_B16 pattern
complexity become higher and the bug appears.
Differential Revision: https://reviews.llvm.org/D74868
Added:
Modified:
llvm/lib/Target/AMDGPU/DSInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/DSInstructions.td b/llvm/lib/Target/AMDGPU/DSInstructions.td
index ab069c681c97..d8fdce5b79d0 100644
--- a/llvm/lib/Target/AMDGPU/DSInstructions.td
+++ b/llvm/lib/Target/AMDGPU/DSInstructions.td
@@ -725,7 +725,7 @@ defm : DSWritePat_mc <DS_WRITE_B16, i32, "truncstorei16_local">;
defm : DSWritePat_mc <DS_WRITE_B8, i16, "truncstorei8_local">;
defm : DSWritePat_mc <DS_WRITE_B16, i16, "store_local">;
-foreach vt = VGPR_32.RegTypes in {
+foreach vt = Reg32Types.types in {
defm : DSWritePat_mc <DS_WRITE_B32, vt, "store_local">;
}
More information about the llvm-commits
mailing list