[clang] [clang][SPIR-V] Set AS for the SPIR-V logical triple (PR #88939)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 12:09:05 PDT 2024


bogner wrote:

> a) Thanks!; b) apologies for the noise; c) this was actually done on purpose, I actively eschewed changing Logical SPIRV because it wasn't actually clear to me if in the long run it'd have the same AS map / would use numerical 1 for globals. If Logical SPIRV is going to go with numerical 1 for globals, LGTM (perhaps it's worth reflecting that in [AutoUpgrade.cpp](https://github.com/llvm/llvm-project/blob/75054525ae58f26c86e418382164540760871186/llvm/lib/IR/AutoUpgrade.cpp#L5346) & associated tests, wherein the predicate guards autoupgrades from occuring on Logical SPIRV)!
> 
> As a sidenote, as far as I can tell, this flared up because in LLVM's [SPIRV TargetMachine](https://github.com/llvm/llvm-project/blob/75054525ae58f26c86e418382164540760871186/llvm/lib/Target/SPIRV/SPIRVTargetMachine.cpp#L56) there's no segregation between Logical & Physical SPIRV. Would it be worthwhile to add that?

@Keenuts Do you have thoughts here? I'm not sure there's been much discussion around this.

I'm going to go ahead and push this as is to get the tests passing and we should follow up as necessary.

https://github.com/llvm/llvm-project/pull/88939


More information about the cfe-commits mailing list