-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Prevent "Target-incompatible DataLayout" LLVM asserts. #33446
Copy link
Copy link
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Example of such an assertion:
Assertion 'TM.isCompatibleDataLayout(getDataLayout()) && "Can't create a MachineFunction using a Module with a " "Target-incompatible DataLayout attached\n"' failed.It appears that since LLVM 3.7,
DataLayoutis checked for target compatibility, and asjoker-ephon LLVM's IRC channel on OFTC explains:The relevant method is
bool TargetMachine::isCompatibleDataLayout(const DataLayout &Candidate).joker-ephsuggests warning and overriding an incompatible data layout with the target default.However, I don't think we can do anything but error because we would've already used the (incompatible) data layout string for determining type layouts.
We can at least provide the target default data layout string for the user in that situation.
cc @alexcrichton