This was ignoring the requested result register, resulting in a
missing def when this happened in the IRTranslator. Fixes some crashes
and verifier errors at -O0.
Alternatively we could pass DstOps to the constant fold functions.
Paths
| Differential D117026
GlobalISel: Fix CSEMIRBuilder mishandling constant folds of vectors ClosedPublic Authored by arsenm on Jan 11 2022, 7:46 AM.
Details Summary This was ignoring the requested result register, resulting in a Alternatively we could pass DstOps to the constant fold functions.
Diff Detail Event TimelineHerald added subscribers: kerbowa, hiraditya, rovka and 2 others. · View Herald TranscriptJan 11 2022, 7:46 AM Comment Actions
If that would avoid building a copy when DstOp is not a register then it sounds better to me. This revision is now accepted and ready to land.Jan 12 2022, 2:43 PM Comment Actions
DstOps is part of the MachineIRBuilder API, so I'm not sure it should be spread to Utils. However since this is using it anyway, why is ConstantFoldVectorBinop in Utils? We could either move the whole function into the MIRBuilder, or have the utils function return a vector of APInt
Revision Contents
Diff 398953 llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
llvm/lib/CodeGen/GlobalISel/Utils.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/combiner-crash.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constant-fold-vector-op.ll
llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-getelementptr.ll
|