Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm-c] Improve TargetMachine bindings #70806

Merged
merged 1 commit into from
Nov 1, 2023
Merged

Conversation

dtcxzyw
Copy link
Member

@dtcxzyw dtcxzyw commented Oct 31, 2023

This PR exposes four APIs for TargetMachine:

/** Enable fast-path instruction selection. */
void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable);

/** Enable global instruction selection. */
void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable);

/** Set abort behaviour when global instruction selection fails to lower/select
 * an instruction. */
void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T,
                                         LLVMGlobalISelAbortMode Mode);

/** Enable the MachineOutliner pass. */
void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T,
                                         LLVMBool Enable);

Fixes #70666.

@dexonsmith dexonsmith removed their request for review October 31, 2023 17:10
@dexonsmith
Copy link
Collaborator

(Removed myself from the review list, since I wouldn't say I'm up enough on either TargetMachine or the C API.)

@wjakob
Copy link
Contributor

wjakob commented Oct 31, 2023

Perfect! I have never used the machine outliner and can't comment on how useful that is. But having controllability over FastISel/SelectionDag/GlobalISel is 💯

@dtcxzyw dtcxzyw merged commit 30416f3 into llvm:main Nov 1, 2023
@dtcxzyw dtcxzyw deleted the tm_capi_support branch November 1, 2023 03:44
@dtcxzyw
Copy link
Member Author

dtcxzyw commented Nov 1, 2023

It seems like this commit breaks some build bots. I will fix it later.

@dtcxzyw
Copy link
Member Author

dtcxzyw commented Nov 1, 2023

Oh, it has been addressed by ad1b7a4. @joker-eph Thank you for your fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ORC] FastISel and ORCv2/LLJIT
4 participants