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

Don't override target passed on command-line with target from sysimg for processor_fallback #38883

Merged
merged 1 commit into from
Dec 15, 2020

Conversation

vchuravy
Copy link
Sponsor Member

@vchuravy vchuravy commented Dec 14, 2020

Until #26252 is fixed mark the --cpu-target tests as broken.

Don't override target passed on command-line with target from sysimg for processor_fallback

@vchuravy vchuravy added backport 1.6 Change should be backported to release-1.6 system:powerpc PowerPC labels Dec 14, 2020
@yuyichao
Copy link
Contributor

This check is done by llvm not us. Is jl_get_llvm_target not setting the JL_TARGET_UNKNOWN_NAME flag? Or is MSTI->isCPUStringValid not working?

@vchuravy
Copy link
Sponsor Member Author

jl_get_llvm_target uses the zeroth entry in jit_targets (

flags = jit_targets[0].en.flags;
), which is initialized by sysimg_init_cb
target = sysimg[best_idx];
jit_targets.push_back(std::move(target));

The cmdline target doesn't match -C invalid doesn't match any of the sysimg targets and thus we use the zeroth sysimg target,
which is why the code in jl_init_llvm then sees as a valid target.

@yuyichao
Copy link
Contributor

yuyichao commented Dec 15, 2020

Ah, ok. Yeah, the unconditional target = sysimg[best_idx]; there is a bit wrong. Right now the cmdline flag is mostly ignored.

The system image check should only be used to find the index for system image initialization but not to change the compilation target unless there is ABI issue, e.g. register size. Since we know nothing about the ABI we can just assume there's no such thing. The fix should be simply removing that line.

@yuyichao
Copy link
Contributor

As a bonus, if we found the CPU name in the system image we can probably remove the unknown_name flag. We can assume whoever compiled the system image did so successfully and know what they are doing .....

@vchuravy vchuravy changed the title Mark --cpu-target tests as broken on PPC Don't override target passed on command-line with target from sysimg for processor_fallback Dec 15, 2020
@vchuravy vchuravy merged commit 5bf1665 into master Dec 15, 2020
@vchuravy vchuravy deleted the vc/cmdlineargs_ppc branch December 15, 2020 13:56
@KristofferC KristofferC mentioned this pull request Dec 17, 2020
53 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants