[llvm] [SDAG] Merge multiple-result libcall expansion into DAG.expandMultipleResultFPLibCall() (PR #114792)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 4 12:48:04 PST 2024
================
@@ -270,6 +271,15 @@ SDValue VectorLegalizer::LegalizeOp(SDValue Op) {
DenseMap<SDValue, SDValue>::iterator I = LegalizedNodes.find(Op);
if (I != LegalizedNodes.end()) return I->second;
+ // Handle legalizing the root if it changes.
+ auto FixupRoot = make_scope_exit([&, OldRoot = DAG.getRoot()] {
+ SDValue Root = DAG.getRoot();
+ if (Root != OldRoot) {
+ if (SDValue LegalRoot = LegalizeOp(Root))
+ DAG.setRoot(LegalRoot);
+ }
+ });
----------------
MacDue wrote:
Done, I think that's nicer :slightly_smiling_face:
https://github.com/llvm/llvm-project/pull/114792
More information about the llvm-commits
mailing list