When we match a pattern from m_GCst, the register type could be different from original op. So we can't replace the original op to vreg direct.
This code create a new constant with original op type then replace the original op.
Fix #58906
Paths
| Differential D137778
[GlobalISel] Correct constant type in matchReassocConstantInnerLHS ClosedPublic Authored by bcl5980 on Nov 10 2022, 3:33 AM.
Details Summary When we match a pattern from m_GCst, the register type could be different from original op. So we can't replace the original op to vreg direct. Fix #58906
Diff Detail Event Timeline
This revision is now accepted and ready to land.Nov 10 2022, 1:35 PM
bcl5980 added inline comments.
This revision was landed with ongoing or failed builds.Nov 13 2022, 3:20 AM Closed by commit rG84822479006e: [GlobalISel] Correct constant type in matchReassocConstantInnerLHS (authored by bcl5980). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 474495 llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-ptradd-chain.mir
|
If you're going to potentially create a new constant anyway, can you just create the constant and get rid of all this moveBefore stuff?