Skip to content

Treat iree-llvmcpu-target-cpu as an error outside of x86, and continue past errors - #15477

Merged
bjacob merged 1 commit into
iree-org:mainfrom
bjacob:cpu-features-aarch64
Nov 8, 2023
Merged

bjacob merged 1 commit into
iree-org:mainfrom
bjacob:cpu-features-aarch64

Conversation

@bjacob

@bjacob bjacob commented Nov 8, 2023

Copy link
Copy Markdown
Collaborator

See the discussion thread below https://discord.com/channels/689900678990135345/1171569395697467403/1171572035336548453 .

Implementing iree-llvmcpu-target-cpu on arm64 is hopeless because Arm CPU names are under-defined. For instance, LLVM thinks that Cortex-A710 implies SVE, but most current Cortex-A710 based devices do not support SVE.

@bjacob
bjacob marked this pull request as ready for review November 8, 2023 02:31
@bjacob
bjacob requested a review from benvanik as a code owner November 8, 2023 02:31
@bjacob
bjacob enabled auto-merge (squash) November 8, 2023 02:33
@bjacob
bjacob merged commit d509096 into iree-org:main Nov 8, 2023
@dcaballe
dcaballe requested a review from hcindyl November 8, 2023 17:10
@dcaballe

dcaballe commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

We have to support --iree-llvmcpu-target-cpu=generic-rv64 and --iree-llvmcpu-target-cpu=generic-rv32, IIUC, but @hcindyl can clarify.

@hcindyl

hcindyl commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

Those flags were introduced in the initial RISCV commit. However, more important flags should be --iree-llvmcpu-target-cpu-features and --iree-llvmcpu-target-triple. I will double check if we really need --iree-llvmcpu-target-cpu for RISCV. However, given the flag values were changed in this PR and all CI tests were okay, we might be able to retire the flag.

@hcindyl

hcindyl commented Nov 8, 2023

Copy link
Copy Markdown
Contributor

It seems the flag is nop in RISCV. I will send out a PR to clean it up.

bjacob added a commit that referenced this pull request Nov 8, 2023
Following #15477, `cpu` is treated
as a x86-only thing, except for the special value `host` that gets
resolved to the actual host CPU and CPU features.

JitGlobals creates a host target, that gets resolved accordingly. The
resolved CPU is then recorded in a `hal.devices.targets` attribute. If
the CPU field is set to the actual host CPU identifier there, then that
will trigger the error message about that being a x86-only thing:

```
error: Resolution of target CPU to target CPU features is not implemented on this target architecture. Pass explicit CPU features instead of a CPU on this architecture, or implement that.
```

So this needs to be left empty in that case. No functional
difference, as that CPU is just ignored anyway (which is what the error
message is about).
ramiro050 pushed a commit to ramiro050/iree that referenced this pull request Dec 19, 2023
…nue past errors (iree-org#15477)

See the discussion thread below
https://discord.com/channels/689900678990135345/1171569395697467403/1171572035336548453
.

Implementing `iree-llvmcpu-target-cpu` on arm64 is hopeless because Arm
CPU names are under-defined. For instance, LLVM thinks that Cortex-A710
implies SVE, but most current Cortex-A710 based devices do not support
SVE.
ramiro050 pushed a commit to ramiro050/iree that referenced this pull request Dec 19, 2023
Following iree-org#15477, `cpu` is treated
as a x86-only thing, except for the special value `host` that gets
resolved to the actual host CPU and CPU features.

JitGlobals creates a host target, that gets resolved accordingly. The
resolved CPU is then recorded in a `hal.devices.targets` attribute. If
the CPU field is set to the actual host CPU identifier there, then that
will trigger the error message about that being a x86-only thing:

```
error: Resolution of target CPU to target CPU features is not implemented on this target architecture. Pass explicit CPU features instead of a CPU on this architecture, or implement that.
```

So this needs to be left empty in that case. No functional
difference, as that CPU is just ignored anyway (which is what the error
message is about).
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.

4 participants