[PATCH] D31359: [GlobalISel]: Allow backends to custom legalize Intrinsics

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 15:35:15 PDT 2017


aditya_nandakumar created this revision.
Herald added subscribers: igorb, kristof.beyls, rovka, dberris.

Add a hook "legalizeInstrinsic" to allow backends to override this and custom lower/legalize intrinsics.
One caveat is the handling of case where target deleted the intrinsic instruction. It is possible that the intrinsic was successfully lowered/legalized but the additional instructions that were created can't be legalized and finally when we try to reportGISelFailure, we might be dealing with a erased instruction.
Instead, the target would return an enum value indicating that the instruction needs to be erased which we can erase after making sure we don't need to reportGISelFailure.
This unfortunately has to expose LegalizeHelper to the backends.

Looking forward to your feedback.


Repository:
  rL LLVM

https://reviews.llvm.org/D31359

Files:
  include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
  include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
  lib/CodeGen/GlobalISel/Legalizer.cpp
  lib/CodeGen/GlobalISel/LegalizerHelper.cpp
  lib/CodeGen/GlobalISel/LegalizerInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31359.93015.patch
Type: text/x-patch
Size: 3887 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170324/06e64638/attachment.bin>


More information about the llvm-commits mailing list