[all-commits] [llvm/llvm-project] 11171d: [AMDGPU] Cope with SelectionDAG::UpdateNodeOperand...
Jay Foad via All-commits
all-commits at lists.llvm.org
Wed Sep 6 04:51:58 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 11171d81aeafb0c2818f288900423e366a2787fc
https://github.com/llvm/llvm-project/commit/11171d81aeafb0c2818f288900423e366a2787fc
Author: Jay Foad <jay.foad at amd.com>
Date: 2023-09-06 (Wed, 06 Sep 2023)
Changed paths:
M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
A llvm/test/CodeGen/AMDGPU/adjust-writemask-cse.ll
Log Message:
-----------
[AMDGPU] Cope with SelectionDAG::UpdateNodeOperands returning a different SDNode (#65340)
SITargetLowering::adjustWritemask calls SelectionDAG::UpdateNodeOperands
to update an EXTRACT_SUBREG node in-place to refer to a new IMAGE_LOAD
instruction, before we delete the old IMAGE_LOAD instruction. But in
UpdateNodeOperands can do CSE on the fly and return a different
EXTRACT_SUBREG node, so the original EXTRACT_SUBREG node would still
exist and would refer to the old deleted IMAGE_LOAD instruction. This
caused errors like:
t31: v3i32,ch = <<Deleted Node!>> # D:1
This target-independent node should have been selected!
UNREACHABLE executed at lib/CodeGen/SelectionDAG/InstrEmitter.cpp:1209!
Fix it by detecting the CSE case and replacing all uses of the original
EXTRACT_SUBREG node with the CSE'd one.
More information about the All-commits
mailing list