Currently, AMDGPU more or less only supports linking with LTO. If the
user does not either pass -flto or -Wl,-plugin-opt=mcpu= manually
linking will fail because the architecture's aren't compatible. THis
patch simply passes -mcpu by default if it was specified. Should be a
no-op if it's not actually used.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I thought lld did the right thing if you pass it raw IR, without specifying an arch, but on reflection it might just be silently miscompiling things. The test doesn't seem to involve a specific type of input file, does clang foo.ll -o a.out pass a mcpu flag along?
It's a bit weird that the architecture doesn't seem to be embedded in the IR file (e.g. you have to pass it to llc) but that's out of scope here
Comment Actions
it markedly does not work without it. I don't think there's currently facilities to define a module-wide architecture, there's only function-level metadata.