[PATCH] D31359: [GlobalISel]: Allow backends to custom legalize Intrinsics
Aditya Nandakumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 27 08:41:00 PDT 2017
aditya_nandakumar added inline comments.
================
Comment at: lib/CodeGen/GlobalISel/LegalizerHelper.cpp:81
}
+ Erased |= Res == Erase;
Changed |= Res == Legalized;
----------------
ab wrote:
> I don't think you want this behavior: you should only return "Erase" if you want to erase the "root"/initial MI, not any arbitrary MI in the worklist.
>
> Thought that does raise an interesting question: what happens if you legalize an intrinsic to two new intrinsics, and you want to erase one of those? Who should be responsible for that?
You're right.
The problem is reportGISelFailure for the main instruction. We could perhaps erase instructions that are not MI here (Idx == 0) and fallback to erasing the main instruction after reporting GISelFailure.
Repository:
rL LLVM
https://reviews.llvm.org/D31359
More information about the llvm-commits
mailing list