diff --git a/crates/metal2vulkan-harness/src/authored.rs b/crates/metal2vulkan-harness/src/authored.rs index 9831d5176..02e2eab49 100644 --- a/crates/metal2vulkan-harness/src/authored.rs +++ b/crates/metal2vulkan-harness/src/authored.rs @@ -7,6 +7,7 @@ use crate::plan::{ SamplerPlan, Scaled, Source, TextureExpect, TexturePlan, Values, }; use crate::{Result, Storage}; +use std::ops::Range; /// An authored workload: its name, and the builder of its plan. A plan holds its inputs and /// expected results (up to 128 MiB), so each is built when it runs. @@ -19,7 +20,7 @@ pub struct Workload { } /// The authored workloads. -pub const WORKLOADS: [Workload; 20] = [ +pub const WORKLOADS: [Workload; 22] = [ Workload { name: "bandwidth", plan: bandwidth, @@ -100,6 +101,14 @@ pub const WORKLOADS: [Workload; 20] = [ name: "vote_loop", plan: vote_loop, }, + Workload { + name: "constant_managed", + plan: constant_managed, + }, + Workload { + name: "constant_private", + plan: constant_private, + }, ]; /// A creation workload: `Shared` buffers of one length made and released in turn, so that each @@ -307,6 +316,7 @@ fn simd_reduce() -> Plan { length: 16, storage: Storage::Shared, contents: Some(vec![0; 16]), + modified: None, }, ], dispatches: vec![ @@ -469,6 +479,7 @@ fn private(contents: Vec) -> BufferPlan { length: contents.len() as u64, storage: Storage::Private, contents: Some(contents), + modified: None, } } @@ -478,6 +489,7 @@ fn unset(length: u64) -> BufferPlan { length, storage: Storage::Private, contents: None, + modified: None, } } @@ -564,6 +576,7 @@ fn lcg_frame( length: 16, storage, contents: Some(word_bytes(&[increment, 0, 0, 0])), + modified: None, }, ], dispatches: vec![dispatch; steps], @@ -716,6 +729,73 @@ fn vote_loop() -> Plan { } } +/// Reads of a 64 KiB table as constants (`constant_reads`): 2^20 threads in threadgroups of 256, +/// each folding 64 of the table's 4,096 entries into a word, the table `Managed`, and the first +/// 256 bytes of it written again by the CPU before each run and marked with `didModifyRange:`, as +/// a program updates a constant buffer a little before each frame. On a GPU with memory of its +/// own, each run reads the table after its update reached the GPU's copy. +fn constant_managed() -> Plan { + constant_reads("constant_managed", Storage::Managed, Some(0..256)) +} + +/// [`constant_managed`]'s reads from a `Private` table that nothing writes after its first run: +/// the reference its time is read against. +fn constant_private() -> Plan { + constant_reads("constant_private", Storage::Private, None) +} + +/// The constant reads of [`constant_managed`] from a table of `storage`, `modified` before each +/// run. +fn constant_reads(name: &str, storage: Storage, modified: Option>) -> Plan { + const THREADS: u32 = 1 << 20; + const ENTRIES: u32 = 4096; + const GROUP: u32 = 256; + let table = words(16, 4 * ENTRIES as usize); + let folded: Vec = (0..THREADS) + .map(|index| { + (0..64).fold(index, |folded, i| { + let at = 4 * ((index + i * 67) & (ENTRIES - 1)) as usize; + let entry = &table[at..at + 4]; + (folded ^ entry[0] ^ entry[1]).wrapping_add(entry[2] ^ entry[3]) + }) + }) + .collect(); + Plan { + name: name.to_owned(), + library: Source::Authored, + buffers: vec![ + BufferPlan { + length: 16 * u64::from(ENTRIES), + storage, + contents: Some(word_bytes(&table)), + modified, + }, + unset(4 * u64::from(THREADS)), + ], + dispatches: vec![Dispatch { + function: "constant_reads".to_owned(), + linked: Vec::new(), + constants: Vec::new(), + bindings: vec![buffer(0, 0), buffer(1, 1)], + grid: Grid::Threadgroups { + groups: [u64::from(THREADS / GROUP), 1, 1], + threads: [u64::from(GROUP), 1, 1], + }, + }], + expect: vec![Expect { + buffer: 1, + values: Values::Words(folded), + }], + textures: Vec::new(), + expect_textures: Vec::new(), + outputs: Vec::new(), + per_command_buffer: None, + per_encoder: None, + commit_to_complete: false, + scaled: None, + } +} + /// Narrow integers: 2^19 threads, each 512 steps of 8- and 16-bit arithmetic (`narrow_mix`), every /// value held in a 32-bit container whose bits above its width the translation clears after each /// step that can set them. The reference runs each thread's steps in Rust's wrapping arithmetic. diff --git a/crates/metal2vulkan-harness/src/description.rs b/crates/metal2vulkan-harness/src/description.rs index 6e532c11c..befa2ffa6 100644 --- a/crates/metal2vulkan-harness/src/description.rs +++ b/crates/metal2vulkan-harness/src/description.rs @@ -7,7 +7,12 @@ //! //! ```text //! workload NAME METALLIB the metallib, a file in the directory -//! buffer LENGTH shared|private FILL the next buffer, numbered from 0 +//! buffer LENGTH STORAGE FILL the next buffer, numbered from 0, its storage shared, +//! managed or private +//! modify BUFFER OFFSET LENGTH before each run, the CPU writes LENGTH bytes of BUFFER +//! at OFFSET again, its starting bytes there, and marks +//! them with didModifyRange: where managed; a shared or +//! managed BUFFER alone //! set-buffer INDEX BUFFER [OFFSET] setBuffer:offset:atIndex: before the next dispatch //! set-bytes INDEX LENGTH FILL setBytes:length:atIndex: before the next dispatch //! threadgroup-length INDEX LENGTH setThreadgroupMemoryLength:atIndex: before the next @@ -60,6 +65,7 @@ use crate::plan::{ }; use crate::{Result, Size, Storage}; use metal2vulkan::metal::{PixelFormat, SamplerAddressMode, TextureType, TextureUsage}; +use std::ops::Range; use std::path::{Path, PathBuf}; /// A workload a description names: its lines, made into its plan when it runs, since a plan @@ -129,25 +135,41 @@ impl Described { }; let mut lines = self.lines.iter().map(|(number, words)| { let words: Vec<&str> = words.iter().map(String::as_str).collect(); - line(&words).map_err(|why| format!("line {number}: {why}")) + (line(&words).map(|line| (*number, line))) + .map_err(|why| format!("line {number}: {why}")) }); // A dispatch at a time: the lines up to it, its bindings and constants among them. loop { let (mut bindings, mut constants, mut linked) = (Vec::new(), Vec::new(), Vec::new()); let dispatch = loop { - match lines.next().transpose()? { - None => break None, - Some(Line::Buffer(buffer)) => plan.buffers.push(buffer), - Some(Line::Texture(texture)) => plan.textures.push(texture), - Some(Line::Binding(binding)) => bindings.push(binding), - Some(Line::Constant(constant)) => constants.push(constant), - Some(Line::Linked(functions)) => linked.extend(functions), - Some(Line::Output(output)) => plan.outputs.push(output), - Some(Line::Dispatch { + let Some((number, line)) = lines.next().transpose()? else { + break None; + }; + match line { + Line::Buffer(buffer) => plan.buffers.push(buffer), + Line::Modify { buffer, range } => { + let Some(made) = plan.buffers.get_mut(buffer) else { + return Err(format!( + "line {number}: modify names buffer {buffer}, which no line \ + before it makes" + ) + .into()); + }; + made.modified = Some(range); + if let Some(problem) = made.modify_problem() { + return Err(format!("line {number}: buffer {buffer}: {problem}").into()); + } + } + Line::Texture(texture) => plan.textures.push(texture), + Line::Binding(binding) => bindings.push(binding), + Line::Constant(constant) => constants.push(constant), + Line::Linked(functions) => linked.extend(functions), + Line::Output(output) => plan.outputs.push(output), + Line::Dispatch { function, grid, repeat, - }) => break Some((function, grid, repeat)), + } => break Some((function, grid, repeat)), } }; let Some((function, grid, repeat)) = dispatch else { @@ -192,6 +214,10 @@ impl Described { /// What a line inside a workload adds to it. enum Line { Buffer(BufferPlan), + Modify { + buffer: usize, + range: Range, + }, Texture(TexturePlan), Binding(Binding), Constant(Constant), @@ -211,18 +237,28 @@ fn line(words: &[&str]) -> std::result::Result { let length = number(length)?; let storage = match *storage { "shared" => Storage::Shared, + "managed" => Storage::Managed, "private" => Storage::Private, - other => return Err(format!("storage {other} is neither shared nor private")), + other => return Err(format!("storage {other} is not shared, managed or private")), }; Line::Buffer(BufferPlan { length, storage, + modified: None, contents: match fill { ["zero"] => None, fill => Some(filled(length, fill)?), }, }) } + ["modify", buffer, offset, length] => { + let (offset, length): (u64, u64) = (number(offset)?, number(length)?); + Line::Modify { + buffer: number(buffer)?, + range: offset..offset.checked_add(length).ok_or("the range does not fit")?, + } + } + ["modify", ..] => return Err("modify takes BUFFER OFFSET LENGTH".to_owned()), ["set-buffer", index, buffer, offset @ ..] => { let offset = match offset { [] => 0, diff --git a/crates/metal2vulkan-harness/src/lib.rs b/crates/metal2vulkan-harness/src/lib.rs index 752af0c2d..51c0e0afe 100644 --- a/crates/metal2vulkan-harness/src/lib.rs +++ b/crates/metal2vulkan-harness/src/lib.rs @@ -13,6 +13,9 @@ //! run, and the buffers runtimes compare. Most workloads put a run in one command buffer; `frame` //! and `frame_5cb` are frames of one and of five command buffers of four small dispatches each, //! the `burst_` workloads bursts of 160 and 2,000, and `long_4cb` four long command buffers. +//! `constant_managed` reads a `Managed` table of constants whose first 256 bytes the CPU writes +//! again before each run (`plan::BufferPlan::modified`), and `constant_private` the same reads +//! from a `Private` table, its reference. //! A [`run::Session`] makes its objects, checks the first run, then times the rest. The authored //! workloads ([`authored`]) are MSL kernels committed as public fixtures //! (`crates/metal2vulkan-validation/fixtures/public/harness/workloads.metal`, compiled by diff --git a/crates/metal2vulkan-harness/src/plan.rs b/crates/metal2vulkan-harness/src/plan.rs index 248386e79..168668e1d 100644 --- a/crates/metal2vulkan-harness/src/plan.rs +++ b/crates/metal2vulkan-harness/src/plan.rs @@ -8,6 +8,7 @@ use metal2vulkan::metal::{ DataType, PixelFormat, SamplerAddressMode, SamplerMinMagFilter, TextureType, TextureUsage, }; use metal2vulkan::pipeline::{FunctionDescriptor, LinkedFunction, LinkedFunctions}; +use std::ops::Range; use std::path::PathBuf; /// One workload. @@ -106,6 +107,27 @@ pub struct BufferPlan { /// `contents`, for `Private` copied in from a `Shared` buffer by the harness's own kernel. /// `None`: as `newBufferWithLength:` made it. pub contents: Option>, + /// The range the CPU writes again before each run, with the buffer's starting bytes there + /// (zero where it has none), and marks with `didModifyRange:` where `Managed`: a program's + /// update of a buffer before each frame. A `Shared` or `Managed` buffer's alone. + pub modified: Option>, +} + +impl BufferPlan { + /// What is wrong with its modified range, if anything. + pub fn modify_problem(&self) -> Option { + let range = self.modified.as_ref()?; + if self.storage == Storage::Private { + return Some("the CPU writes no private buffer".to_owned()); + } + if range.is_empty() || range.end > self.length { + return Some(format!( + "its modified range {range:?} is not within its {} bytes", + self.length + )); + } + None + } } /// `function` with `private` linked as its private functions @@ -591,6 +613,9 @@ impl Plan { ) .into()); } + if let Some(problem) = buffer.modify_problem() { + return Err(format!("{name}: buffer {i}: {problem}").into()); + } if let Some(contents) = &buffer.contents { if contents.len() as u64 != buffer.length { return Err(format!( diff --git a/crates/metal2vulkan-harness/src/rt.rs b/crates/metal2vulkan-harness/src/rt.rs index 8d6f441ec..b11bf51ff 100644 --- a/crates/metal2vulkan-harness/src/rt.rs +++ b/crates/metal2vulkan-harness/src/rt.rs @@ -12,7 +12,8 @@ //! The new runtime has no `Managed` storage, so a `Managed` buffer is a `Private` one here: the //! GPU's copy in device memory, which the harness writes as it writes a `Private` buffer, through //! a `Shared` buffer and its copy kernel, as `didModifyRange:` brings a `Managed` buffer's GPU copy -//! up to date on a Mac with a discrete GPU. It has no CPU copy: its `contents` is `None`. +//! up to date on a Mac with a discrete GPU. It has no CPU copy: its `contents` is `None`, and a +//! plan whose CPU writes such a buffer before each run (`BufferPlan::modified`) is refused. //! //! Its known gaps and the device's limits (`Error::Unsupported`, `Error::Limit`) are typed //! refusals ([`Refused`]); its other errors are failures. diff --git a/crates/metal2vulkan-harness/src/run.rs b/crates/metal2vulkan-harness/src/run.rs index 501060338..2c2ffbf86 100644 --- a/crates/metal2vulkan-harness/src/run.rs +++ b/crates/metal2vulkan-harness/src/run.rs @@ -491,6 +491,11 @@ impl Harness { made: &Made, completions: Option<&Arc>, ) -> Result> { + for (buffer, object) in plan.buffers.iter().zip(&made.buffers) { + if let Some(range) = &buffer.modified { + modify(object, buffer, range)?; + } + } parts(0..plan.dispatches.len(), plan.per_command_buffer) .enumerate() .map(|(place, range)| { @@ -721,6 +726,15 @@ impl Session for Harness { self.texels = Some(self.make_texels()?); } self.fill(&plan.buffers, &made.buffers)?; + for (i, (buffer, object)) in plan.buffers.iter().zip(&made.buffers).enumerate() { + if buffer.modified.is_some() && object.contents().is_none() { + return Err(Box::new(Refused(format!( + "{}: buffer {i}, which the CPU writes before each run, is {:?}, and this \ + runtime gives it no CPU copy", + plan.name, buffer.storage + )))); + } + } self.fill_textures(&plan.textures, &made.textures)?; wait_run::(&self.commit_run(plan, &made, None)?)?; for expect in &plan.expect { @@ -938,6 +952,29 @@ fn write(buffer: &impl Buffer, bytes: &[u8]) -> Result<()> { Ok(()) } +/// The CPU's write of `range` of `buffer` before a run: `plan`'s starting bytes there, or zero +/// where it has none, marked with `didModifyRange:` where `Managed`. The bytes are those the range +/// already holds, so a run still in flight reads the same values. +fn modify(buffer: &impl Buffer, plan: &BufferPlan, range: &Range) -> Result<()> { + let contents = buffer + .contents() + .ok_or("a modified buffer has no contents")?; + let (at, length) = (range.start as usize, (range.end - range.start) as usize); + // SAFETY: `contents` holds the buffer's `plan.length` bytes, `range` is within them + // (`Plan::validate`), and so it is within the starting bytes. + unsafe { + let to = contents.as_ptr().add(at); + match &plan.contents { + Some(bytes) => std::ptr::copy_nonoverlapping(bytes[at..].as_ptr(), to, length), + None => std::ptr::write_bytes(to, 0, length), + } + } + if plan.storage == Storage::Managed { + buffer.did_modify_range(range.start, range.end - range.start)?; + } + Ok(()) +} + /// A copy of the first `length` bytes of the `Shared` buffer `buffer`, which no GPU work writes /// now. fn bytes(buffer: &impl Buffer, length: u64) -> Result> { diff --git a/crates/metal2vulkan-harness/src/tests.rs b/crates/metal2vulkan-harness/src/tests.rs index 937db404f..48bf6e4de 100644 --- a/crates/metal2vulkan-harness/src/tests.rs +++ b/crates/metal2vulkan-harness/src/tests.rs @@ -89,6 +89,7 @@ fn one_buffer_plan(length: u64, contents: Option>, bound: usize) -> Plan length, storage: Storage::Private, contents, + modified: None, }], dispatches: vec![Dispatch { function: "copy_words".to_owned(), @@ -313,6 +314,8 @@ check 1 float 0.5 workload second other.metallib buffer 16 private zero +buffer 64 managed words 3 +modify 1 16 32 texture 2 70 4 2 1 1 shared plain words 5 texture 3 20 2 2 3 3 managed heap zero texture 2 115 16 16 1 0 private over-buffer undefined @@ -408,6 +411,14 @@ fn a_description_makes_its_plans() { )); assert_eq!(second.dispatches[0].linked, ["f", "g"]); assert!(first.dispatches.iter().all(|d| d.linked.is_empty())); + assert_eq!( + ( + second.buffers[1].storage, + second.buffers[1].modified.clone() + ), + (Storage::Managed, Some(16..48)) + ); + assert!(first.buffers.iter().all(|b| b.modified.is_none())); let [words, array, undefined] = second.textures.as_slice() else { panic!("three textures, not {}", second.textures.len()); }; @@ -513,8 +524,24 @@ fn a_faulty_description_is_refused_naming_its_line() { "line 1: workload takes NAME METALLIB" ); assert_eq!( - refusal("buffer 16 managed zero"), - "line 3: storage managed is neither shared nor private" + refusal("buffer 16 memoryless zero"), + "line 3: storage memoryless is not shared, managed or private" + ); + assert_eq!( + refusal("modify 0 0 16"), + "line 3: buffer 0: the CPU writes no private buffer" + ); + assert_eq!( + refusal("modify 1 0 16"), + "line 3: modify names buffer 1, which no line before it makes" + ); + assert_eq!( + refusal("buffer 32 managed zero\nmodify 1 16 32"), + "line 4: buffer 1: its modified range 16..48 is not within its 32 bytes" + ); + assert_eq!( + refusal("modify 0 0"), + "line 3: modify takes BUFFER OFFSET LENGTH" ); assert_eq!( refusal("buffer 16 shared hex 00ff"), diff --git a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.air.ll b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.air.ll index 8f21f7b0e..44a9d839a 100644 --- a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.air.ll +++ b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.air.ll @@ -20,9 +20,9 @@ target triple = "air64_v28-apple-macosx26.0.0" define void @copy_words(<4 x i32> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <4 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #0 { %4 = zext i32 %2 to i64 %5 = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(1)* %0, i64 %4 - %6 = load <4 x i32>, <4 x i32> addrspace(1)* %5, align 16, !tbaa !123, !alias.scope !126, !noalias !129 + %6 = load <4 x i32>, <4 x i32> addrspace(1)* %5, align 16, !tbaa !126, !alias.scope !129, !noalias !132 %7 = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(1)* %1, i64 %4 - store <4 x i32> %6, <4 x i32> addrspace(1)* %7, align 16, !tbaa !123, !alias.scope !129, !noalias !126 + store <4 x i32> %6, <4 x i32> addrspace(1)* %7, align 16, !tbaa !126, !alias.scope !132, !noalias !129 ret void } @@ -30,27 +30,27 @@ define void @copy_words(<4 x i32> addrspace(1)* nocapture noundef readonly "air- define void @scale_offset(<4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <4 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, <2 x float> addrspace(2)* nocapture noundef readonly align 8 dereferenceable(8) "air-buffer-no-alias" %2, i32 noundef %3) local_unnamed_addr #0 { %5 = zext i32 %3 to i64 %6 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %0, i64 %5 - %7 = load <4 x float>, <4 x float> addrspace(1)* %6, align 16, !tbaa !123, !alias.scope !131, !noalias !134 - %8 = load <2 x float>, <2 x float> addrspace(2)* %2, align 8, !alias.scope !137, !noalias !138 + %7 = load <4 x float>, <4 x float> addrspace(1)* %6, align 16, !tbaa !126, !alias.scope !134, !noalias !137 + %8 = load <2 x float>, <2 x float> addrspace(2)* %2, align 8, !alias.scope !140, !noalias !141 %9 = shufflevector <2 x float> %8, <2 x float> undef, <4 x i32> zeroinitializer %10 = fmul fast <4 x float> %9, %7 %11 = shufflevector <2 x float> %8, <2 x float> undef, <4 x i32> %12 = fadd fast <4 x float> %10, %11 %13 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %1, i64 %5 - store <4 x float> %12, <4 x float> addrspace(1)* %13, align 16, !tbaa !123, !alias.scope !139, !noalias !140 + store <4 x float> %12, <4 x float> addrspace(1)* %13, align 16, !tbaa !126, !alias.scope !142, !noalias !143 ret void } ; Function Attrs: argmemonly mustprogress nofree nosync nounwind define void @fma_chains(float addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %0, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #1 { %4 = and i32 %2, 31 - %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #18 + %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = fmul fast float %5, 3.125000e-02 %7 = lshr i32 %2, 5 %8 = and i32 %7, 31 - %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #18 + %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #19 %10 = fmul fast float %9, 3.125000e-02 - %11 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !143, !noalias !146 + %11 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !146, !noalias !149 %12 = icmp eq i32 %11, 0 br i1 %12, label %13, label %19 @@ -60,7 +60,7 @@ define void @fma_chains(float addrspace(1)* nocapture noundef writeonly "air-buf %16 = fadd fast float %15, %14 %17 = zext i32 %2 to i64 %18 = getelementptr inbounds float, float addrspace(1)* %0, i64 %17 - store float %16, float addrspace(1)* %18, align 4, !tbaa !148, !alias.scope !146, !noalias !143 + store float %16, float addrspace(1)* %18, align 4, !tbaa !151, !alias.scope !149, !noalias !146 ret void 19: ; preds = %3, %19 @@ -68,12 +68,12 @@ define void @fma_chains(float addrspace(1)* nocapture noundef writeonly "air-buf %21 = phi float [ %26, %19 ], [ %10, %3 ] %22 = phi float [ %24, %19 ], [ %6, %3 ] %23 = fmul fast float %21, 6.250000e-02 - %24 = tail call fast float @air.fma.f32(float %22, float 9.375000e-01, float %23) #18 + %24 = tail call fast float @air.fma.f32(float %22, float 9.375000e-01, float %23) #19 %25 = fmul fast float %24, 1.250000e-01 - %26 = tail call fast float @air.fma.f32(float %21, float 8.750000e-01, float %25) #18 + %26 = tail call fast float @air.fma.f32(float %21, float 8.750000e-01, float %25) #19 %27 = add nuw i32 %20, 1 %28 = icmp eq i32 %27, %11 - br i1 %28, label %13, label %19, !llvm.loop !150 + br i1 %28, label %13, label %19, !llvm.loop !153 } ; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn @@ -83,16 +83,16 @@ declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #2 define void @block_scan(i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 { %5 = zext i32 %2 to i64 %6 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %5 - %7 = load i32, i32 addrspace(1)* %6, align 4, !tbaa !141, !alias.scope !152, !noalias !155 + %7 = load i32, i32 addrspace(1)* %6, align 4, !tbaa !144, !alias.scope !155, !noalias !158 %8 = zext i32 %3 to i64 %9 = getelementptr inbounds [256 x i32], [256 x i32] addrspace(3)* @_ZZ10block_scanPU9MTLdeviceKjPU9MTLdevicejjjE4sums, i64 0, i64 %8 - store i32 %7, i32 addrspace(3)* %9, align 4, !tbaa !141 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %7, i32 addrspace(3)* %9, align 4, !tbaa !144 + tail call void @air.wg.barrier(i32 2, i32 1) #20 br label %12 10: ; preds = %21 %11 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 %5 - store i32 %23, i32 addrspace(1)* %11, align 4, !tbaa !141, !alias.scope !155, !noalias !152 + store i32 %23, i32 addrspace(1)* %11, align 4, !tbaa !144, !alias.scope !158, !noalias !155 ret void 12: ; preds = %4, %21 @@ -105,35 +105,35 @@ define void @block_scan(i32 addrspace(1)* nocapture noundef readonly "air-buffer %17 = sub i32 %3, %14 %18 = zext i32 %17 to i64 %19 = getelementptr inbounds [256 x i32], [256 x i32] addrspace(3)* @_ZZ10block_scanPU9MTLdeviceKjPU9MTLdevicejjjE4sums, i64 0, i64 %18 - %20 = load i32, i32 addrspace(3)* %19, align 4, !tbaa !141 + %20 = load i32, i32 addrspace(3)* %19, align 4, !tbaa !144 br label %21 21: ; preds = %12, %16 %22 = phi i32 [ %20, %16 ], [ 0, %12 ] - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %23 = add i32 %22, %13 - store i32 %23, i32 addrspace(3)* %9, align 4, !tbaa !141 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %23, i32 addrspace(3)* %9, align 4, !tbaa !144 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %24 = shl nuw nsw i32 %14, 1 %25 = icmp ult i32 %14, 128 - br i1 %25, label %12, label %10, !llvm.loop !157 + br i1 %25, label %12, label %10, !llvm.loop !160 } ; Function Attrs: convergent mustprogress nounwind define void @reduce_sum(i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, <2 x i32> addrspace(2)* nocapture noundef readonly align 8 dereferenceable(8) "air-buffer-no-alias" %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9) local_unnamed_addr #3 { - %11 = load <2 x i32>, <2 x i32> addrspace(2)* %2, align 8, !alias.scope !158, !noalias !161 + %11 = load <2 x i32>, <2 x i32> addrspace(2)* %2, align 8, !alias.scope !161, !noalias !164 %12 = extractelement <2 x i32> %11, i64 1 %13 = mul i32 %12, %3 %14 = add i32 %13, %12 %15 = extractelement <2 x i32> %11, i64 0 - %16 = tail call i32 @air.min.u.i32(i32 %14, i32 %15) #18 + %16 = tail call i32 @air.min.u.i32(i32 %14, i32 %15) #19 %17 = add i32 %13, %4 %18 = icmp ult i32 %17, %16 br i1 %18, label %23, label %19 19: ; preds = %23, %10 %20 = phi i32 [ 0, %10 ], [ %29, %23 ] - %21 = tail call i32 @air.simd_sum.u.i32(i32 %20) #19 + %21 = tail call i32 @air.simd_sum.u.i32(i32 %20) #20 %22 = icmp eq i32 %6, 0 br i1 %22, label %32, label %35 @@ -142,20 +142,20 @@ define void @reduce_sum(i32 addrspace(1)* nocapture noundef readonly "air-buffer %25 = phi i32 [ %29, %23 ], [ 0, %10 ] %26 = zext i32 %24 to i64 %27 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %26 - %28 = load i32, i32 addrspace(1)* %27, align 4, !tbaa !141, !alias.scope !164, !noalias !165 + %28 = load i32, i32 addrspace(1)* %27, align 4, !tbaa !144, !alias.scope !167, !noalias !168 %29 = add i32 %28, %25 %30 = add i32 %24, %5 %31 = icmp ult i32 %30, %16 - br i1 %31, label %23, label %19, !llvm.loop !166 + br i1 %31, label %23, label %19, !llvm.loop !169 32: ; preds = %19 %33 = zext i32 %7 to i64 %34 = getelementptr inbounds [256 x i32], [256 x i32] addrspace(3)* @_ZZ10reduce_sumPU9MTLdeviceKjPU9MTLdevicejRU11MTLconstantKDv2_jjjjjjjjE7partial, i64 0, i64 %33 - store i32 %21, i32 addrspace(3)* %34, align 4, !tbaa !141 + store i32 %21, i32 addrspace(3)* %34, align 4, !tbaa !144 br label %35 35: ; preds = %32, %19 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %36 = icmp eq i32 %7, 0 br i1 %36, label %37, label %54 @@ -165,7 +165,7 @@ define void @reduce_sum(i32 addrspace(1)* nocapture noundef readonly "air-buffer 39: ; preds = %42, %37 %40 = phi i32 [ 0, %37 ], [ %48, %42 ] - %41 = tail call i32 @air.simd_sum.u.i32(i32 %40) #19 + %41 = tail call i32 @air.simd_sum.u.i32(i32 %40) #20 br i1 %22, label %51, label %54 42: ; preds = %37, %42 @@ -173,16 +173,16 @@ define void @reduce_sum(i32 addrspace(1)* nocapture noundef readonly "air-buffer %44 = phi i32 [ %48, %42 ], [ 0, %37 ] %45 = zext i32 %43 to i64 %46 = getelementptr inbounds [256 x i32], [256 x i32] addrspace(3)* @_ZZ10reduce_sumPU9MTLdeviceKjPU9MTLdevicejRU11MTLconstantKDv2_jjjjjjjjE7partial, i64 0, i64 %45 - %47 = load i32, i32 addrspace(3)* %46, align 4, !tbaa !141 + %47 = load i32, i32 addrspace(3)* %46, align 4, !tbaa !144 %48 = add i32 %47, %44 %49 = add i32 %43, %9 %50 = icmp ult i32 %49, %8 - br i1 %50, label %42, label %39, !llvm.loop !167 + br i1 %50, label %42, label %39, !llvm.loop !170 51: ; preds = %39 %52 = zext i32 %3 to i64 %53 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 %52 - store i32 %41, i32 addrspace(1)* %53, align 4, !tbaa !141, !alias.scope !168, !noalias !169 + store i32 %41, i32 addrspace(1)* %53, align 4, !tbaa !144, !alias.scope !171, !noalias !172 br label %54 54: ; preds = %39, %51, %35 @@ -192,7 +192,7 @@ define void @reduce_sum(i32 addrspace(1)* nocapture noundef readonly "air-buffer ; Function Attrs: argmemonly mustprogress nofree nosync nounwind define void @binomial3x3(<4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <4 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, <2 x i32> addrspace(2)* nocapture noundef readonly align 8 dereferenceable(8) "air-buffer-no-alias" %2, <2 x i32> noundef %3) local_unnamed_addr #4 { %5 = extractelement <2 x i32> %3, i64 1 - %6 = load <2 x i32>, <2 x i32> addrspace(2)* %2, align 8, !alias.scope !170, !noalias !173 + %6 = load <2 x i32>, <2 x i32> addrspace(2)* %2, align 8, !alias.scope !173, !noalias !176 %7 = extractelement <2 x i32> %6, i64 1 %8 = add nsw i32 %7, -1 %9 = extractelement <2 x i32> %3, i64 0 @@ -206,14 +206,14 @@ define void @binomial3x3(<4 x float> addrspace(1)* nocapture noundef readonly "a %15 = add i32 %14, %9 %16 = zext i32 %15 to i64 %17 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %1, i64 %16 - store <4 x float> %13, <4 x float> addrspace(1)* %17, align 16, !tbaa !123, !alias.scope !176, !noalias !177 + store <4 x float> %13, <4 x float> addrspace(1)* %17, align 16, !tbaa !126, !alias.scope !179, !noalias !180 ret void 18: ; preds = %4, %26 %19 = phi <4 x float> [ zeroinitializer, %4 ], [ %44, %26 ] %20 = phi i32 [ -1, %4 ], [ %27, %26 ] %21 = add nsw i32 %20, %5 - %22 = tail call i32 @air.clamp.s.i32(i32 %21, i32 0, i32 %8) #18 + %22 = tail call i32 @air.clamp.s.i32(i32 %21, i32 0, i32 %8) #19 %23 = icmp eq i32 %20, 0 %24 = select fast i1 %23, float 2.000000e+00, float 1.000000e+00 %25 = mul i32 %22, %10 @@ -222,38 +222,38 @@ define void @binomial3x3(<4 x float> addrspace(1)* nocapture noundef readonly "a 26: ; preds = %29 %27 = add nsw i32 %20, 1 %28 = icmp eq i32 %27, 2 - br i1 %28, label %12, label %18, !llvm.loop !178 + br i1 %28, label %12, label %18, !llvm.loop !181 29: ; preds = %18, %29 %30 = phi <4 x float> [ %19, %18 ], [ %44, %29 ] %31 = phi i32 [ -1, %18 ], [ %45, %29 ] %32 = add nsw i32 %31, %9 - %33 = tail call i32 @air.clamp.s.i32(i32 %32, i32 0, i32 %11) #18 + %33 = tail call i32 @air.clamp.s.i32(i32 %32, i32 0, i32 %11) #19 %34 = icmp eq i32 %31, 0 %35 = select fast i1 %34, float 2.000000e+00, float 1.000000e+00 %36 = fmul fast float %35, %24 %37 = add i32 %33, %25 %38 = zext i32 %37 to i64 %39 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %0, i64 %38 - %40 = load <4 x float>, <4 x float> addrspace(1)* %39, align 16, !tbaa !123, !alias.scope !179, !noalias !180 + %40 = load <4 x float>, <4 x float> addrspace(1)* %39, align 16, !tbaa !126, !alias.scope !182, !noalias !183 %41 = insertelement <4 x float> poison, float %36, i64 0 %42 = shufflevector <4 x float> %41, <4 x float> poison, <4 x i32> zeroinitializer %43 = fmul fast <4 x float> %42, %40 %44 = fadd fast <4 x float> %43, %30 %45 = add nsw i32 %31, 1 %46 = icmp eq i32 %45, 2 - br i1 %46, label %26, label %29, !llvm.loop !181 + br i1 %46, label %26, label %29, !llvm.loop !184 } ; Function Attrs: argmemonly mustprogress nofree norecurse nosync nounwind willreturn define void @lcg_step(i32 addrspace(1)* nocapture noundef "air-buffer-no-alias" %0, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #0 { %4 = zext i32 %2 to i64 %5 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %4 - %6 = load i32, i32 addrspace(1)* %5, align 4, !tbaa !141, !alias.scope !182, !noalias !185 + %6 = load i32, i32 addrspace(1)* %5, align 4, !tbaa !144, !alias.scope !185, !noalias !188 %7 = mul i32 %6, 1664525 - %8 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !185, !noalias !182 + %8 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !188, !noalias !185 %9 = add i32 %7, %8 - store i32 %9, i32 addrspace(1)* %5, align 4, !tbaa !141, !alias.scope !182, !noalias !185 + store i32 %9, i32 addrspace(1)* %5, align 4, !tbaa !144, !alias.scope !185, !noalias !188 ret void } @@ -264,7 +264,7 @@ define void @narrow_mix(i32 addrspace(1)* nocapture noundef writeonly "air-buffe %6 = xor i16 %4, 23130 %7 = trunc i32 %2 to i8 %8 = lshr i32 %2, 3 - %9 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !187, !noalias !190 + %9 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !190, !noalias !193 %10 = icmp eq i32 %9, 0 br i1 %10, label %11, label %27 @@ -284,7 +284,7 @@ define void @narrow_mix(i32 addrspace(1)* nocapture noundef writeonly "air-buffe %24 = xor i32 %21, %23 %25 = zext i32 %2 to i64 %26 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %25 - store i32 %24, i32 addrspace(1)* %26, align 4, !tbaa !141, !alias.scope !190, !noalias !187 + store i32 %24, i32 addrspace(1)* %26, align 4, !tbaa !144, !alias.scope !193, !noalias !190 ret void 27: ; preds = %3, %27 @@ -309,53 +309,53 @@ define void @narrow_mix(i32 addrspace(1)* nocapture noundef writeonly "air-buffe %46 = add nsw i32 %45, %42 %47 = add nuw i32 %28, 1 %48 = icmp eq i32 %47, %9 - br i1 %48, label %11, label %27, !llvm.loop !192 + br i1 %48, label %11, label %27, !llvm.loop !195 } ; Function Attrs: mustprogress nounwind willreturn define void @texels_in(<4 x float> addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %1, %struct._texture_2d_t addrspace(1)* %2, <2 x i32> noundef %3) local_unnamed_addr #6 { %5 = extractelement <2 x i32> %3, i64 1 - %6 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !193, !noalias !196 + %6 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !196, !noalias !199 %7 = mul i32 %6, %5 %8 = extractelement <2 x i32> %3, i64 0 %9 = add i32 %7, %8 %10 = zext i32 %9 to i64 %11 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %0, i64 %10 - %12 = load <4 x float>, <4 x float> addrspace(1)* %11, align 16, !tbaa !123, !alias.scope !199, !noalias !200 - tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %2, <2 x i32> %3, <4 x float> %12, i32 0, i32 2) #20, !alias.scope !201, !noalias !202 + %12 = load <4 x float>, <4 x float> addrspace(1)* %11, align 16, !tbaa !126, !alias.scope !202, !noalias !203 + tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %2, <2 x i32> %3, <4 x float> %12, i32 0, i32 2) #21, !alias.scope !204, !noalias !205 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn define void @texels_out(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, <4 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %2, <2 x i32> noundef %3) local_unnamed_addr #7 { - %5 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #21 - %6 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* %5, <2 x i32> %3, <2 x i32> zeroinitializer, i32 0, i32 1) #22 + %5 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #22 + %6 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* %5, <2 x i32> %3, <2 x i32> zeroinitializer, i32 0, i32 1) #23 %7 = extractvalue { <4 x float>, i8 } %6, 0 %8 = extractelement <2 x i32> %3, i64 1 - %9 = load i32, i32 addrspace(2)* %2, align 4, !tbaa !141, !alias.scope !203, !noalias !206 + %9 = load i32, i32 addrspace(2)* %2, align 4, !tbaa !144, !alias.scope !206, !noalias !209 %10 = mul i32 %9, %8 %11 = extractelement <2 x i32> %3, i64 0 %12 = add i32 %10, %11 %13 = zext i32 %12 to i64 %14 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %1, i64 %13 - store <4 x float> %7, <4 x float> addrspace(1)* %14, align 16, !tbaa !123, !alias.scope !209, !noalias !210 + store <4 x float> %7, <4 x float> addrspace(1)* %14, align 16, !tbaa !126, !alias.scope !212, !noalias !213 ret void } ; Function Attrs: convergent mustprogress nounwind willreturn define void @sample_down(%struct._texture_2d_t addrspace(1)* %0, %struct._texture_2d_t addrspace(1)* %1, %struct._sampler_t addrspace(2)* nocapture readonly %2, <2 x i32> noundef %3) local_unnamed_addr #8 { - %5 = tail call i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #22, !alias.scope !211, !noalias !214 - %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #18 + %5 = tail call i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #23, !alias.scope !214, !noalias !217 + %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #19 %7 = insertelement <2 x float> undef, float %6, i64 0 - %8 = tail call i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #22, !alias.scope !211, !noalias !214 - %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #18 + %8 = tail call i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #23, !alias.scope !214, !noalias !217 + %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #19 %10 = insertelement <2 x float> %7, float %9, i64 1 - %11 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %3) #18 + %11 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %3) #19 %12 = fadd fast <2 x float> %11, %13 = fdiv fast <2 x float> %12, %10 - %14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* nocapture readonly %2, <2 x float> %13, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #23, !alias.scope !216 + %14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* nocapture readonly %2, <2 x float> %13, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #24, !alias.scope !219 %15 = extractvalue { <4 x float>, i8 } %14, 0 - tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %1, <2 x i32> %3, <4 x float> %15, i32 0, i32 2) #20, !alias.scope !211, !noalias !214 + tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %1, <2 x i32> %3, <4 x float> %15, i32 0, i32 2) #21, !alias.scope !214, !noalias !217 ret void } @@ -364,18 +364,18 @@ declare <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32>) local_unnamed_addr # ; Function Attrs: convergent mustprogress nounwind willreturn define void @sample_up(%struct._texture_2d_t addrspace(1)* %0, %struct._texture_2d_t addrspace(1)* %1, <2 x i32> noundef %2) local_unnamed_addr #8 { - %4 = tail call i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #22, !alias.scope !217 - %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #18 + %4 = tail call i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #23, !alias.scope !220 + %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = insertelement <2 x float> undef, float %5, i64 0 - %7 = tail call i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #22, !alias.scope !217 - %8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #18 + %7 = tail call i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly %1, i32 0) #23, !alias.scope !220 + %8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #19 %9 = insertelement <2 x float> %6, float %8, i64 1 - %10 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %2) #18 + %10 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %2) #19 %11 = fadd fast <2 x float> %10, %12 = fdiv fast <2 x float> %11, %9 - %13 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* nocapture readonly bitcast ([2 x i64] addrspace(2)* @__air_sampler_state to %struct._sampler_t addrspace(2)*), <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #23 + %13 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %0, %struct._sampler_t addrspace(2)* nocapture readonly bitcast ([2 x i64] addrspace(2)* @__air_sampler_state to %struct._sampler_t addrspace(2)*), <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #24 %14 = extractvalue { <4 x float>, i8 } %13, 0 - tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %1, <2 x i32> %2, <4 x float> %14, i32 0, i32 2) #20, !alias.scope !217 + tail call void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture %1, <2 x i32> %2, <4 x float> %14, i32 0, i32 2) #21, !alias.scope !220 ret void } @@ -383,97 +383,97 @@ define void @sample_up(%struct._texture_2d_t addrspace(1)* %0, %struct._texture_ define void @wide_bindings(i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %1, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %2, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %3, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %4, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %5, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %6, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %7, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %8, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %9, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %10, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %11, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %12, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %13, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %14, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %15, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %16, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %17, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %18, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %19, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %20, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %21, i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %22, i32 addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %23, i32 noundef %24) local_unnamed_addr #0 { %26 = zext i32 %24 to i64 %27 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %26 - %28 = load i32, i32 addrspace(1)* %27, align 4, !tbaa !141, !alias.scope !220, !noalias !223 + %28 = load i32, i32 addrspace(1)* %27, align 4, !tbaa !144, !alias.scope !223, !noalias !226 %29 = mul i32 %28, 3 %30 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 %26 - %31 = load i32, i32 addrspace(1)* %30, align 4, !tbaa !141, !alias.scope !247, !noalias !248 + %31 = load i32, i32 addrspace(1)* %30, align 4, !tbaa !144, !alias.scope !250, !noalias !251 %32 = add i32 %29, %31 %33 = mul i32 %32, 3 %34 = getelementptr inbounds i32, i32 addrspace(1)* %2, i64 %26 - %35 = load i32, i32 addrspace(1)* %34, align 4, !tbaa !141, !alias.scope !249, !noalias !250 + %35 = load i32, i32 addrspace(1)* %34, align 4, !tbaa !144, !alias.scope !252, !noalias !253 %36 = add i32 %33, %35 %37 = mul i32 %36, 3 %38 = getelementptr inbounds i32, i32 addrspace(1)* %3, i64 %26 - %39 = load i32, i32 addrspace(1)* %38, align 4, !tbaa !141, !alias.scope !251, !noalias !252 + %39 = load i32, i32 addrspace(1)* %38, align 4, !tbaa !144, !alias.scope !254, !noalias !255 %40 = add i32 %37, %39 %41 = mul i32 %40, 3 %42 = getelementptr inbounds i32, i32 addrspace(1)* %4, i64 %26 - %43 = load i32, i32 addrspace(1)* %42, align 4, !tbaa !141, !alias.scope !253, !noalias !254 + %43 = load i32, i32 addrspace(1)* %42, align 4, !tbaa !144, !alias.scope !256, !noalias !257 %44 = add i32 %41, %43 %45 = mul i32 %44, 3 %46 = getelementptr inbounds i32, i32 addrspace(1)* %5, i64 %26 - %47 = load i32, i32 addrspace(1)* %46, align 4, !tbaa !141, !alias.scope !255, !noalias !256 + %47 = load i32, i32 addrspace(1)* %46, align 4, !tbaa !144, !alias.scope !258, !noalias !259 %48 = add i32 %45, %47 %49 = mul i32 %48, 3 %50 = getelementptr inbounds i32, i32 addrspace(1)* %6, i64 %26 - %51 = load i32, i32 addrspace(1)* %50, align 4, !tbaa !141, !alias.scope !257, !noalias !258 + %51 = load i32, i32 addrspace(1)* %50, align 4, !tbaa !144, !alias.scope !260, !noalias !261 %52 = add i32 %49, %51 %53 = mul i32 %52, 3 %54 = getelementptr inbounds i32, i32 addrspace(1)* %7, i64 %26 - %55 = load i32, i32 addrspace(1)* %54, align 4, !tbaa !141, !alias.scope !259, !noalias !260 + %55 = load i32, i32 addrspace(1)* %54, align 4, !tbaa !144, !alias.scope !262, !noalias !263 %56 = add i32 %53, %55 %57 = mul i32 %56, 3 %58 = getelementptr inbounds i32, i32 addrspace(1)* %8, i64 %26 - %59 = load i32, i32 addrspace(1)* %58, align 4, !tbaa !141, !alias.scope !261, !noalias !262 + %59 = load i32, i32 addrspace(1)* %58, align 4, !tbaa !144, !alias.scope !264, !noalias !265 %60 = add i32 %57, %59 %61 = mul i32 %60, 3 %62 = getelementptr inbounds i32, i32 addrspace(1)* %9, i64 %26 - %63 = load i32, i32 addrspace(1)* %62, align 4, !tbaa !141, !alias.scope !263, !noalias !264 + %63 = load i32, i32 addrspace(1)* %62, align 4, !tbaa !144, !alias.scope !266, !noalias !267 %64 = add i32 %61, %63 %65 = mul i32 %64, 3 %66 = getelementptr inbounds i32, i32 addrspace(1)* %10, i64 %26 - %67 = load i32, i32 addrspace(1)* %66, align 4, !tbaa !141, !alias.scope !265, !noalias !266 + %67 = load i32, i32 addrspace(1)* %66, align 4, !tbaa !144, !alias.scope !268, !noalias !269 %68 = add i32 %65, %67 %69 = mul i32 %68, 3 %70 = getelementptr inbounds i32, i32 addrspace(1)* %11, i64 %26 - %71 = load i32, i32 addrspace(1)* %70, align 4, !tbaa !141, !alias.scope !267, !noalias !268 + %71 = load i32, i32 addrspace(1)* %70, align 4, !tbaa !144, !alias.scope !270, !noalias !271 %72 = add i32 %69, %71 %73 = mul i32 %72, 3 %74 = getelementptr inbounds i32, i32 addrspace(1)* %12, i64 %26 - %75 = load i32, i32 addrspace(1)* %74, align 4, !tbaa !141, !alias.scope !269, !noalias !270 + %75 = load i32, i32 addrspace(1)* %74, align 4, !tbaa !144, !alias.scope !272, !noalias !273 %76 = add i32 %73, %75 %77 = mul i32 %76, 3 %78 = getelementptr inbounds i32, i32 addrspace(1)* %13, i64 %26 - %79 = load i32, i32 addrspace(1)* %78, align 4, !tbaa !141, !alias.scope !271, !noalias !272 + %79 = load i32, i32 addrspace(1)* %78, align 4, !tbaa !144, !alias.scope !274, !noalias !275 %80 = add i32 %77, %79 %81 = mul i32 %80, 3 %82 = getelementptr inbounds i32, i32 addrspace(1)* %14, i64 %26 - %83 = load i32, i32 addrspace(1)* %82, align 4, !tbaa !141, !alias.scope !273, !noalias !274 + %83 = load i32, i32 addrspace(1)* %82, align 4, !tbaa !144, !alias.scope !276, !noalias !277 %84 = add i32 %81, %83 %85 = mul i32 %84, 3 %86 = getelementptr inbounds i32, i32 addrspace(1)* %15, i64 %26 - %87 = load i32, i32 addrspace(1)* %86, align 4, !tbaa !141, !alias.scope !275, !noalias !276 + %87 = load i32, i32 addrspace(1)* %86, align 4, !tbaa !144, !alias.scope !278, !noalias !279 %88 = add i32 %85, %87 %89 = mul i32 %88, 3 %90 = getelementptr inbounds i32, i32 addrspace(1)* %16, i64 %26 - %91 = load i32, i32 addrspace(1)* %90, align 4, !tbaa !141, !alias.scope !277, !noalias !278 + %91 = load i32, i32 addrspace(1)* %90, align 4, !tbaa !144, !alias.scope !280, !noalias !281 %92 = add i32 %89, %91 %93 = mul i32 %92, 3 %94 = getelementptr inbounds i32, i32 addrspace(1)* %17, i64 %26 - %95 = load i32, i32 addrspace(1)* %94, align 4, !tbaa !141, !alias.scope !279, !noalias !280 + %95 = load i32, i32 addrspace(1)* %94, align 4, !tbaa !144, !alias.scope !282, !noalias !283 %96 = add i32 %93, %95 %97 = mul i32 %96, 3 %98 = getelementptr inbounds i32, i32 addrspace(1)* %18, i64 %26 - %99 = load i32, i32 addrspace(1)* %98, align 4, !tbaa !141, !alias.scope !281, !noalias !282 + %99 = load i32, i32 addrspace(1)* %98, align 4, !tbaa !144, !alias.scope !284, !noalias !285 %100 = add i32 %97, %99 %101 = mul i32 %100, 3 %102 = getelementptr inbounds i32, i32 addrspace(1)* %19, i64 %26 - %103 = load i32, i32 addrspace(1)* %102, align 4, !tbaa !141, !alias.scope !283, !noalias !284 + %103 = load i32, i32 addrspace(1)* %102, align 4, !tbaa !144, !alias.scope !286, !noalias !287 %104 = add i32 %101, %103 %105 = mul i32 %104, 3 %106 = getelementptr inbounds i32, i32 addrspace(1)* %20, i64 %26 - %107 = load i32, i32 addrspace(1)* %106, align 4, !tbaa !141, !alias.scope !285, !noalias !286 + %107 = load i32, i32 addrspace(1)* %106, align 4, !tbaa !144, !alias.scope !288, !noalias !289 %108 = add i32 %105, %107 %109 = mul i32 %108, 3 %110 = getelementptr inbounds i32, i32 addrspace(1)* %21, i64 %26 - %111 = load i32, i32 addrspace(1)* %110, align 4, !tbaa !141, !alias.scope !287, !noalias !288 + %111 = load i32, i32 addrspace(1)* %110, align 4, !tbaa !144, !alias.scope !290, !noalias !291 %112 = add i32 %109, %111 %113 = mul i32 %112, 3 %114 = getelementptr inbounds i32, i32 addrspace(1)* %22, i64 %26 - %115 = load i32, i32 addrspace(1)* %114, align 4, !tbaa !141, !alias.scope !289, !noalias !290 + %115 = load i32, i32 addrspace(1)* %114, align 4, !tbaa !144, !alias.scope !292, !noalias !293 %116 = add i32 %113, %115 %117 = getelementptr inbounds i32, i32 addrspace(1)* %23, i64 %26 - store i32 %116, i32 addrspace(1)* %117, align 4, !tbaa !141, !alias.scope !291, !noalias !292 + store i32 %116, i32 addrspace(1)* %117, align 4, !tbaa !144, !alias.scope !294, !noalias !295 ret void } @@ -483,33 +483,33 @@ define void @wave_store(i32 addrspace(1)* nocapture noundef writeonly "air-buffe %5 = mul i32 %4, 5600 %6 = extractelement <2 x i32> %2, i64 0 %7 = add i32 %5, %6 - %8 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !293, !noalias !296 + %8 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !296, !noalias !299 %9 = add i32 %8, %7 %10 = zext i32 %7 to i64 %11 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %10 - store i32 %9, i32 addrspace(1)* %11, align 4, !tbaa !141, !alias.scope !296, !noalias !293 + store i32 %9, i32 addrspace(1)* %11, align 4, !tbaa !144, !alias.scope !299, !noalias !296 ret void } ; Function Attrs: mustprogress nofree nosync nounwind define void @signed_zero_products(<4 x float> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %0, i32 addrspace(2)* nocapture noundef readonly align 4 dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #10 { %4 = and i32 %2, 63 - %5 = tail call float @air.convert.f.f32.u.i32(i32 %4) #18 + %5 = tail call float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = lshr i32 %2, 6 %7 = and i32 %6, 63 - %8 = tail call float @air.convert.f.f32.u.i32(i32 %7) #18 + %8 = tail call float @air.convert.f.f32.u.i32(i32 %7) #19 %9 = fneg fast float %8 %10 = insertelement <4 x float> , float %5, i64 0 %11 = insertelement <4 x float> %10, float %9, i64 1 - %12 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !141, !alias.scope !298, !noalias !301 + %12 = load i32, i32 addrspace(2)* %1, align 4, !tbaa !144, !alias.scope !301, !noalias !304 %13 = icmp eq i32 %12, 0 br i1 %13, label %21, label %14 14: ; preds = %3 - %15 = load float, float addrspace(2)* @_ZL13positive_zero, align 4, !tbaa !148 + %15 = load float, float addrspace(2)* @_ZL13positive_zero, align 4, !tbaa !151 %16 = insertelement <4 x float> poison, float %15, i64 0 %17 = shufflevector <4 x float> %16, <4 x float> poison, <4 x i32> zeroinitializer - %18 = load float, float addrspace(2)* @_ZL13negative_zero, align 4, !tbaa !148 + %18 = load float, float addrspace(2)* @_ZL13negative_zero, align 4, !tbaa !151 %19 = insertelement <4 x float> poison, float %18, i64 0 %20 = shufflevector <4 x float> %19, <4 x float> poison, <4 x i32> zeroinitializer br label %27 @@ -520,7 +520,7 @@ define void @signed_zero_products(<4 x float> addrspace(1)* nocapture noundef wr %24 = fadd <4 x float> %22, %23 %25 = zext i32 %2 to i64 %26 = getelementptr inbounds <4 x float>, <4 x float> addrspace(1)* %0, i64 %25 - store <4 x float> %24, <4 x float> addrspace(1)* %26, align 16, !tbaa !123, !alias.scope !301, !noalias !298 + store <4 x float> %24, <4 x float> addrspace(1)* %26, align 16, !tbaa !126, !alias.scope !304, !noalias !301 ret void 27: ; preds = %14, %27 @@ -531,17 +531,17 @@ define void @signed_zero_products(<4 x float> addrspace(1)* nocapture noundef wr %32 = fmul <4 x float> %20, %28 %33 = fadd <4 x float> %29, %31 %34 = fsub <4 x float> %33, %32 - %35 = tail call fast <4 x float> @air.fma.v4f32(<4 x float> %28, <4 x float> , <4 x float> ) #18 + %35 = tail call fast <4 x float> @air.fma.v4f32(<4 x float> %28, <4 x float> , <4 x float> ) #19 %36 = add nuw i32 %30, 1 %37 = icmp eq i32 %36, %12 - br i1 %37, label %21, label %27, !llvm.loop !303 + br i1 %37, label %21, label %27, !llvm.loop !306 } ; Function Attrs: convergent mustprogress nounwind define void @vote_loop(i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, <2 x i32> addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #11 { %5 = zext i32 %2 to i64 %6 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %5 - %7 = load i32, i32 addrspace(1)* %6, align 4, !tbaa !141, !alias.scope !304, !noalias !307 + %7 = load i32, i32 addrspace(1)* %6, align 4, !tbaa !144, !alias.scope !307, !noalias !310 %8 = icmp eq i32 %7, 0 br i1 %8, label %9, label %14 @@ -550,7 +550,7 @@ define void @vote_loop(i32 addrspace(1)* nocapture noundef readonly "air-buffer- %11 = insertelement <2 x i32> undef, i32 %10, i64 0 %12 = insertelement <2 x i32> %11, i32 %3, i64 1 %13 = getelementptr inbounds <2 x i32>, <2 x i32> addrspace(1)* %1, i64 %5 - store <2 x i32> %12, <2 x i32> addrspace(1)* %13, align 8, !tbaa !123, !alias.scope !307, !noalias !304 + store <2 x i32> %12, <2 x i32> addrspace(1)* %13, align 8, !tbaa !126, !alias.scope !310, !noalias !307 ret void 14: ; preds = %4, %14 @@ -558,21 +558,21 @@ define void @vote_loop(i32 addrspace(1)* nocapture noundef readonly "air-buffer- %16 = phi i32 [ %18, %14 ], [ %2, %4 ] %17 = mul i32 %16, 1664525 %18 = add i32 %17, 1013904223 - tail call void @air.simdgroup.barrier(i32 0, i32 4) #19 + tail call void @air.simdgroup.barrier(i32 0, i32 4) #20 %19 = add nuw i32 %15, 1 %20 = icmp eq i32 %19, %7 - br i1 %20, label %9, label %14, !llvm.loop !309 + br i1 %20, label %9, label %14, !llvm.loop !312 } ; Function Attrs: convergent mustprogress nounwind define void @group_sums(i32 addrspace(1)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 addrspace(3)* nocapture noundef "air-buffer-no-alias" %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #11 { %8 = zext i32 %6 to i64 %9 = getelementptr inbounds i32, i32 addrspace(1)* %0, i64 %8 - %10 = load i32, i32 addrspace(1)* %9, align 4, !tbaa !141, !alias.scope !310, !noalias !313 + %10 = load i32, i32 addrspace(1)* %9, align 4, !tbaa !144, !alias.scope !313, !noalias !316 %11 = zext i32 %3 to i64 %12 = getelementptr inbounds i32, i32 addrspace(3)* %2, i64 %11 - store i32 %10, i32 addrspace(3)* %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %10, i32 addrspace(3)* %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %13 = icmp ult i32 %4, 2 br i1 %13, label %14, label %16 @@ -590,33 +590,65 @@ define void @group_sums(i32 addrspace(1)* nocapture noundef readonly "air-buffer %21 = add i32 %18, %3 %22 = zext i32 %21 to i64 %23 = getelementptr inbounds i32, i32 addrspace(3)* %2, i64 %22 - %24 = load i32, i32 addrspace(3)* %23, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - %25 = load i32, i32 addrspace(3)* %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 + %24 = load i32, i32 addrspace(3)* %23, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + %25 = load i32, i32 addrspace(3)* %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 %26 = add i32 %25, %24 - store i32 %26, i32 addrspace(3)* %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 + store i32 %26, i32 addrspace(3)* %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 br label %27 27: ; preds = %20, %16 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %28 = icmp ult i32 %17, 4 - br i1 %28, label %14, label %16, !llvm.loop !318 + br i1 %28, label %14, label %16, !llvm.loop !321 29: ; preds = %14 %30 = zext i32 %5 to i64 %31 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 %30 - %32 = load i32, i32 addrspace(3)* %2, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - store i32 %32, i32 addrspace(1)* %31, align 4, !tbaa !141, !alias.scope !319, !noalias !320 + %32 = load i32, i32 addrspace(3)* %2, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + store i32 %32, i32 addrspace(1)* %31, align 4, !tbaa !144, !alias.scope !322, !noalias !323 br label %33 33: ; preds = %29, %14 ret void } +; Function Attrs: argmemonly mustprogress nofree norecurse nosync nounwind +define void @constant_reads(<4 x i32> addrspace(2)* nocapture noundef readonly "air-buffer-no-alias" %0, i32 addrspace(1)* nocapture noundef writeonly "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #12 { + br label %7 + +4: ; preds = %7 + %5 = zext i32 %2 to i64 + %6 = getelementptr inbounds i32, i32 addrspace(1)* %1, i64 %5 + store i32 %23, i32 addrspace(1)* %6, align 4, !tbaa !144, !alias.scope !324, !noalias !327 + ret void + +7: ; preds = %3, %7 + %8 = phi i32 [ %2, %3 ], [ %23, %7 ] + %9 = phi i32 [ 0, %3 ], [ %24, %7 ] + %10 = mul nuw nsw i32 %9, 67 + %11 = add i32 %10, %2 + %12 = and i32 %11, 4095 + %13 = zext i32 %12 to i64 + %14 = getelementptr inbounds <4 x i32>, <4 x i32> addrspace(2)* %0, i64 %13 + %15 = load <4 x i32>, <4 x i32> addrspace(2)* %14, align 16, !tbaa !126, !alias.scope !327, !noalias !324 + %16 = extractelement <4 x i32> %15, i64 0 + %17 = xor i32 %16, %8 + %18 = extractelement <4 x i32> %15, i64 1 + %19 = xor i32 %17, %18 + %20 = extractelement <4 x i32> %15, i64 2 + %21 = extractelement <4 x i32> %15, i64 3 + %22 = xor i32 %20, %21 + %23 = add i32 %19, %22 + %24 = add nuw nsw i32 %9, 1 + %25 = icmp eq i32 %24, 64 + br i1 %25, label %4, label %7, !llvm.loop !329 +} + ; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn declare float @air.fma.f32(float, float, float) local_unnamed_addr #2 ; Function Attrs: convergent mustprogress nounwind willreturn -declare void @air.wg.barrier(i32, i32) local_unnamed_addr #12 +declare void @air.wg.barrier(i32, i32) local_unnamed_addr #13 ; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn declare i32 @air.min.u.i32(i32, i32) local_unnamed_addr #2 @@ -628,35 +660,35 @@ declare i32 @air.clamp.s.i32(i32, i32, i32) local_unnamed_addr #2 declare <4 x float> @air.fma.v4f32(<4 x float>, <4 x float>, <4 x float>) local_unnamed_addr #2 ; Function Attrs: convergent mustprogress nounwind willreturn -declare void @air.simdgroup.barrier(i32, i32) local_unnamed_addr #12 +declare void @air.simdgroup.barrier(i32, i32) local_unnamed_addr #13 ; Function Attrs: convergent mustprogress nounwind willreturn -declare i32 @air.simd_sum.u.i32(i32) local_unnamed_addr #12 +declare i32 @air.simd_sum.u.i32(i32) local_unnamed_addr #13 ; Function Attrs: argmemonly mustprogress nounwind willreturn -declare void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture, <2 x i32>, <4 x float>, i32, i32) local_unnamed_addr #13 +declare void @air.write_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture, <2 x i32>, <4 x float>, i32, i32) local_unnamed_addr #14 ; Function Attrs: inaccessiblememonly mustprogress nofree nounwind readonly willreturn -declare %struct._sampler_t addrspace(2)* @air.get_read_sampler() local_unnamed_addr #14 +declare %struct._sampler_t addrspace(2)* @air.get_read_sampler() local_unnamed_addr #15 ; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn -declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)*, <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #15 +declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)*, <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #16 ; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn -declare i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly, i32) local_unnamed_addr #15 +declare i32 @air.get_width_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly, i32) local_unnamed_addr #16 ; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn -declare i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly, i32) local_unnamed_addr #15 +declare i32 @air.get_height_texture_2d(%struct._texture_2d_t addrspace(1)* nocapture readonly, i32) local_unnamed_addr #16 ; Function Attrs: argmemonly convergent mustprogress nofree nounwind readonly willreturn -declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #16 +declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #17 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn writeonly -define internal void @_GLOBAL__sub_I__() #17 section "air.static_init" { - %1 = load float, float addrspace(2)* @_Z13positive_zero.MTL_FC_INIT_0_f, align 4, !tbaa !148 - store float %1, float addrspace(2)* @_ZL13positive_zero, align 4, !tbaa !148 - %2 = load float, float addrspace(2)* @_Z13negative_zero.MTL_FC_INIT_1_f, align 4, !tbaa !148 - store float %2, float addrspace(2)* @_ZL13negative_zero, align 4, !tbaa !148 +define internal void @_GLOBAL__sub_I__() #18 section "air.static_init" { + %1 = load float, float addrspace(2)* @_Z13positive_zero.MTL_FC_INIT_0_f, align 4, !tbaa !151 + store float %1, float addrspace(2)* @_ZL13positive_zero, align 4, !tbaa !151 + %2 = load float, float addrspace(2)* @_Z13negative_zero.MTL_FC_INIT_1_f, align 4, !tbaa !151 + store float %2, float addrspace(2)* @_ZL13negative_zero, align 4, !tbaa !151 ret void } @@ -672,27 +704,28 @@ attributes #8 = { convergent mustprogress nounwind willreturn "approx-func-fp-ma attributes #9 = { argmemonly mustprogress nofree norecurse nosync nounwind willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="64" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } attributes #10 = { mustprogress nofree nosync nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } attributes #11 = { convergent mustprogress nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } -attributes #12 = { convergent mustprogress nounwind willreturn } -attributes #13 = { argmemonly mustprogress nounwind willreturn } -attributes #14 = { inaccessiblememonly mustprogress nofree nounwind readonly willreturn } -attributes #15 = { argmemonly mustprogress nofree nounwind readonly willreturn } -attributes #16 = { argmemonly convergent mustprogress nofree nounwind readonly willreturn } -attributes #17 = { mustprogress nofree norecurse nosync nounwind willreturn writeonly "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } -attributes #18 = { nounwind readnone willreturn } -attributes #19 = { convergent nounwind willreturn } -attributes #20 = { argmemonly nounwind willreturn } -attributes #21 = { inaccessiblememonly nounwind readonly willreturn } -attributes #22 = { argmemonly nounwind readonly willreturn } -attributes #23 = { argmemonly convergent nounwind readonly willreturn } +attributes #12 = { argmemonly mustprogress nofree norecurse nosync nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } +attributes #13 = { convergent mustprogress nounwind willreturn } +attributes #14 = { argmemonly mustprogress nounwind willreturn } +attributes #15 = { inaccessiblememonly mustprogress nofree nounwind readonly willreturn } +attributes #16 = { argmemonly mustprogress nofree nounwind readonly willreturn } +attributes #17 = { argmemonly convergent mustprogress nofree nounwind readonly willreturn } +attributes #18 = { mustprogress nofree norecurse nosync nounwind willreturn writeonly "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #19 = { nounwind readnone willreturn } +attributes #20 = { convergent nounwind willreturn } +attributes #21 = { argmemonly nounwind willreturn } +attributes #22 = { inaccessiblememonly nounwind readonly willreturn } +attributes #23 = { argmemonly nounwind readonly willreturn } +attributes #24 = { argmemonly convergent nounwind readonly willreturn } !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} -!air.kernel = !{!9, !15, !21, !25, !30, !40, !44, !48, !51, !55, !60, !65, !68, !95, !98, !101, !106} -!air.compile_options = !{!114, !115, !116} -!air.function_constants = !{!117, !118} -!air.sampler_states = !{!119} -!llvm.ident = !{!120} -!air.version = !{!121} -!air.language_version = !{!122} +!air.kernel = !{!9, !15, !21, !25, !30, !40, !44, !48, !51, !55, !60, !65, !68, !95, !98, !101, !106, !114} +!air.compile_options = !{!117, !118, !119} +!air.function_constants = !{!120, !121} +!air.sampler_states = !{!122} +!llvm.ident = !{!123} +!air.version = !{!124} +!air.language_version = !{!125} !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} !1 = !{i32 1, !"wchar_size", i32 4} @@ -808,210 +841,219 @@ attributes #23 = { argmemonly convergent nounwind readonly willreturn } !111 = !{i32 4, !"air.threads_per_threadgroup", !"air.arg_type_name", !"uint", !"air.arg_name", !"size"} !112 = !{i32 5, !"air.threadgroup_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"group"} !113 = !{i32 6, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"} -!114 = !{!"air.compile.denorms_disable"} -!115 = !{!"air.compile.fast_math_enable"} -!116 = !{!"air.compile.framebuffer_fetch_enable"} -!117 = !{float addrspace(2)* @_Z13positive_zero.MTL_FC_INIT_0_f, !"float", !"positive_zero", i32 0} -!118 = !{float addrspace(2)* @_Z13negative_zero.MTL_FC_INIT_1_f, !"float", !"negative_zero", i32 1} -!119 = !{!"air.sampler_state", [2 x i64] addrspace(2)* @__air_sampler_state} -!120 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} -!121 = !{i32 2, i32 8, i32 0} -!122 = !{!"Metal", i32 4, i32 0, i32 0} -!123 = !{!124, !124, i64 0} -!124 = !{!"omnipotent char", !125, i64 0} -!125 = !{!"Simple C++ TBAA"} -!126 = !{!127} -!127 = distinct !{!127, !128, !"air-alias-scope-arg(0)"} -!128 = distinct !{!128, !"air-alias-scopes(copy_words)"} +!114 = !{void (<4 x i32> addrspace(2)*, i32 addrspace(1)*, i32)* @constant_reads, !10, !115} +!115 = !{!116, !28, !14} +!116 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 2, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"uint4", !"air.arg_name", !"table"} +!117 = !{!"air.compile.denorms_disable"} +!118 = !{!"air.compile.fast_math_enable"} +!119 = !{!"air.compile.framebuffer_fetch_enable"} +!120 = !{float addrspace(2)* @_Z13positive_zero.MTL_FC_INIT_0_f, !"float", !"positive_zero", i32 0} +!121 = !{float addrspace(2)* @_Z13negative_zero.MTL_FC_INIT_1_f, !"float", !"negative_zero", i32 1} +!122 = !{!"air.sampler_state", [2 x i64] addrspace(2)* @__air_sampler_state} +!123 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!124 = !{i32 2, i32 8, i32 0} +!125 = !{!"Metal", i32 4, i32 0, i32 0} +!126 = !{!127, !127, i64 0} +!127 = !{!"omnipotent char", !128, i64 0} +!128 = !{!"Simple C++ TBAA"} !129 = !{!130} -!130 = distinct !{!130, !128, !"air-alias-scope-arg(1)"} -!131 = !{!132} -!132 = distinct !{!132, !133, !"air-alias-scope-arg(0)"} -!133 = distinct !{!133, !"air-alias-scopes(scale_offset)"} -!134 = !{!135, !136} -!135 = distinct !{!135, !133, !"air-alias-scope-arg(1)"} -!136 = distinct !{!136, !133, !"air-alias-scope-arg(2)"} -!137 = !{!136} -!138 = !{!132, !135} -!139 = !{!135} -!140 = !{!132, !136} -!141 = !{!142, !142, i64 0} -!142 = !{!"int", !124, i64 0} -!143 = !{!144} -!144 = distinct !{!144, !145, !"air-alias-scope-arg(1)"} -!145 = distinct !{!145, !"air-alias-scopes(fma_chains)"} +!130 = distinct !{!130, !131, !"air-alias-scope-arg(0)"} +!131 = distinct !{!131, !"air-alias-scopes(copy_words)"} +!132 = !{!133} +!133 = distinct !{!133, !131, !"air-alias-scope-arg(1)"} +!134 = !{!135} +!135 = distinct !{!135, !136, !"air-alias-scope-arg(0)"} +!136 = distinct !{!136, !"air-alias-scopes(scale_offset)"} +!137 = !{!138, !139} +!138 = distinct !{!138, !136, !"air-alias-scope-arg(1)"} +!139 = distinct !{!139, !136, !"air-alias-scope-arg(2)"} +!140 = !{!139} +!141 = !{!135, !138} +!142 = !{!138} +!143 = !{!135, !139} +!144 = !{!145, !145, i64 0} +!145 = !{!"int", !127, i64 0} !146 = !{!147} -!147 = distinct !{!147, !145, !"air-alias-scope-arg(0)"} -!148 = !{!149, !149, i64 0} -!149 = !{!"float", !124, i64 0} -!150 = distinct !{!150, !151} -!151 = !{!"llvm.loop.mustprogress"} -!152 = !{!153} -!153 = distinct !{!153, !154, !"air-alias-scope-arg(0)"} -!154 = distinct !{!154, !"air-alias-scopes(block_scan)"} +!147 = distinct !{!147, !148, !"air-alias-scope-arg(1)"} +!148 = distinct !{!148, !"air-alias-scopes(fma_chains)"} +!149 = !{!150} +!150 = distinct !{!150, !148, !"air-alias-scope-arg(0)"} +!151 = !{!152, !152, i64 0} +!152 = !{!"float", !127, i64 0} +!153 = distinct !{!153, !154} +!154 = !{!"llvm.loop.mustprogress"} !155 = !{!156} -!156 = distinct !{!156, !154, !"air-alias-scope-arg(1)"} -!157 = distinct !{!157, !151} +!156 = distinct !{!156, !157, !"air-alias-scope-arg(0)"} +!157 = distinct !{!157, !"air-alias-scopes(block_scan)"} !158 = !{!159} -!159 = distinct !{!159, !160, !"air-alias-scope-arg(2)"} -!160 = distinct !{!160, !"air-alias-scopes(reduce_sum)"} -!161 = !{!162, !163} -!162 = distinct !{!162, !160, !"air-alias-scope-arg(0)"} -!163 = distinct !{!163, !160, !"air-alias-scope-arg(1)"} -!164 = !{!162} -!165 = !{!163, !159} -!166 = distinct !{!166, !151} -!167 = distinct !{!167, !151} -!168 = !{!163} -!169 = !{!162, !159} -!170 = !{!171} -!171 = distinct !{!171, !172, !"air-alias-scope-arg(2)"} -!172 = distinct !{!172, !"air-alias-scopes(binomial3x3)"} -!173 = !{!174, !175} -!174 = distinct !{!174, !172, !"air-alias-scope-arg(0)"} -!175 = distinct !{!175, !172, !"air-alias-scope-arg(1)"} -!176 = !{!175} -!177 = !{!174, !171} -!178 = distinct !{!178, !151} -!179 = !{!174} -!180 = !{!175, !171} -!181 = distinct !{!181, !151} -!182 = !{!183} -!183 = distinct !{!183, !184, !"air-alias-scope-arg(0)"} -!184 = distinct !{!184, !"air-alias-scopes(lcg_step)"} +!159 = distinct !{!159, !157, !"air-alias-scope-arg(1)"} +!160 = distinct !{!160, !154} +!161 = !{!162} +!162 = distinct !{!162, !163, !"air-alias-scope-arg(2)"} +!163 = distinct !{!163, !"air-alias-scopes(reduce_sum)"} +!164 = !{!165, !166} +!165 = distinct !{!165, !163, !"air-alias-scope-arg(0)"} +!166 = distinct !{!166, !163, !"air-alias-scope-arg(1)"} +!167 = !{!165} +!168 = !{!166, !162} +!169 = distinct !{!169, !154} +!170 = distinct !{!170, !154} +!171 = !{!166} +!172 = !{!165, !162} +!173 = !{!174} +!174 = distinct !{!174, !175, !"air-alias-scope-arg(2)"} +!175 = distinct !{!175, !"air-alias-scopes(binomial3x3)"} +!176 = !{!177, !178} +!177 = distinct !{!177, !175, !"air-alias-scope-arg(0)"} +!178 = distinct !{!178, !175, !"air-alias-scope-arg(1)"} +!179 = !{!178} +!180 = !{!177, !174} +!181 = distinct !{!181, !154} +!182 = !{!177} +!183 = !{!178, !174} +!184 = distinct !{!184, !154} !185 = !{!186} -!186 = distinct !{!186, !184, !"air-alias-scope-arg(1)"} -!187 = !{!188} -!188 = distinct !{!188, !189, !"air-alias-scope-arg(1)"} -!189 = distinct !{!189, !"air-alias-scopes(narrow_mix)"} +!186 = distinct !{!186, !187, !"air-alias-scope-arg(0)"} +!187 = distinct !{!187, !"air-alias-scopes(lcg_step)"} +!188 = !{!189} +!189 = distinct !{!189, !187, !"air-alias-scope-arg(1)"} !190 = !{!191} -!191 = distinct !{!191, !189, !"air-alias-scope-arg(0)"} -!192 = distinct !{!192, !151} +!191 = distinct !{!191, !192, !"air-alias-scope-arg(1)"} +!192 = distinct !{!192, !"air-alias-scopes(narrow_mix)"} !193 = !{!194} -!194 = distinct !{!194, !195, !"air-alias-scope-arg(1)"} -!195 = distinct !{!195, !"air-alias-scopes(texels_in)"} -!196 = !{!197, !198} -!197 = distinct !{!197, !195, !"air-alias-scope-arg(0)"} -!198 = distinct !{!198, !195, !"air-alias-scope-textures"} -!199 = !{!197} -!200 = !{!194, !198} -!201 = !{!198} -!202 = !{!197, !194} -!203 = !{!204} -!204 = distinct !{!204, !205, !"air-alias-scope-arg(2)"} -!205 = distinct !{!205, !"air-alias-scopes(texels_out)"} -!206 = !{!207, !208} -!207 = distinct !{!207, !205, !"air-alias-scope-textures"} -!208 = distinct !{!208, !205, !"air-alias-scope-arg(1)"} -!209 = !{!208} -!210 = !{!207, !204} -!211 = !{!212} -!212 = distinct !{!212, !213, !"air-alias-scope-textures"} -!213 = distinct !{!213, !"air-alias-scopes(sample_down)"} +!194 = distinct !{!194, !192, !"air-alias-scope-arg(0)"} +!195 = distinct !{!195, !154} +!196 = !{!197} +!197 = distinct !{!197, !198, !"air-alias-scope-arg(1)"} +!198 = distinct !{!198, !"air-alias-scopes(texels_in)"} +!199 = !{!200, !201} +!200 = distinct !{!200, !198, !"air-alias-scope-arg(0)"} +!201 = distinct !{!201, !198, !"air-alias-scope-textures"} +!202 = !{!200} +!203 = !{!197, !201} +!204 = !{!201} +!205 = !{!200, !197} +!206 = !{!207} +!207 = distinct !{!207, !208, !"air-alias-scope-arg(2)"} +!208 = distinct !{!208, !"air-alias-scopes(texels_out)"} +!209 = !{!210, !211} +!210 = distinct !{!210, !208, !"air-alias-scope-textures"} +!211 = distinct !{!211, !208, !"air-alias-scope-arg(1)"} +!212 = !{!211} +!213 = !{!210, !207} !214 = !{!215} -!215 = distinct !{!215, !213, !"air-alias-scope-samplers"} -!216 = !{!212, !215} +!215 = distinct !{!215, !216, !"air-alias-scope-textures"} +!216 = distinct !{!216, !"air-alias-scopes(sample_down)"} !217 = !{!218} -!218 = distinct !{!218, !219, !"air-alias-scope-textures"} -!219 = distinct !{!219, !"air-alias-scopes(sample_up)"} +!218 = distinct !{!218, !216, !"air-alias-scope-samplers"} +!219 = !{!215, !218} !220 = !{!221} -!221 = distinct !{!221, !222, !"air-alias-scope-arg(0)"} -!222 = distinct !{!222, !"air-alias-scopes(wide_bindings)"} -!223 = !{!224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!224 = distinct !{!224, !222, !"air-alias-scope-arg(1)"} -!225 = distinct !{!225, !222, !"air-alias-scope-arg(2)"} -!226 = distinct !{!226, !222, !"air-alias-scope-arg(3)"} -!227 = distinct !{!227, !222, !"air-alias-scope-arg(4)"} -!228 = distinct !{!228, !222, !"air-alias-scope-arg(5)"} -!229 = distinct !{!229, !222, !"air-alias-scope-arg(6)"} -!230 = distinct !{!230, !222, !"air-alias-scope-arg(7)"} -!231 = distinct !{!231, !222, !"air-alias-scope-arg(8)"} -!232 = distinct !{!232, !222, !"air-alias-scope-arg(9)"} -!233 = distinct !{!233, !222, !"air-alias-scope-arg(10)"} -!234 = distinct !{!234, !222, !"air-alias-scope-arg(11)"} -!235 = distinct !{!235, !222, !"air-alias-scope-arg(12)"} -!236 = distinct !{!236, !222, !"air-alias-scope-arg(13)"} -!237 = distinct !{!237, !222, !"air-alias-scope-arg(14)"} -!238 = distinct !{!238, !222, !"air-alias-scope-arg(15)"} -!239 = distinct !{!239, !222, !"air-alias-scope-arg(16)"} -!240 = distinct !{!240, !222, !"air-alias-scope-arg(17)"} -!241 = distinct !{!241, !222, !"air-alias-scope-arg(18)"} -!242 = distinct !{!242, !222, !"air-alias-scope-arg(19)"} -!243 = distinct !{!243, !222, !"air-alias-scope-arg(20)"} -!244 = distinct !{!244, !222, !"air-alias-scope-arg(21)"} -!245 = distinct !{!245, !222, !"air-alias-scope-arg(22)"} -!246 = distinct !{!246, !222, !"air-alias-scope-arg(23)"} -!247 = !{!224} -!248 = !{!221, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!249 = !{!225} -!250 = !{!221, !224, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!251 = !{!226} -!252 = !{!221, !224, !225, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!253 = !{!227} -!254 = !{!221, !224, !225, !226, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!255 = !{!228} -!256 = !{!221, !224, !225, !226, !227, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!257 = !{!229} -!258 = !{!221, !224, !225, !226, !227, !228, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!259 = !{!230} -!260 = !{!221, !224, !225, !226, !227, !228, !229, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!261 = !{!231} -!262 = !{!221, !224, !225, !226, !227, !228, !229, !230, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!263 = !{!232} -!264 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!265 = !{!233} -!266 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!267 = !{!234} -!268 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!269 = !{!235} -!270 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!271 = !{!236} -!272 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!273 = !{!237} -!274 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!275 = !{!238} -!276 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !239, !240, !241, !242, !243, !244, !245, !246} -!277 = !{!239} -!278 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !240, !241, !242, !243, !244, !245, !246} -!279 = !{!240} -!280 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !241, !242, !243, !244, !245, !246} -!281 = !{!241} -!282 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !242, !243, !244, !245, !246} -!283 = !{!242} -!284 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !243, !244, !245, !246} -!285 = !{!243} -!286 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !244, !245, !246} -!287 = !{!244} -!288 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !245, !246} -!289 = !{!245} -!290 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !246} -!291 = !{!246} -!292 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245} -!293 = !{!294} -!294 = distinct !{!294, !295, !"air-alias-scope-arg(1)"} -!295 = distinct !{!295, !"air-alias-scopes(wave_store)"} +!221 = distinct !{!221, !222, !"air-alias-scope-textures"} +!222 = distinct !{!222, !"air-alias-scopes(sample_up)"} +!223 = !{!224} +!224 = distinct !{!224, !225, !"air-alias-scope-arg(0)"} +!225 = distinct !{!225, !"air-alias-scopes(wide_bindings)"} +!226 = !{!227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!227 = distinct !{!227, !225, !"air-alias-scope-arg(1)"} +!228 = distinct !{!228, !225, !"air-alias-scope-arg(2)"} +!229 = distinct !{!229, !225, !"air-alias-scope-arg(3)"} +!230 = distinct !{!230, !225, !"air-alias-scope-arg(4)"} +!231 = distinct !{!231, !225, !"air-alias-scope-arg(5)"} +!232 = distinct !{!232, !225, !"air-alias-scope-arg(6)"} +!233 = distinct !{!233, !225, !"air-alias-scope-arg(7)"} +!234 = distinct !{!234, !225, !"air-alias-scope-arg(8)"} +!235 = distinct !{!235, !225, !"air-alias-scope-arg(9)"} +!236 = distinct !{!236, !225, !"air-alias-scope-arg(10)"} +!237 = distinct !{!237, !225, !"air-alias-scope-arg(11)"} +!238 = distinct !{!238, !225, !"air-alias-scope-arg(12)"} +!239 = distinct !{!239, !225, !"air-alias-scope-arg(13)"} +!240 = distinct !{!240, !225, !"air-alias-scope-arg(14)"} +!241 = distinct !{!241, !225, !"air-alias-scope-arg(15)"} +!242 = distinct !{!242, !225, !"air-alias-scope-arg(16)"} +!243 = distinct !{!243, !225, !"air-alias-scope-arg(17)"} +!244 = distinct !{!244, !225, !"air-alias-scope-arg(18)"} +!245 = distinct !{!245, !225, !"air-alias-scope-arg(19)"} +!246 = distinct !{!246, !225, !"air-alias-scope-arg(20)"} +!247 = distinct !{!247, !225, !"air-alias-scope-arg(21)"} +!248 = distinct !{!248, !225, !"air-alias-scope-arg(22)"} +!249 = distinct !{!249, !225, !"air-alias-scope-arg(23)"} +!250 = !{!227} +!251 = !{!224, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!252 = !{!228} +!253 = !{!224, !227, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!254 = !{!229} +!255 = !{!224, !227, !228, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!256 = !{!230} +!257 = !{!224, !227, !228, !229, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!258 = !{!231} +!259 = !{!224, !227, !228, !229, !230, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!260 = !{!232} +!261 = !{!224, !227, !228, !229, !230, !231, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!262 = !{!233} +!263 = !{!224, !227, !228, !229, !230, !231, !232, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!264 = !{!234} +!265 = !{!224, !227, !228, !229, !230, !231, !232, !233, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!266 = !{!235} +!267 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!268 = !{!236} +!269 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!270 = !{!237} +!271 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!272 = !{!238} +!273 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!274 = !{!239} +!275 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!276 = !{!240} +!277 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!278 = !{!241} +!279 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !242, !243, !244, !245, !246, !247, !248, !249} +!280 = !{!242} +!281 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !243, !244, !245, !246, !247, !248, !249} +!282 = !{!243} +!283 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !244, !245, !246, !247, !248, !249} +!284 = !{!244} +!285 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !245, !246, !247, !248, !249} +!286 = !{!245} +!287 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !246, !247, !248, !249} +!288 = !{!246} +!289 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !247, !248, !249} +!290 = !{!247} +!291 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !248, !249} +!292 = !{!248} +!293 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !249} +!294 = !{!249} +!295 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248} !296 = !{!297} -!297 = distinct !{!297, !295, !"air-alias-scope-arg(0)"} -!298 = !{!299} -!299 = distinct !{!299, !300, !"air-alias-scope-arg(1)"} -!300 = distinct !{!300, !"air-alias-scopes(signed_zero_products)"} +!297 = distinct !{!297, !298, !"air-alias-scope-arg(1)"} +!298 = distinct !{!298, !"air-alias-scopes(wave_store)"} +!299 = !{!300} +!300 = distinct !{!300, !298, !"air-alias-scope-arg(0)"} !301 = !{!302} -!302 = distinct !{!302, !300, !"air-alias-scope-arg(0)"} -!303 = distinct !{!303, !151} +!302 = distinct !{!302, !303, !"air-alias-scope-arg(1)"} +!303 = distinct !{!303, !"air-alias-scopes(signed_zero_products)"} !304 = !{!305} -!305 = distinct !{!305, !306, !"air-alias-scope-arg(0)"} -!306 = distinct !{!306, !"air-alias-scopes(vote_loop)"} +!305 = distinct !{!305, !303, !"air-alias-scope-arg(0)"} +!306 = distinct !{!306, !154} !307 = !{!308} -!308 = distinct !{!308, !306, !"air-alias-scope-arg(1)"} -!309 = distinct !{!309, !151} +!308 = distinct !{!308, !309, !"air-alias-scope-arg(0)"} +!309 = distinct !{!309, !"air-alias-scopes(vote_loop)"} !310 = !{!311} -!311 = distinct !{!311, !312, !"air-alias-scope-arg(0)"} -!312 = distinct !{!312, !"air-alias-scopes(group_sums)"} -!313 = !{!314, !315} -!314 = distinct !{!314, !312, !"air-alias-scope-arg(1)"} -!315 = distinct !{!315, !312, !"air-alias-scope-arg(2)"} -!316 = !{!315} -!317 = !{!311, !314} -!318 = distinct !{!318, !151} -!319 = !{!314} -!320 = !{!311, !315} +!311 = distinct !{!311, !309, !"air-alias-scope-arg(1)"} +!312 = distinct !{!312, !154} +!313 = !{!314} +!314 = distinct !{!314, !315, !"air-alias-scope-arg(0)"} +!315 = distinct !{!315, !"air-alias-scopes(group_sums)"} +!316 = !{!317, !318} +!317 = distinct !{!317, !315, !"air-alias-scope-arg(1)"} +!318 = distinct !{!318, !315, !"air-alias-scope-arg(2)"} +!319 = !{!318} +!320 = !{!314, !317} +!321 = distinct !{!321, !154} +!322 = !{!317} +!323 = !{!314, !318} +!324 = !{!325} +!325 = distinct !{!325, !326, !"air-alias-scope-arg(1)"} +!326 = distinct !{!326, !"air-alias-scopes(constant_reads)"} +!327 = !{!328} +!328 = distinct !{!328, !326, !"air-alias-scope-arg(0)"} +!329 = distinct !{!329, !154} diff --git a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.ll b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.ll index 0b1b8190c..0f1d4c54f 100644 --- a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.ll +++ b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.ll @@ -17,9 +17,9 @@ target triple = "air64_v28-apple-macosx26.0.0" define void @copy_words(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #0 { %4 = zext i32 %2 to i64 %5 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %0, i64 %4 - %6 = load <4 x i32>, ptr addrspace(1) %5, align 16, !tbaa !123, !alias.scope !126, !noalias !129 + %6 = load <4 x i32>, ptr addrspace(1) %5, align 16, !tbaa !126, !alias.scope !129, !noalias !132 %7 = getelementptr inbounds <4 x i32>, ptr addrspace(1) %1, i64 %4 - store <4 x i32> %6, ptr addrspace(1) %7, align 16, !tbaa !123, !alias.scope !129, !noalias !126 + store <4 x i32> %6, ptr addrspace(1) %7, align 16, !tbaa !126, !alias.scope !132, !noalias !129 ret void } @@ -27,27 +27,27 @@ define void @copy_words(ptr addrspace(1) noundef readonly captures(none) "air-bu define void @scale_offset(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(2) noundef readonly align 8 captures(none) dereferenceable(8) "air-buffer-no-alias" %2, i32 noundef %3) local_unnamed_addr #0 { %5 = zext i32 %3 to i64 %6 = getelementptr inbounds <4 x float>, ptr addrspace(1) %0, i64 %5 - %7 = load <4 x float>, ptr addrspace(1) %6, align 16, !tbaa !123, !alias.scope !131, !noalias !134 - %8 = load <2 x float>, ptr addrspace(2) %2, align 8, !alias.scope !137, !noalias !138 + %7 = load <4 x float>, ptr addrspace(1) %6, align 16, !tbaa !126, !alias.scope !134, !noalias !137 + %8 = load <2 x float>, ptr addrspace(2) %2, align 8, !alias.scope !140, !noalias !141 %9 = shufflevector <2 x float> %8, <2 x float> undef, <4 x i32> zeroinitializer %10 = fmul fast <4 x float> %9, %7 %11 = shufflevector <2 x float> %8, <2 x float> undef, <4 x i32> %12 = fadd fast <4 x float> %10, %11 %13 = getelementptr inbounds <4 x float>, ptr addrspace(1) %1, i64 %5 - store <4 x float> %12, ptr addrspace(1) %13, align 16, !tbaa !123, !alias.scope !139, !noalias !140 + store <4 x float> %12, ptr addrspace(1) %13, align 16, !tbaa !126, !alias.scope !142, !noalias !143 ret void } ; Function Attrs: mustprogress nofree nosync nounwind memory(argmem: readwrite) define void @fma_chains(ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #1 { %4 = and i32 %2, 31 - %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #18 + %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = fmul fast float %5, 3.125000e-02 %7 = lshr i32 %2, 5 %8 = and i32 %7, 31 - %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #18 + %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #19 %10 = fmul fast float %9, 3.125000e-02 - %11 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !143, !noalias !146 + %11 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !146, !noalias !149 %12 = icmp eq i32 %11, 0 br i1 %12, label %13, label %19 @@ -57,7 +57,7 @@ define void @fma_chains(ptr addrspace(1) noundef writeonly captures(none) "air-b %16 = fadd fast float %15, %14 %17 = zext i32 %2 to i64 %18 = getelementptr inbounds float, ptr addrspace(1) %0, i64 %17 - store float %16, ptr addrspace(1) %18, align 4, !tbaa !148, !alias.scope !146, !noalias !143 + store float %16, ptr addrspace(1) %18, align 4, !tbaa !151, !alias.scope !149, !noalias !146 ret void 19: ; preds = %19, %3 @@ -65,12 +65,12 @@ define void @fma_chains(ptr addrspace(1) noundef writeonly captures(none) "air-b %21 = phi float [ %26, %19 ], [ %10, %3 ] %22 = phi float [ %24, %19 ], [ %6, %3 ] %23 = fmul fast float %21, 6.250000e-02 - %24 = tail call fast float @air.fma.f32(float %22, float 9.375000e-01, float %23) #18 + %24 = tail call fast float @air.fma.f32(float %22, float 9.375000e-01, float %23) #19 %25 = fmul fast float %24, 1.250000e-01 - %26 = tail call fast float @air.fma.f32(float %21, float 8.750000e-01, float %25) #18 + %26 = tail call fast float @air.fma.f32(float %21, float 8.750000e-01, float %25) #19 %27 = add nuw i32 %20, 1 %28 = icmp eq i32 %27, %11 - br i1 %28, label %13, label %19, !llvm.loop !150 + br i1 %28, label %13, label %19, !llvm.loop !153 } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) @@ -80,16 +80,16 @@ declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #2 define void @block_scan(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 { %5 = zext i32 %2 to i64 %6 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %5 - %7 = load i32, ptr addrspace(1) %6, align 4, !tbaa !141, !alias.scope !152, !noalias !155 + %7 = load i32, ptr addrspace(1) %6, align 4, !tbaa !144, !alias.scope !155, !noalias !158 %8 = zext i32 %3 to i64 %9 = getelementptr inbounds [256 x i32], ptr addrspace(3) @_ZZ10block_scanPU9MTLdeviceKjPU9MTLdevicejjjE4sums, i64 0, i64 %8 - store i32 %7, ptr addrspace(3) %9, align 4, !tbaa !141 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %7, ptr addrspace(3) %9, align 4, !tbaa !144 + tail call void @air.wg.barrier(i32 2, i32 1) #20 br label %12 10: ; preds = %21 %11 = getelementptr inbounds i32, ptr addrspace(1) %1, i64 %5 - store i32 %23, ptr addrspace(1) %11, align 4, !tbaa !141, !alias.scope !155, !noalias !152 + store i32 %23, ptr addrspace(1) %11, align 4, !tbaa !144, !alias.scope !158, !noalias !155 ret void 12: ; preds = %21, %4 @@ -102,35 +102,35 @@ define void @block_scan(ptr addrspace(1) noundef readonly captures(none) "air-bu %17 = sub i32 %3, %14 %18 = zext i32 %17 to i64 %19 = getelementptr inbounds [256 x i32], ptr addrspace(3) @_ZZ10block_scanPU9MTLdeviceKjPU9MTLdevicejjjE4sums, i64 0, i64 %18 - %20 = load i32, ptr addrspace(3) %19, align 4, !tbaa !141 + %20 = load i32, ptr addrspace(3) %19, align 4, !tbaa !144 br label %21 21: ; preds = %16, %12 %22 = phi i32 [ %20, %16 ], [ 0, %12 ] - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %23 = add i32 %22, %13 - store i32 %23, ptr addrspace(3) %9, align 4, !tbaa !141 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %23, ptr addrspace(3) %9, align 4, !tbaa !144 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %24 = shl nuw nsw i32 %14, 1 %25 = icmp ult i32 %14, 128 - br i1 %25, label %12, label %10, !llvm.loop !157 + br i1 %25, label %12, label %10, !llvm.loop !160 } ; Function Attrs: convergent mustprogress nounwind define void @reduce_sum(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(2) noundef readonly align 8 captures(none) dereferenceable(8) "air-buffer-no-alias" %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7, i32 noundef %8, i32 noundef %9) local_unnamed_addr #3 { - %11 = load <2 x i32>, ptr addrspace(2) %2, align 8, !alias.scope !158, !noalias !161 + %11 = load <2 x i32>, ptr addrspace(2) %2, align 8, !alias.scope !161, !noalias !164 %12 = extractelement <2 x i32> %11, i64 1 %13 = mul i32 %12, %3 %14 = add i32 %13, %12 %15 = extractelement <2 x i32> %11, i64 0 - %16 = tail call i32 @air.min.u.i32(i32 %14, i32 %15) #18 + %16 = tail call i32 @air.min.u.i32(i32 %14, i32 %15) #19 %17 = add i32 %13, %4 %18 = icmp ult i32 %17, %16 br i1 %18, label %23, label %19 19: ; preds = %23, %10 %20 = phi i32 [ 0, %10 ], [ %29, %23 ] - %21 = tail call i32 @air.simd_sum.u.i32(i32 %20) #19 + %21 = tail call i32 @air.simd_sum.u.i32(i32 %20) #20 %22 = icmp eq i32 %6, 0 br i1 %22, label %32, label %35 @@ -139,20 +139,20 @@ define void @reduce_sum(ptr addrspace(1) noundef readonly captures(none) "air-bu %25 = phi i32 [ %29, %23 ], [ 0, %10 ] %26 = zext i32 %24 to i64 %27 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %26 - %28 = load i32, ptr addrspace(1) %27, align 4, !tbaa !141, !alias.scope !164, !noalias !165 + %28 = load i32, ptr addrspace(1) %27, align 4, !tbaa !144, !alias.scope !167, !noalias !168 %29 = add i32 %28, %25 %30 = add i32 %24, %5 %31 = icmp ult i32 %30, %16 - br i1 %31, label %23, label %19, !llvm.loop !166 + br i1 %31, label %23, label %19, !llvm.loop !169 32: ; preds = %19 %33 = zext i32 %7 to i64 %34 = getelementptr inbounds [256 x i32], ptr addrspace(3) @_ZZ10reduce_sumPU9MTLdeviceKjPU9MTLdevicejRU11MTLconstantKDv2_jjjjjjjjE7partial, i64 0, i64 %33 - store i32 %21, ptr addrspace(3) %34, align 4, !tbaa !141 + store i32 %21, ptr addrspace(3) %34, align 4, !tbaa !144 br label %35 35: ; preds = %32, %19 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %36 = icmp eq i32 %7, 0 br i1 %36, label %37, label %54 @@ -162,7 +162,7 @@ define void @reduce_sum(ptr addrspace(1) noundef readonly captures(none) "air-bu 39: ; preds = %42, %37 %40 = phi i32 [ 0, %37 ], [ %48, %42 ] - %41 = tail call i32 @air.simd_sum.u.i32(i32 %40) #19 + %41 = tail call i32 @air.simd_sum.u.i32(i32 %40) #20 br i1 %22, label %51, label %54 42: ; preds = %42, %37 @@ -170,16 +170,16 @@ define void @reduce_sum(ptr addrspace(1) noundef readonly captures(none) "air-bu %44 = phi i32 [ %48, %42 ], [ 0, %37 ] %45 = zext i32 %43 to i64 %46 = getelementptr inbounds [256 x i32], ptr addrspace(3) @_ZZ10reduce_sumPU9MTLdeviceKjPU9MTLdevicejRU11MTLconstantKDv2_jjjjjjjjE7partial, i64 0, i64 %45 - %47 = load i32, ptr addrspace(3) %46, align 4, !tbaa !141 + %47 = load i32, ptr addrspace(3) %46, align 4, !tbaa !144 %48 = add i32 %47, %44 %49 = add i32 %43, %9 %50 = icmp ult i32 %49, %8 - br i1 %50, label %42, label %39, !llvm.loop !167 + br i1 %50, label %42, label %39, !llvm.loop !170 51: ; preds = %39 %52 = zext i32 %3 to i64 %53 = getelementptr inbounds i32, ptr addrspace(1) %1, i64 %52 - store i32 %41, ptr addrspace(1) %53, align 4, !tbaa !141, !alias.scope !168, !noalias !169 + store i32 %41, ptr addrspace(1) %53, align 4, !tbaa !144, !alias.scope !171, !noalias !172 br label %54 54: ; preds = %51, %39, %35 @@ -189,7 +189,7 @@ define void @reduce_sum(ptr addrspace(1) noundef readonly captures(none) "air-bu ; Function Attrs: mustprogress nofree nosync nounwind memory(argmem: readwrite) define void @binomial3x3(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(2) noundef readonly align 8 captures(none) dereferenceable(8) "air-buffer-no-alias" %2, <2 x i32> noundef %3) local_unnamed_addr #4 { %5 = extractelement <2 x i32> %3, i64 1 - %6 = load <2 x i32>, ptr addrspace(2) %2, align 8, !alias.scope !170, !noalias !173 + %6 = load <2 x i32>, ptr addrspace(2) %2, align 8, !alias.scope !173, !noalias !176 %7 = extractelement <2 x i32> %6, i64 1 %8 = add nsw i32 %7, -1 %9 = extractelement <2 x i32> %3, i64 0 @@ -203,14 +203,14 @@ define void @binomial3x3(ptr addrspace(1) noundef readonly captures(none) "air-b %15 = add i32 %14, %9 %16 = zext i32 %15 to i64 %17 = getelementptr inbounds <4 x float>, ptr addrspace(1) %1, i64 %16 - store <4 x float> %13, ptr addrspace(1) %17, align 16, !tbaa !123, !alias.scope !176, !noalias !177 + store <4 x float> %13, ptr addrspace(1) %17, align 16, !tbaa !126, !alias.scope !179, !noalias !180 ret void 18: ; preds = %26, %4 %19 = phi <4 x float> [ zeroinitializer, %4 ], [ %44, %26 ] %20 = phi i32 [ -1, %4 ], [ %27, %26 ] %21 = add nsw i32 %20, %5 - %22 = tail call i32 @air.clamp.s.i32(i32 %21, i32 0, i32 %8) #18 + %22 = tail call i32 @air.clamp.s.i32(i32 %21, i32 0, i32 %8) #19 %23 = icmp eq i32 %20, 0 %24 = select fast i1 %23, float 2.000000e+00, float 1.000000e+00 %25 = mul i32 %22, %10 @@ -219,38 +219,38 @@ define void @binomial3x3(ptr addrspace(1) noundef readonly captures(none) "air-b 26: ; preds = %29 %27 = add nsw i32 %20, 1 %28 = icmp eq i32 %27, 2 - br i1 %28, label %12, label %18, !llvm.loop !178 + br i1 %28, label %12, label %18, !llvm.loop !181 29: ; preds = %29, %18 %30 = phi <4 x float> [ %19, %18 ], [ %44, %29 ] %31 = phi i32 [ -1, %18 ], [ %45, %29 ] %32 = add nsw i32 %31, %9 - %33 = tail call i32 @air.clamp.s.i32(i32 %32, i32 0, i32 %11) #18 + %33 = tail call i32 @air.clamp.s.i32(i32 %32, i32 0, i32 %11) #19 %34 = icmp eq i32 %31, 0 %35 = select fast i1 %34, float 2.000000e+00, float 1.000000e+00 %36 = fmul fast float %35, %24 %37 = add i32 %33, %25 %38 = zext i32 %37 to i64 %39 = getelementptr inbounds <4 x float>, ptr addrspace(1) %0, i64 %38 - %40 = load <4 x float>, ptr addrspace(1) %39, align 16, !tbaa !123, !alias.scope !179, !noalias !180 + %40 = load <4 x float>, ptr addrspace(1) %39, align 16, !tbaa !126, !alias.scope !182, !noalias !183 %41 = insertelement <4 x float> poison, float %36, i64 0 %42 = shufflevector <4 x float> %41, <4 x float> poison, <4 x i32> zeroinitializer %43 = fmul fast <4 x float> %42, %40 %44 = fadd fast <4 x float> %43, %30 %45 = add nsw i32 %31, 1 %46 = icmp eq i32 %45, 2 - br i1 %46, label %26, label %29, !llvm.loop !181 + br i1 %46, label %26, label %29, !llvm.loop !184 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) define void @lcg_step(ptr addrspace(1) noundef captures(none) "air-buffer-no-alias" %0, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #0 { %4 = zext i32 %2 to i64 %5 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %4 - %6 = load i32, ptr addrspace(1) %5, align 4, !tbaa !141, !alias.scope !182, !noalias !185 + %6 = load i32, ptr addrspace(1) %5, align 4, !tbaa !144, !alias.scope !185, !noalias !188 %7 = mul i32 %6, 1664525 - %8 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !185, !noalias !182 + %8 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !188, !noalias !185 %9 = add i32 %7, %8 - store i32 %9, ptr addrspace(1) %5, align 4, !tbaa !141, !alias.scope !182, !noalias !185 + store i32 %9, ptr addrspace(1) %5, align 4, !tbaa !144, !alias.scope !185, !noalias !188 ret void } @@ -261,7 +261,7 @@ define void @narrow_mix(ptr addrspace(1) noundef writeonly captures(none) "air-b %6 = xor i16 %4, 23130 %7 = trunc i32 %2 to i8 %8 = lshr i32 %2, 3 - %9 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !187, !noalias !190 + %9 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !190, !noalias !193 %10 = icmp eq i32 %9, 0 br i1 %10, label %11, label %27 @@ -281,7 +281,7 @@ define void @narrow_mix(ptr addrspace(1) noundef writeonly captures(none) "air-b %24 = xor i32 %21, %23 %25 = zext i32 %2 to i64 %26 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %25 - store i32 %24, ptr addrspace(1) %26, align 4, !tbaa !141, !alias.scope !190, !noalias !187 + store i32 %24, ptr addrspace(1) %26, align 4, !tbaa !144, !alias.scope !193, !noalias !190 ret void 27: ; preds = %27, %3 @@ -306,53 +306,53 @@ define void @narrow_mix(ptr addrspace(1) noundef writeonly captures(none) "air-b %46 = add nsw i32 %45, %42 %47 = add nuw i32 %28, 1 %48 = icmp eq i32 %47, %9 - br i1 %48, label %11, label %27, !llvm.loop !192 + br i1 %48, label %11, label %27, !llvm.loop !195 } ; Function Attrs: mustprogress nounwind willreturn define void @texels_in(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %1, ptr addrspace(1) %2, <2 x i32> noundef %3) local_unnamed_addr #6 { %5 = extractelement <2 x i32> %3, i64 1 - %6 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !193, !noalias !196 + %6 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !196, !noalias !199 %7 = mul i32 %6, %5 %8 = extractelement <2 x i32> %3, i64 0 %9 = add i32 %7, %8 %10 = zext i32 %9 to i64 %11 = getelementptr inbounds <4 x float>, ptr addrspace(1) %0, i64 %10 - %12 = load <4 x float>, ptr addrspace(1) %11, align 16, !tbaa !123, !alias.scope !199, !noalias !200 - tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %2, <2 x i32> %3, <4 x float> %12, i32 0, i32 2) #20, !alias.scope !201, !noalias !202 + %12 = load <4 x float>, ptr addrspace(1) %11, align 16, !tbaa !126, !alias.scope !202, !noalias !203 + tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %2, <2 x i32> %3, <4 x float> %12, i32 0, i32 2) #21, !alias.scope !204, !noalias !205 ret void } ; Function Attrs: mustprogress nofree nounwind willreturn define void @texels_out(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %2, <2 x i32> noundef %3) local_unnamed_addr #7 { - %5 = tail call ptr addrspace(2) @air.get_read_sampler() #21 - %6 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) %5, <2 x i32> %3, <2 x i32> zeroinitializer, i32 0, i32 1) #22 + %5 = tail call ptr addrspace(2) @air.get_read_sampler() #22 + %6 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) %5, <2 x i32> %3, <2 x i32> zeroinitializer, i32 0, i32 1) #23 %7 = extractvalue { <4 x float>, i8 } %6, 0 %8 = extractelement <2 x i32> %3, i64 1 - %9 = load i32, ptr addrspace(2) %2, align 4, !tbaa !141, !alias.scope !203, !noalias !206 + %9 = load i32, ptr addrspace(2) %2, align 4, !tbaa !144, !alias.scope !206, !noalias !209 %10 = mul i32 %9, %8 %11 = extractelement <2 x i32> %3, i64 0 %12 = add i32 %10, %11 %13 = zext i32 %12 to i64 %14 = getelementptr inbounds <4 x float>, ptr addrspace(1) %1, i64 %13 - store <4 x float> %7, ptr addrspace(1) %14, align 16, !tbaa !123, !alias.scope !209, !noalias !210 + store <4 x float> %7, ptr addrspace(1) %14, align 16, !tbaa !126, !alias.scope !212, !noalias !213 ret void } ; Function Attrs: convergent mustprogress nounwind willreturn define void @sample_down(ptr addrspace(1) %0, ptr addrspace(1) %1, ptr addrspace(2) readonly captures(none) %2, <2 x i32> noundef %3) local_unnamed_addr #8 { - %5 = tail call i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #22, !alias.scope !211, !noalias !214 - %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #18 + %5 = tail call i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #23, !alias.scope !214, !noalias !217 + %6 = tail call fast float @air.convert.f.f32.u.i32(i32 %5) #19 %7 = insertelement <2 x float> undef, float %6, i64 0 - %8 = tail call i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #22, !alias.scope !211, !noalias !214 - %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #18 + %8 = tail call i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #23, !alias.scope !214, !noalias !217 + %9 = tail call fast float @air.convert.f.f32.u.i32(i32 %8) #19 %10 = insertelement <2 x float> %7, float %9, i64 1 - %11 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %3) #18 + %11 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %3) #19 %12 = fadd fast <2 x float> %11, splat (float 5.000000e-01) %13 = fdiv fast <2 x float> %12, %10 - %14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) readonly captures(none) %2, <2 x float> %13, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #23, !alias.scope !216 + %14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) readonly captures(none) %2, <2 x float> %13, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #24, !alias.scope !219 %15 = extractvalue { <4 x float>, i8 } %14, 0 - tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %1, <2 x i32> %3, <4 x float> %15, i32 0, i32 2) #20, !alias.scope !211, !noalias !214 + tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %1, <2 x i32> %3, <4 x float> %15, i32 0, i32 2) #21, !alias.scope !214, !noalias !217 ret void } @@ -361,18 +361,18 @@ declare <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32>) local_unnamed_addr # ; Function Attrs: convergent mustprogress nounwind willreturn define void @sample_up(ptr addrspace(1) %0, ptr addrspace(1) %1, <2 x i32> noundef %2) local_unnamed_addr #8 { - %4 = tail call i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #22, !alias.scope !217 - %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #18 + %4 = tail call i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #23, !alias.scope !220 + %5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = insertelement <2 x float> undef, float %5, i64 0 - %7 = tail call i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #22, !alias.scope !217 - %8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #18 + %7 = tail call i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none) %1, i32 0) #23, !alias.scope !220 + %8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #19 %9 = insertelement <2 x float> %6, float %8, i64 1 - %10 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %2) #18 + %10 = tail call fast <2 x float> @air.convert.f.v2f32.u.v2i32(<2 x i32> %2) #19 %11 = fadd fast <2 x float> %10, splat (float 5.000000e-01) %12 = fdiv fast <2 x float> %11, %9 - %13 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) readonly captures(none) @__air_sampler_state, <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #23 + %13 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %0, ptr addrspace(2) readonly captures(none) @__air_sampler_state, <2 x float> %12, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #24 %14 = extractvalue { <4 x float>, i8 } %13, 0 - tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %1, <2 x i32> %2, <4 x float> %14, i32 0, i32 2) #20, !alias.scope !217 + tail call void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none) %1, <2 x i32> %2, <4 x float> %14, i32 0, i32 2) #21, !alias.scope !220 ret void } @@ -380,97 +380,97 @@ define void @sample_up(ptr addrspace(1) %0, ptr addrspace(1) %1, <2 x i32> nound define void @wide_bindings(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %2, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %3, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %4, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %5, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %6, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %7, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %8, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %9, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %10, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %11, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %12, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %13, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %14, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %15, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %16, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %17, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %18, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %19, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %20, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %21, ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %22, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %23, i32 noundef %24) local_unnamed_addr #0 { %26 = zext i32 %24 to i64 %27 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %26 - %28 = load i32, ptr addrspace(1) %27, align 4, !tbaa !141, !alias.scope !220, !noalias !223 + %28 = load i32, ptr addrspace(1) %27, align 4, !tbaa !144, !alias.scope !223, !noalias !226 %29 = mul i32 %28, 3 %30 = getelementptr inbounds i32, ptr addrspace(1) %1, i64 %26 - %31 = load i32, ptr addrspace(1) %30, align 4, !tbaa !141, !alias.scope !247, !noalias !248 + %31 = load i32, ptr addrspace(1) %30, align 4, !tbaa !144, !alias.scope !250, !noalias !251 %32 = add i32 %29, %31 %33 = mul i32 %32, 3 %34 = getelementptr inbounds i32, ptr addrspace(1) %2, i64 %26 - %35 = load i32, ptr addrspace(1) %34, align 4, !tbaa !141, !alias.scope !249, !noalias !250 + %35 = load i32, ptr addrspace(1) %34, align 4, !tbaa !144, !alias.scope !252, !noalias !253 %36 = add i32 %33, %35 %37 = mul i32 %36, 3 %38 = getelementptr inbounds i32, ptr addrspace(1) %3, i64 %26 - %39 = load i32, ptr addrspace(1) %38, align 4, !tbaa !141, !alias.scope !251, !noalias !252 + %39 = load i32, ptr addrspace(1) %38, align 4, !tbaa !144, !alias.scope !254, !noalias !255 %40 = add i32 %37, %39 %41 = mul i32 %40, 3 %42 = getelementptr inbounds i32, ptr addrspace(1) %4, i64 %26 - %43 = load i32, ptr addrspace(1) %42, align 4, !tbaa !141, !alias.scope !253, !noalias !254 + %43 = load i32, ptr addrspace(1) %42, align 4, !tbaa !144, !alias.scope !256, !noalias !257 %44 = add i32 %41, %43 %45 = mul i32 %44, 3 %46 = getelementptr inbounds i32, ptr addrspace(1) %5, i64 %26 - %47 = load i32, ptr addrspace(1) %46, align 4, !tbaa !141, !alias.scope !255, !noalias !256 + %47 = load i32, ptr addrspace(1) %46, align 4, !tbaa !144, !alias.scope !258, !noalias !259 %48 = add i32 %45, %47 %49 = mul i32 %48, 3 %50 = getelementptr inbounds i32, ptr addrspace(1) %6, i64 %26 - %51 = load i32, ptr addrspace(1) %50, align 4, !tbaa !141, !alias.scope !257, !noalias !258 + %51 = load i32, ptr addrspace(1) %50, align 4, !tbaa !144, !alias.scope !260, !noalias !261 %52 = add i32 %49, %51 %53 = mul i32 %52, 3 %54 = getelementptr inbounds i32, ptr addrspace(1) %7, i64 %26 - %55 = load i32, ptr addrspace(1) %54, align 4, !tbaa !141, !alias.scope !259, !noalias !260 + %55 = load i32, ptr addrspace(1) %54, align 4, !tbaa !144, !alias.scope !262, !noalias !263 %56 = add i32 %53, %55 %57 = mul i32 %56, 3 %58 = getelementptr inbounds i32, ptr addrspace(1) %8, i64 %26 - %59 = load i32, ptr addrspace(1) %58, align 4, !tbaa !141, !alias.scope !261, !noalias !262 + %59 = load i32, ptr addrspace(1) %58, align 4, !tbaa !144, !alias.scope !264, !noalias !265 %60 = add i32 %57, %59 %61 = mul i32 %60, 3 %62 = getelementptr inbounds i32, ptr addrspace(1) %9, i64 %26 - %63 = load i32, ptr addrspace(1) %62, align 4, !tbaa !141, !alias.scope !263, !noalias !264 + %63 = load i32, ptr addrspace(1) %62, align 4, !tbaa !144, !alias.scope !266, !noalias !267 %64 = add i32 %61, %63 %65 = mul i32 %64, 3 %66 = getelementptr inbounds i32, ptr addrspace(1) %10, i64 %26 - %67 = load i32, ptr addrspace(1) %66, align 4, !tbaa !141, !alias.scope !265, !noalias !266 + %67 = load i32, ptr addrspace(1) %66, align 4, !tbaa !144, !alias.scope !268, !noalias !269 %68 = add i32 %65, %67 %69 = mul i32 %68, 3 %70 = getelementptr inbounds i32, ptr addrspace(1) %11, i64 %26 - %71 = load i32, ptr addrspace(1) %70, align 4, !tbaa !141, !alias.scope !267, !noalias !268 + %71 = load i32, ptr addrspace(1) %70, align 4, !tbaa !144, !alias.scope !270, !noalias !271 %72 = add i32 %69, %71 %73 = mul i32 %72, 3 %74 = getelementptr inbounds i32, ptr addrspace(1) %12, i64 %26 - %75 = load i32, ptr addrspace(1) %74, align 4, !tbaa !141, !alias.scope !269, !noalias !270 + %75 = load i32, ptr addrspace(1) %74, align 4, !tbaa !144, !alias.scope !272, !noalias !273 %76 = add i32 %73, %75 %77 = mul i32 %76, 3 %78 = getelementptr inbounds i32, ptr addrspace(1) %13, i64 %26 - %79 = load i32, ptr addrspace(1) %78, align 4, !tbaa !141, !alias.scope !271, !noalias !272 + %79 = load i32, ptr addrspace(1) %78, align 4, !tbaa !144, !alias.scope !274, !noalias !275 %80 = add i32 %77, %79 %81 = mul i32 %80, 3 %82 = getelementptr inbounds i32, ptr addrspace(1) %14, i64 %26 - %83 = load i32, ptr addrspace(1) %82, align 4, !tbaa !141, !alias.scope !273, !noalias !274 + %83 = load i32, ptr addrspace(1) %82, align 4, !tbaa !144, !alias.scope !276, !noalias !277 %84 = add i32 %81, %83 %85 = mul i32 %84, 3 %86 = getelementptr inbounds i32, ptr addrspace(1) %15, i64 %26 - %87 = load i32, ptr addrspace(1) %86, align 4, !tbaa !141, !alias.scope !275, !noalias !276 + %87 = load i32, ptr addrspace(1) %86, align 4, !tbaa !144, !alias.scope !278, !noalias !279 %88 = add i32 %85, %87 %89 = mul i32 %88, 3 %90 = getelementptr inbounds i32, ptr addrspace(1) %16, i64 %26 - %91 = load i32, ptr addrspace(1) %90, align 4, !tbaa !141, !alias.scope !277, !noalias !278 + %91 = load i32, ptr addrspace(1) %90, align 4, !tbaa !144, !alias.scope !280, !noalias !281 %92 = add i32 %89, %91 %93 = mul i32 %92, 3 %94 = getelementptr inbounds i32, ptr addrspace(1) %17, i64 %26 - %95 = load i32, ptr addrspace(1) %94, align 4, !tbaa !141, !alias.scope !279, !noalias !280 + %95 = load i32, ptr addrspace(1) %94, align 4, !tbaa !144, !alias.scope !282, !noalias !283 %96 = add i32 %93, %95 %97 = mul i32 %96, 3 %98 = getelementptr inbounds i32, ptr addrspace(1) %18, i64 %26 - %99 = load i32, ptr addrspace(1) %98, align 4, !tbaa !141, !alias.scope !281, !noalias !282 + %99 = load i32, ptr addrspace(1) %98, align 4, !tbaa !144, !alias.scope !284, !noalias !285 %100 = add i32 %97, %99 %101 = mul i32 %100, 3 %102 = getelementptr inbounds i32, ptr addrspace(1) %19, i64 %26 - %103 = load i32, ptr addrspace(1) %102, align 4, !tbaa !141, !alias.scope !283, !noalias !284 + %103 = load i32, ptr addrspace(1) %102, align 4, !tbaa !144, !alias.scope !286, !noalias !287 %104 = add i32 %101, %103 %105 = mul i32 %104, 3 %106 = getelementptr inbounds i32, ptr addrspace(1) %20, i64 %26 - %107 = load i32, ptr addrspace(1) %106, align 4, !tbaa !141, !alias.scope !285, !noalias !286 + %107 = load i32, ptr addrspace(1) %106, align 4, !tbaa !144, !alias.scope !288, !noalias !289 %108 = add i32 %105, %107 %109 = mul i32 %108, 3 %110 = getelementptr inbounds i32, ptr addrspace(1) %21, i64 %26 - %111 = load i32, ptr addrspace(1) %110, align 4, !tbaa !141, !alias.scope !287, !noalias !288 + %111 = load i32, ptr addrspace(1) %110, align 4, !tbaa !144, !alias.scope !290, !noalias !291 %112 = add i32 %109, %111 %113 = mul i32 %112, 3 %114 = getelementptr inbounds i32, ptr addrspace(1) %22, i64 %26 - %115 = load i32, ptr addrspace(1) %114, align 4, !tbaa !141, !alias.scope !289, !noalias !290 + %115 = load i32, ptr addrspace(1) %114, align 4, !tbaa !144, !alias.scope !292, !noalias !293 %116 = add i32 %113, %115 %117 = getelementptr inbounds i32, ptr addrspace(1) %23, i64 %26 - store i32 %116, ptr addrspace(1) %117, align 4, !tbaa !141, !alias.scope !291, !noalias !292 + store i32 %116, ptr addrspace(1) %117, align 4, !tbaa !144, !alias.scope !294, !noalias !295 ret void } @@ -480,33 +480,33 @@ define void @wave_store(ptr addrspace(1) noundef writeonly captures(none) "air-b %5 = mul i32 %4, 5600 %6 = extractelement <2 x i32> %2, i64 0 %7 = add i32 %5, %6 - %8 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !293, !noalias !296 + %8 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !296, !noalias !299 %9 = add i32 %8, %7 %10 = zext i32 %7 to i64 %11 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %10 - store i32 %9, ptr addrspace(1) %11, align 4, !tbaa !141, !alias.scope !296, !noalias !293 + store i32 %9, ptr addrspace(1) %11, align 4, !tbaa !144, !alias.scope !299, !noalias !296 ret void } ; Function Attrs: mustprogress nofree nosync nounwind define void @signed_zero_products(ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(2) noundef readonly align 4 captures(none) dereferenceable(4) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #10 { %4 = and i32 %2, 63 - %5 = tail call float @air.convert.f.f32.u.i32(i32 %4) #18 + %5 = tail call float @air.convert.f.f32.u.i32(i32 %4) #19 %6 = lshr i32 %2, 6 %7 = and i32 %6, 63 - %8 = tail call float @air.convert.f.f32.u.i32(i32 %7) #18 + %8 = tail call float @air.convert.f.f32.u.i32(i32 %7) #19 %9 = fneg fast float %8 %10 = insertelement <4 x float> , float %5, i64 0 %11 = insertelement <4 x float> %10, float %9, i64 1 - %12 = load i32, ptr addrspace(2) %1, align 4, !tbaa !141, !alias.scope !298, !noalias !301 + %12 = load i32, ptr addrspace(2) %1, align 4, !tbaa !144, !alias.scope !301, !noalias !304 %13 = icmp eq i32 %12, 0 br i1 %13, label %21, label %14 14: ; preds = %3 - %15 = load float, ptr addrspace(2) @_ZL13positive_zero, align 4, !tbaa !148 + %15 = load float, ptr addrspace(2) @_ZL13positive_zero, align 4, !tbaa !151 %16 = insertelement <4 x float> poison, float %15, i64 0 %17 = shufflevector <4 x float> %16, <4 x float> poison, <4 x i32> zeroinitializer - %18 = load float, ptr addrspace(2) @_ZL13negative_zero, align 4, !tbaa !148 + %18 = load float, ptr addrspace(2) @_ZL13negative_zero, align 4, !tbaa !151 %19 = insertelement <4 x float> poison, float %18, i64 0 %20 = shufflevector <4 x float> %19, <4 x float> poison, <4 x i32> zeroinitializer br label %27 @@ -517,7 +517,7 @@ define void @signed_zero_products(ptr addrspace(1) noundef writeonly captures(no %24 = fadd <4 x float> %22, %23 %25 = zext i32 %2 to i64 %26 = getelementptr inbounds <4 x float>, ptr addrspace(1) %0, i64 %25 - store <4 x float> %24, ptr addrspace(1) %26, align 16, !tbaa !123, !alias.scope !301, !noalias !298 + store <4 x float> %24, ptr addrspace(1) %26, align 16, !tbaa !126, !alias.scope !304, !noalias !301 ret void 27: ; preds = %27, %14 @@ -528,17 +528,17 @@ define void @signed_zero_products(ptr addrspace(1) noundef writeonly captures(no %32 = fmul <4 x float> %20, %28 %33 = fadd <4 x float> %29, %31 %34 = fsub <4 x float> %33, %32 - %35 = tail call fast <4 x float> @air.fma.v4f32(<4 x float> %28, <4 x float> splat (float 9.687500e-01), <4 x float> splat (float 3.125000e-02)) #18 + %35 = tail call fast <4 x float> @air.fma.v4f32(<4 x float> %28, <4 x float> splat (float 9.687500e-01), <4 x float> splat (float 3.125000e-02)) #19 %36 = add nuw i32 %30, 1 %37 = icmp eq i32 %36, %12 - br i1 %37, label %21, label %27, !llvm.loop !303 + br i1 %37, label %21, label %27, !llvm.loop !306 } ; Function Attrs: convergent mustprogress nounwind define void @vote_loop(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #11 { %5 = zext i32 %2 to i64 %6 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %5 - %7 = load i32, ptr addrspace(1) %6, align 4, !tbaa !141, !alias.scope !304, !noalias !307 + %7 = load i32, ptr addrspace(1) %6, align 4, !tbaa !144, !alias.scope !307, !noalias !310 %8 = icmp eq i32 %7, 0 br i1 %8, label %9, label %14 @@ -547,7 +547,7 @@ define void @vote_loop(ptr addrspace(1) noundef readonly captures(none) "air-buf %11 = insertelement <2 x i32> undef, i32 %10, i64 0 %12 = insertelement <2 x i32> %11, i32 %3, i64 1 %13 = getelementptr inbounds <2 x i32>, ptr addrspace(1) %1, i64 %5 - store <2 x i32> %12, ptr addrspace(1) %13, align 8, !tbaa !123, !alias.scope !307, !noalias !304 + store <2 x i32> %12, ptr addrspace(1) %13, align 8, !tbaa !126, !alias.scope !310, !noalias !307 ret void 14: ; preds = %14, %4 @@ -555,21 +555,21 @@ define void @vote_loop(ptr addrspace(1) noundef readonly captures(none) "air-buf %16 = phi i32 [ %18, %14 ], [ %2, %4 ] %17 = mul i32 %16, 1664525 %18 = add i32 %17, 1013904223 - tail call void @air.simdgroup.barrier(i32 0, i32 4) #19 + tail call void @air.simdgroup.barrier(i32 0, i32 4) #20 %19 = add nuw i32 %15, 1 %20 = icmp eq i32 %19, %7 - br i1 %20, label %9, label %14, !llvm.loop !309 + br i1 %20, label %9, label %14, !llvm.loop !312 } ; Function Attrs: convergent mustprogress nounwind define void @group_sums(ptr addrspace(1) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, ptr addrspace(3) noundef captures(none) "air-buffer-no-alias" %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #11 { %8 = zext i32 %6 to i64 %9 = getelementptr inbounds i32, ptr addrspace(1) %0, i64 %8 - %10 = load i32, ptr addrspace(1) %9, align 4, !tbaa !141, !alias.scope !310, !noalias !313 + %10 = load i32, ptr addrspace(1) %9, align 4, !tbaa !144, !alias.scope !313, !noalias !316 %11 = zext i32 %3 to i64 %12 = getelementptr inbounds i32, ptr addrspace(3) %2, i64 %11 - store i32 %10, ptr addrspace(3) %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + store i32 %10, ptr addrspace(3) %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %13 = icmp ult i32 %4, 2 br i1 %13, label %14, label %16 @@ -587,33 +587,65 @@ define void @group_sums(ptr addrspace(1) noundef readonly captures(none) "air-bu %21 = add i32 %18, %3 %22 = zext i32 %21 to i64 %23 = getelementptr inbounds i32, ptr addrspace(3) %2, i64 %22 - %24 = load i32, ptr addrspace(3) %23, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - %25 = load i32, ptr addrspace(3) %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 + %24 = load i32, ptr addrspace(3) %23, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + %25 = load i32, ptr addrspace(3) %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 %26 = add i32 %25, %24 - store i32 %26, ptr addrspace(3) %12, align 4, !tbaa !141, !alias.scope !316, !noalias !317 + store i32 %26, ptr addrspace(3) %12, align 4, !tbaa !144, !alias.scope !319, !noalias !320 br label %27 27: ; preds = %20, %16 - tail call void @air.wg.barrier(i32 2, i32 1) #19 + tail call void @air.wg.barrier(i32 2, i32 1) #20 %28 = icmp ult i32 %17, 4 - br i1 %28, label %14, label %16, !llvm.loop !318 + br i1 %28, label %14, label %16, !llvm.loop !321 29: ; preds = %14 %30 = zext i32 %5 to i64 %31 = getelementptr inbounds i32, ptr addrspace(1) %1, i64 %30 - %32 = load i32, ptr addrspace(3) %2, align 4, !tbaa !141, !alias.scope !316, !noalias !317 - store i32 %32, ptr addrspace(1) %31, align 4, !tbaa !141, !alias.scope !319, !noalias !320 + %32 = load i32, ptr addrspace(3) %2, align 4, !tbaa !144, !alias.scope !319, !noalias !320 + store i32 %32, ptr addrspace(1) %31, align 4, !tbaa !144, !alias.scope !322, !noalias !323 br label %33 33: ; preds = %29, %14 ret void } +; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(argmem: readwrite) +define void @constant_reads(ptr addrspace(2) noundef readonly captures(none) "air-buffer-no-alias" %0, ptr addrspace(1) noundef writeonly captures(none) "air-buffer-no-alias" %1, i32 noundef %2) local_unnamed_addr #12 { + br label %7 + +4: ; preds = %7 + %5 = zext i32 %2 to i64 + %6 = getelementptr inbounds i32, ptr addrspace(1) %1, i64 %5 + store i32 %23, ptr addrspace(1) %6, align 4, !tbaa !144, !alias.scope !324, !noalias !327 + ret void + +7: ; preds = %7, %3 + %8 = phi i32 [ %2, %3 ], [ %23, %7 ] + %9 = phi i32 [ 0, %3 ], [ %24, %7 ] + %10 = mul nuw nsw i32 %9, 67 + %11 = add i32 %10, %2 + %12 = and i32 %11, 4095 + %13 = zext i32 %12 to i64 + %14 = getelementptr inbounds <4 x i32>, ptr addrspace(2) %0, i64 %13 + %15 = load <4 x i32>, ptr addrspace(2) %14, align 16, !tbaa !126, !alias.scope !327, !noalias !324 + %16 = extractelement <4 x i32> %15, i64 0 + %17 = xor i32 %16, %8 + %18 = extractelement <4 x i32> %15, i64 1 + %19 = xor i32 %17, %18 + %20 = extractelement <4 x i32> %15, i64 2 + %21 = extractelement <4 x i32> %15, i64 3 + %22 = xor i32 %20, %21 + %23 = add i32 %19, %22 + %24 = add nuw nsw i32 %9, 1 + %25 = icmp eq i32 %24, 64 + br i1 %25, label %4, label %7, !llvm.loop !329 +} + ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare float @air.fma.f32(float, float, float) local_unnamed_addr #2 ; Function Attrs: convergent mustprogress nounwind willreturn -declare void @air.wg.barrier(i32, i32) local_unnamed_addr #12 +declare void @air.wg.barrier(i32, i32) local_unnamed_addr #13 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare i32 @air.min.u.i32(i32, i32) local_unnamed_addr #2 @@ -625,35 +657,35 @@ declare i32 @air.clamp.s.i32(i32, i32, i32) local_unnamed_addr #2 declare <4 x float> @air.fma.v4f32(<4 x float>, <4 x float>, <4 x float>) local_unnamed_addr #2 ; Function Attrs: convergent mustprogress nounwind willreturn -declare void @air.simdgroup.barrier(i32, i32) local_unnamed_addr #12 +declare void @air.simdgroup.barrier(i32, i32) local_unnamed_addr #13 ; Function Attrs: convergent mustprogress nounwind willreturn -declare i32 @air.simd_sum.u.i32(i32) local_unnamed_addr #12 +declare i32 @air.simd_sum.u.i32(i32) local_unnamed_addr #13 ; Function Attrs: mustprogress nounwind willreturn memory(argmem: readwrite) -declare void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none), <2 x i32>, <4 x float>, i32, i32) local_unnamed_addr #13 +declare void @air.write_texture_2d.v4f32(ptr addrspace(1) captures(none), <2 x i32>, <4 x float>, i32, i32) local_unnamed_addr #14 ; Function Attrs: mustprogress nofree nounwind willreturn memory(inaccessiblemem: read) -declare ptr addrspace(2) @air.get_read_sampler() local_unnamed_addr #14 +declare ptr addrspace(2) @air.get_read_sampler() local_unnamed_addr #15 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) -declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #15 +declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #16 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) -declare i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none), i32) local_unnamed_addr #15 +declare i32 @air.get_width_texture_2d(ptr addrspace(1) readonly captures(none), i32) local_unnamed_addr #16 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) -declare i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none), i32) local_unnamed_addr #15 +declare i32 @air.get_height_texture_2d(ptr addrspace(1) readonly captures(none), i32) local_unnamed_addr #16 ; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(argmem: read) -declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #16 +declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #17 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write) -define internal void @_GLOBAL__sub_I__() #17 section "air.static_init" { - %1 = load float, ptr addrspace(2) @_Z13positive_zero.MTL_FC_INIT_0_f, align 4, !tbaa !148 - store float %1, ptr addrspace(2) @_ZL13positive_zero, align 4, !tbaa !148 - %2 = load float, ptr addrspace(2) @_Z13negative_zero.MTL_FC_INIT_1_f, align 4, !tbaa !148 - store float %2, ptr addrspace(2) @_ZL13negative_zero, align 4, !tbaa !148 +define internal void @_GLOBAL__sub_I__() #18 section "air.static_init" { + %1 = load float, ptr addrspace(2) @_Z13positive_zero.MTL_FC_INIT_0_f, align 4, !tbaa !151 + store float %1, ptr addrspace(2) @_ZL13positive_zero, align 4, !tbaa !151 + %2 = load float, ptr addrspace(2) @_Z13negative_zero.MTL_FC_INIT_1_f, align 4, !tbaa !151 + store float %2, ptr addrspace(2) @_ZL13negative_zero, align 4, !tbaa !151 ret void } @@ -669,27 +701,28 @@ attributes #8 = { convergent mustprogress nounwind willreturn "approx-func-fp-ma attributes #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="64" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } attributes #10 = { mustprogress nofree nosync nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } attributes #11 = { convergent mustprogress nounwind "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } -attributes #12 = { convergent mustprogress nounwind willreturn } -attributes #13 = { mustprogress nounwind willreturn memory(argmem: readwrite) } -attributes #14 = { mustprogress nofree nounwind willreturn memory(inaccessiblemem: read) } -attributes #15 = { mustprogress nofree nounwind willreturn memory(argmem: read) } -attributes #16 = { convergent mustprogress nofree nounwind willreturn memory(argmem: read) } -attributes #17 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } -attributes #18 = { nounwind willreturn memory(none) } -attributes #19 = { convergent nounwind willreturn } -attributes #20 = { nounwind willreturn memory(argmem: readwrite) } -attributes #21 = { nounwind willreturn memory(inaccessiblemem: read) } -attributes #22 = { nounwind willreturn memory(argmem: read) } -attributes #23 = { convergent nounwind willreturn memory(argmem: read) } +attributes #12 = { mustprogress nofree norecurse nosync nounwind memory(argmem: readwrite) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" } +attributes #13 = { convergent mustprogress nounwind willreturn } +attributes #14 = { mustprogress nounwind willreturn memory(argmem: readwrite) } +attributes #15 = { mustprogress nofree nounwind willreturn memory(inaccessiblemem: read) } +attributes #16 = { mustprogress nofree nounwind willreturn memory(argmem: read) } +attributes #17 = { convergent mustprogress nofree nounwind willreturn memory(argmem: read) } +attributes #18 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="0" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" } +attributes #19 = { nounwind willreturn memory(none) } +attributes #20 = { convergent nounwind willreturn } +attributes #21 = { nounwind willreturn memory(argmem: readwrite) } +attributes #22 = { nounwind willreturn memory(inaccessiblemem: read) } +attributes #23 = { nounwind willreturn memory(argmem: read) } +attributes #24 = { convergent nounwind willreturn memory(argmem: read) } !llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8} -!air.kernel = !{!9, !15, !21, !25, !30, !40, !44, !48, !51, !55, !60, !65, !68, !95, !98, !101, !106} -!air.compile_options = !{!114, !115, !116} -!air.function_constants = !{!117, !118} -!air.sampler_states = !{!119} -!llvm.ident = !{!120} -!air.version = !{!121} -!air.language_version = !{!122} +!air.kernel = !{!9, !15, !21, !25, !30, !40, !44, !48, !51, !55, !60, !65, !68, !95, !98, !101, !106, !114} +!air.compile_options = !{!117, !118, !119} +!air.function_constants = !{!120, !121} +!air.sampler_states = !{!122} +!llvm.ident = !{!123} +!air.version = !{!124} +!air.language_version = !{!125} !0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]} !1 = !{i32 1, !"wchar_size", i32 4} @@ -805,210 +838,219 @@ attributes #23 = { convergent nounwind willreturn memory(argmem: read) } !111 = !{i32 4, !"air.threads_per_threadgroup", !"air.arg_type_name", !"uint", !"air.arg_name", !"size"} !112 = !{i32 5, !"air.threadgroup_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"group"} !113 = !{i32 6, !"air.thread_position_in_grid", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"} -!114 = !{!"air.compile.denorms_disable"} -!115 = !{!"air.compile.fast_math_enable"} -!116 = !{!"air.compile.framebuffer_fetch_enable"} -!117 = !{ptr addrspace(2) @_Z13positive_zero.MTL_FC_INIT_0_f, !"float", !"positive_zero", i32 0} -!118 = !{ptr addrspace(2) @_Z13negative_zero.MTL_FC_INIT_1_f, !"float", !"negative_zero", i32 1} -!119 = !{!"air.sampler_state", ptr addrspace(2) @__air_sampler_state} -!120 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} -!121 = !{i32 2, i32 8, i32 0} -!122 = !{!"Metal", i32 4, i32 0, i32 0} -!123 = !{!124, !124, i64 0} -!124 = !{!"omnipotent char", !125, i64 0} -!125 = !{!"Simple C++ TBAA"} -!126 = !{!127} -!127 = distinct !{!127, !128, !"air-alias-scope-arg(0)"} -!128 = distinct !{!128, !"air-alias-scopes(copy_words)"} +!114 = !{ptr @constant_reads, !10, !115} +!115 = !{!116, !28, !14} +!116 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 2, !"air.arg_type_size", i32 16, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"uint4", !"air.arg_name", !"table"} +!117 = !{!"air.compile.denorms_disable"} +!118 = !{!"air.compile.fast_math_enable"} +!119 = !{!"air.compile.framebuffer_fetch_enable"} +!120 = !{ptr addrspace(2) @_Z13positive_zero.MTL_FC_INIT_0_f, !"float", !"positive_zero", i32 0} +!121 = !{ptr addrspace(2) @_Z13negative_zero.MTL_FC_INIT_1_f, !"float", !"negative_zero", i32 1} +!122 = !{!"air.sampler_state", ptr addrspace(2) @__air_sampler_state} +!123 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"} +!124 = !{i32 2, i32 8, i32 0} +!125 = !{!"Metal", i32 4, i32 0, i32 0} +!126 = !{!127, !127, i64 0} +!127 = !{!"omnipotent char", !128, i64 0} +!128 = !{!"Simple C++ TBAA"} !129 = !{!130} -!130 = distinct !{!130, !128, !"air-alias-scope-arg(1)"} -!131 = !{!132} -!132 = distinct !{!132, !133, !"air-alias-scope-arg(0)"} -!133 = distinct !{!133, !"air-alias-scopes(scale_offset)"} -!134 = !{!135, !136} -!135 = distinct !{!135, !133, !"air-alias-scope-arg(1)"} -!136 = distinct !{!136, !133, !"air-alias-scope-arg(2)"} -!137 = !{!136} -!138 = !{!132, !135} -!139 = !{!135} -!140 = !{!132, !136} -!141 = !{!142, !142, i64 0} -!142 = !{!"int", !124, i64 0} -!143 = !{!144} -!144 = distinct !{!144, !145, !"air-alias-scope-arg(1)"} -!145 = distinct !{!145, !"air-alias-scopes(fma_chains)"} +!130 = distinct !{!130, !131, !"air-alias-scope-arg(0)"} +!131 = distinct !{!131, !"air-alias-scopes(copy_words)"} +!132 = !{!133} +!133 = distinct !{!133, !131, !"air-alias-scope-arg(1)"} +!134 = !{!135} +!135 = distinct !{!135, !136, !"air-alias-scope-arg(0)"} +!136 = distinct !{!136, !"air-alias-scopes(scale_offset)"} +!137 = !{!138, !139} +!138 = distinct !{!138, !136, !"air-alias-scope-arg(1)"} +!139 = distinct !{!139, !136, !"air-alias-scope-arg(2)"} +!140 = !{!139} +!141 = !{!135, !138} +!142 = !{!138} +!143 = !{!135, !139} +!144 = !{!145, !145, i64 0} +!145 = !{!"int", !127, i64 0} !146 = !{!147} -!147 = distinct !{!147, !145, !"air-alias-scope-arg(0)"} -!148 = !{!149, !149, i64 0} -!149 = !{!"float", !124, i64 0} -!150 = distinct !{!150, !151} -!151 = !{!"llvm.loop.mustprogress"} -!152 = !{!153} -!153 = distinct !{!153, !154, !"air-alias-scope-arg(0)"} -!154 = distinct !{!154, !"air-alias-scopes(block_scan)"} +!147 = distinct !{!147, !148, !"air-alias-scope-arg(1)"} +!148 = distinct !{!148, !"air-alias-scopes(fma_chains)"} +!149 = !{!150} +!150 = distinct !{!150, !148, !"air-alias-scope-arg(0)"} +!151 = !{!152, !152, i64 0} +!152 = !{!"float", !127, i64 0} +!153 = distinct !{!153, !154} +!154 = !{!"llvm.loop.mustprogress"} !155 = !{!156} -!156 = distinct !{!156, !154, !"air-alias-scope-arg(1)"} -!157 = distinct !{!157, !151} +!156 = distinct !{!156, !157, !"air-alias-scope-arg(0)"} +!157 = distinct !{!157, !"air-alias-scopes(block_scan)"} !158 = !{!159} -!159 = distinct !{!159, !160, !"air-alias-scope-arg(2)"} -!160 = distinct !{!160, !"air-alias-scopes(reduce_sum)"} -!161 = !{!162, !163} -!162 = distinct !{!162, !160, !"air-alias-scope-arg(0)"} -!163 = distinct !{!163, !160, !"air-alias-scope-arg(1)"} -!164 = !{!162} -!165 = !{!163, !159} -!166 = distinct !{!166, !151} -!167 = distinct !{!167, !151} -!168 = !{!163} -!169 = !{!162, !159} -!170 = !{!171} -!171 = distinct !{!171, !172, !"air-alias-scope-arg(2)"} -!172 = distinct !{!172, !"air-alias-scopes(binomial3x3)"} -!173 = !{!174, !175} -!174 = distinct !{!174, !172, !"air-alias-scope-arg(0)"} -!175 = distinct !{!175, !172, !"air-alias-scope-arg(1)"} -!176 = !{!175} -!177 = !{!174, !171} -!178 = distinct !{!178, !151} -!179 = !{!174} -!180 = !{!175, !171} -!181 = distinct !{!181, !151} -!182 = !{!183} -!183 = distinct !{!183, !184, !"air-alias-scope-arg(0)"} -!184 = distinct !{!184, !"air-alias-scopes(lcg_step)"} +!159 = distinct !{!159, !157, !"air-alias-scope-arg(1)"} +!160 = distinct !{!160, !154} +!161 = !{!162} +!162 = distinct !{!162, !163, !"air-alias-scope-arg(2)"} +!163 = distinct !{!163, !"air-alias-scopes(reduce_sum)"} +!164 = !{!165, !166} +!165 = distinct !{!165, !163, !"air-alias-scope-arg(0)"} +!166 = distinct !{!166, !163, !"air-alias-scope-arg(1)"} +!167 = !{!165} +!168 = !{!166, !162} +!169 = distinct !{!169, !154} +!170 = distinct !{!170, !154} +!171 = !{!166} +!172 = !{!165, !162} +!173 = !{!174} +!174 = distinct !{!174, !175, !"air-alias-scope-arg(2)"} +!175 = distinct !{!175, !"air-alias-scopes(binomial3x3)"} +!176 = !{!177, !178} +!177 = distinct !{!177, !175, !"air-alias-scope-arg(0)"} +!178 = distinct !{!178, !175, !"air-alias-scope-arg(1)"} +!179 = !{!178} +!180 = !{!177, !174} +!181 = distinct !{!181, !154} +!182 = !{!177} +!183 = !{!178, !174} +!184 = distinct !{!184, !154} !185 = !{!186} -!186 = distinct !{!186, !184, !"air-alias-scope-arg(1)"} -!187 = !{!188} -!188 = distinct !{!188, !189, !"air-alias-scope-arg(1)"} -!189 = distinct !{!189, !"air-alias-scopes(narrow_mix)"} +!186 = distinct !{!186, !187, !"air-alias-scope-arg(0)"} +!187 = distinct !{!187, !"air-alias-scopes(lcg_step)"} +!188 = !{!189} +!189 = distinct !{!189, !187, !"air-alias-scope-arg(1)"} !190 = !{!191} -!191 = distinct !{!191, !189, !"air-alias-scope-arg(0)"} -!192 = distinct !{!192, !151} +!191 = distinct !{!191, !192, !"air-alias-scope-arg(1)"} +!192 = distinct !{!192, !"air-alias-scopes(narrow_mix)"} !193 = !{!194} -!194 = distinct !{!194, !195, !"air-alias-scope-arg(1)"} -!195 = distinct !{!195, !"air-alias-scopes(texels_in)"} -!196 = !{!197, !198} -!197 = distinct !{!197, !195, !"air-alias-scope-arg(0)"} -!198 = distinct !{!198, !195, !"air-alias-scope-textures"} -!199 = !{!197} -!200 = !{!194, !198} -!201 = !{!198} -!202 = !{!197, !194} -!203 = !{!204} -!204 = distinct !{!204, !205, !"air-alias-scope-arg(2)"} -!205 = distinct !{!205, !"air-alias-scopes(texels_out)"} -!206 = !{!207, !208} -!207 = distinct !{!207, !205, !"air-alias-scope-textures"} -!208 = distinct !{!208, !205, !"air-alias-scope-arg(1)"} -!209 = !{!208} -!210 = !{!207, !204} -!211 = !{!212} -!212 = distinct !{!212, !213, !"air-alias-scope-textures"} -!213 = distinct !{!213, !"air-alias-scopes(sample_down)"} +!194 = distinct !{!194, !192, !"air-alias-scope-arg(0)"} +!195 = distinct !{!195, !154} +!196 = !{!197} +!197 = distinct !{!197, !198, !"air-alias-scope-arg(1)"} +!198 = distinct !{!198, !"air-alias-scopes(texels_in)"} +!199 = !{!200, !201} +!200 = distinct !{!200, !198, !"air-alias-scope-arg(0)"} +!201 = distinct !{!201, !198, !"air-alias-scope-textures"} +!202 = !{!200} +!203 = !{!197, !201} +!204 = !{!201} +!205 = !{!200, !197} +!206 = !{!207} +!207 = distinct !{!207, !208, !"air-alias-scope-arg(2)"} +!208 = distinct !{!208, !"air-alias-scopes(texels_out)"} +!209 = !{!210, !211} +!210 = distinct !{!210, !208, !"air-alias-scope-textures"} +!211 = distinct !{!211, !208, !"air-alias-scope-arg(1)"} +!212 = !{!211} +!213 = !{!210, !207} !214 = !{!215} -!215 = distinct !{!215, !213, !"air-alias-scope-samplers"} -!216 = !{!212, !215} +!215 = distinct !{!215, !216, !"air-alias-scope-textures"} +!216 = distinct !{!216, !"air-alias-scopes(sample_down)"} !217 = !{!218} -!218 = distinct !{!218, !219, !"air-alias-scope-textures"} -!219 = distinct !{!219, !"air-alias-scopes(sample_up)"} +!218 = distinct !{!218, !216, !"air-alias-scope-samplers"} +!219 = !{!215, !218} !220 = !{!221} -!221 = distinct !{!221, !222, !"air-alias-scope-arg(0)"} -!222 = distinct !{!222, !"air-alias-scopes(wide_bindings)"} -!223 = !{!224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!224 = distinct !{!224, !222, !"air-alias-scope-arg(1)"} -!225 = distinct !{!225, !222, !"air-alias-scope-arg(2)"} -!226 = distinct !{!226, !222, !"air-alias-scope-arg(3)"} -!227 = distinct !{!227, !222, !"air-alias-scope-arg(4)"} -!228 = distinct !{!228, !222, !"air-alias-scope-arg(5)"} -!229 = distinct !{!229, !222, !"air-alias-scope-arg(6)"} -!230 = distinct !{!230, !222, !"air-alias-scope-arg(7)"} -!231 = distinct !{!231, !222, !"air-alias-scope-arg(8)"} -!232 = distinct !{!232, !222, !"air-alias-scope-arg(9)"} -!233 = distinct !{!233, !222, !"air-alias-scope-arg(10)"} -!234 = distinct !{!234, !222, !"air-alias-scope-arg(11)"} -!235 = distinct !{!235, !222, !"air-alias-scope-arg(12)"} -!236 = distinct !{!236, !222, !"air-alias-scope-arg(13)"} -!237 = distinct !{!237, !222, !"air-alias-scope-arg(14)"} -!238 = distinct !{!238, !222, !"air-alias-scope-arg(15)"} -!239 = distinct !{!239, !222, !"air-alias-scope-arg(16)"} -!240 = distinct !{!240, !222, !"air-alias-scope-arg(17)"} -!241 = distinct !{!241, !222, !"air-alias-scope-arg(18)"} -!242 = distinct !{!242, !222, !"air-alias-scope-arg(19)"} -!243 = distinct !{!243, !222, !"air-alias-scope-arg(20)"} -!244 = distinct !{!244, !222, !"air-alias-scope-arg(21)"} -!245 = distinct !{!245, !222, !"air-alias-scope-arg(22)"} -!246 = distinct !{!246, !222, !"air-alias-scope-arg(23)"} -!247 = !{!224} -!248 = !{!221, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!249 = !{!225} -!250 = !{!221, !224, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!251 = !{!226} -!252 = !{!221, !224, !225, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!253 = !{!227} -!254 = !{!221, !224, !225, !226, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!255 = !{!228} -!256 = !{!221, !224, !225, !226, !227, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!257 = !{!229} -!258 = !{!221, !224, !225, !226, !227, !228, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!259 = !{!230} -!260 = !{!221, !224, !225, !226, !227, !228, !229, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!261 = !{!231} -!262 = !{!221, !224, !225, !226, !227, !228, !229, !230, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!263 = !{!232} -!264 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!265 = !{!233} -!266 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!267 = !{!234} -!268 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!269 = !{!235} -!270 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!271 = !{!236} -!272 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!273 = !{!237} -!274 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !238, !239, !240, !241, !242, !243, !244, !245, !246} -!275 = !{!238} -!276 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !239, !240, !241, !242, !243, !244, !245, !246} -!277 = !{!239} -!278 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !240, !241, !242, !243, !244, !245, !246} -!279 = !{!240} -!280 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !241, !242, !243, !244, !245, !246} -!281 = !{!241} -!282 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !242, !243, !244, !245, !246} -!283 = !{!242} -!284 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !243, !244, !245, !246} -!285 = !{!243} -!286 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !244, !245, !246} -!287 = !{!244} -!288 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !245, !246} -!289 = !{!245} -!290 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !246} -!291 = !{!246} -!292 = !{!221, !224, !225, !226, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245} -!293 = !{!294} -!294 = distinct !{!294, !295, !"air-alias-scope-arg(1)"} -!295 = distinct !{!295, !"air-alias-scopes(wave_store)"} +!221 = distinct !{!221, !222, !"air-alias-scope-textures"} +!222 = distinct !{!222, !"air-alias-scopes(sample_up)"} +!223 = !{!224} +!224 = distinct !{!224, !225, !"air-alias-scope-arg(0)"} +!225 = distinct !{!225, !"air-alias-scopes(wide_bindings)"} +!226 = !{!227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!227 = distinct !{!227, !225, !"air-alias-scope-arg(1)"} +!228 = distinct !{!228, !225, !"air-alias-scope-arg(2)"} +!229 = distinct !{!229, !225, !"air-alias-scope-arg(3)"} +!230 = distinct !{!230, !225, !"air-alias-scope-arg(4)"} +!231 = distinct !{!231, !225, !"air-alias-scope-arg(5)"} +!232 = distinct !{!232, !225, !"air-alias-scope-arg(6)"} +!233 = distinct !{!233, !225, !"air-alias-scope-arg(7)"} +!234 = distinct !{!234, !225, !"air-alias-scope-arg(8)"} +!235 = distinct !{!235, !225, !"air-alias-scope-arg(9)"} +!236 = distinct !{!236, !225, !"air-alias-scope-arg(10)"} +!237 = distinct !{!237, !225, !"air-alias-scope-arg(11)"} +!238 = distinct !{!238, !225, !"air-alias-scope-arg(12)"} +!239 = distinct !{!239, !225, !"air-alias-scope-arg(13)"} +!240 = distinct !{!240, !225, !"air-alias-scope-arg(14)"} +!241 = distinct !{!241, !225, !"air-alias-scope-arg(15)"} +!242 = distinct !{!242, !225, !"air-alias-scope-arg(16)"} +!243 = distinct !{!243, !225, !"air-alias-scope-arg(17)"} +!244 = distinct !{!244, !225, !"air-alias-scope-arg(18)"} +!245 = distinct !{!245, !225, !"air-alias-scope-arg(19)"} +!246 = distinct !{!246, !225, !"air-alias-scope-arg(20)"} +!247 = distinct !{!247, !225, !"air-alias-scope-arg(21)"} +!248 = distinct !{!248, !225, !"air-alias-scope-arg(22)"} +!249 = distinct !{!249, !225, !"air-alias-scope-arg(23)"} +!250 = !{!227} +!251 = !{!224, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!252 = !{!228} +!253 = !{!224, !227, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!254 = !{!229} +!255 = !{!224, !227, !228, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!256 = !{!230} +!257 = !{!224, !227, !228, !229, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!258 = !{!231} +!259 = !{!224, !227, !228, !229, !230, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!260 = !{!232} +!261 = !{!224, !227, !228, !229, !230, !231, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!262 = !{!233} +!263 = !{!224, !227, !228, !229, !230, !231, !232, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!264 = !{!234} +!265 = !{!224, !227, !228, !229, !230, !231, !232, !233, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!266 = !{!235} +!267 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!268 = !{!236} +!269 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!270 = !{!237} +!271 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!272 = !{!238} +!273 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!274 = !{!239} +!275 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !240, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!276 = !{!240} +!277 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !241, !242, !243, !244, !245, !246, !247, !248, !249} +!278 = !{!241} +!279 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !242, !243, !244, !245, !246, !247, !248, !249} +!280 = !{!242} +!281 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !243, !244, !245, !246, !247, !248, !249} +!282 = !{!243} +!283 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !244, !245, !246, !247, !248, !249} +!284 = !{!244} +!285 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !245, !246, !247, !248, !249} +!286 = !{!245} +!287 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !246, !247, !248, !249} +!288 = !{!246} +!289 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !247, !248, !249} +!290 = !{!247} +!291 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !248, !249} +!292 = !{!248} +!293 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !249} +!294 = !{!249} +!295 = !{!224, !227, !228, !229, !230, !231, !232, !233, !234, !235, !236, !237, !238, !239, !240, !241, !242, !243, !244, !245, !246, !247, !248} !296 = !{!297} -!297 = distinct !{!297, !295, !"air-alias-scope-arg(0)"} -!298 = !{!299} -!299 = distinct !{!299, !300, !"air-alias-scope-arg(1)"} -!300 = distinct !{!300, !"air-alias-scopes(signed_zero_products)"} +!297 = distinct !{!297, !298, !"air-alias-scope-arg(1)"} +!298 = distinct !{!298, !"air-alias-scopes(wave_store)"} +!299 = !{!300} +!300 = distinct !{!300, !298, !"air-alias-scope-arg(0)"} !301 = !{!302} -!302 = distinct !{!302, !300, !"air-alias-scope-arg(0)"} -!303 = distinct !{!303, !151} +!302 = distinct !{!302, !303, !"air-alias-scope-arg(1)"} +!303 = distinct !{!303, !"air-alias-scopes(signed_zero_products)"} !304 = !{!305} -!305 = distinct !{!305, !306, !"air-alias-scope-arg(0)"} -!306 = distinct !{!306, !"air-alias-scopes(vote_loop)"} +!305 = distinct !{!305, !303, !"air-alias-scope-arg(0)"} +!306 = distinct !{!306, !154} !307 = !{!308} -!308 = distinct !{!308, !306, !"air-alias-scope-arg(1)"} -!309 = distinct !{!309, !151} +!308 = distinct !{!308, !309, !"air-alias-scope-arg(0)"} +!309 = distinct !{!309, !"air-alias-scopes(vote_loop)"} !310 = !{!311} -!311 = distinct !{!311, !312, !"air-alias-scope-arg(0)"} -!312 = distinct !{!312, !"air-alias-scopes(group_sums)"} -!313 = !{!314, !315} -!314 = distinct !{!314, !312, !"air-alias-scope-arg(1)"} -!315 = distinct !{!315, !312, !"air-alias-scope-arg(2)"} -!316 = !{!315} -!317 = !{!311, !314} -!318 = distinct !{!318, !151} -!319 = !{!314} -!320 = !{!311, !315} +!311 = distinct !{!311, !309, !"air-alias-scope-arg(1)"} +!312 = distinct !{!312, !154} +!313 = !{!314} +!314 = distinct !{!314, !315, !"air-alias-scope-arg(0)"} +!315 = distinct !{!315, !"air-alias-scopes(group_sums)"} +!316 = !{!317, !318} +!317 = distinct !{!317, !315, !"air-alias-scope-arg(1)"} +!318 = distinct !{!318, !315, !"air-alias-scope-arg(2)"} +!319 = !{!318} +!320 = !{!314, !317} +!321 = distinct !{!321, !154} +!322 = !{!317} +!323 = !{!314, !318} +!324 = !{!325} +!325 = distinct !{!325, !326, !"air-alias-scope-arg(1)"} +!326 = distinct !{!326, !"air-alias-scopes(constant_reads)"} +!327 = !{!328} +!328 = distinct !{!328, !326, !"air-alias-scope-arg(0)"} +!329 = distinct !{!329, !154} diff --git a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.metal b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.metal index 7b7fd9151..63ace9611 100644 --- a/crates/metal2vulkan-validation/fixtures/public/harness/workloads.metal +++ b/crates/metal2vulkan-validation/fixtures/public/harness/workloads.metal @@ -2,8 +2,8 @@ // standing for a class of compute work: bandwidth-bound, ALU-bound, threadgroup memory with // barriers, SIMD reductions, 2D image-like indexing, many tiny dispatches in a chain, narrow // integer arithmetic, sampling through a runtime sampler and through a constexpr one, products -// by a constant zero of either sign, many buffers bound for each of many dispatches, and many -// one-wave threadgroups that each do almost nothing. Written +// by a constant zero of either sign, many buffers bound for each of many dispatches, many +// one-wave threadgroups that each do almost nothing, and reads of a table of constants. Written // from scratch for it; `scripts/regen-air-fixtures/regen-air-fixtures.sh --dir harness` compiles // it. The harness holds a CPU reference of every result. No translator sweep reads this directory. #include @@ -302,3 +302,17 @@ kernel void group_sums(device const uint *source [[buffer(0)]], sums[group] = scratch[0]; } } + +// Reads of a 64 KiB table in the constant address space, as a program reads a constant buffer it +// updates a little before each frame: each thread folds 64 of the table's 4,096 entries into one +// word, the threads of a threadgroup reading consecutive entries. +kernel void constant_reads(constant uint4 *table [[buffer(0)]], + device uint *destination [[buffer(1)]], + uint index [[thread_position_in_grid]]) { + uint folded = index; + for (uint i = 0; i < 64; ++i) { + uint4 entry = table[(index + i * 67) & 4095]; + folded = (folded ^ entry.x ^ entry.y) + (entry.z ^ entry.w); + } + destination[index] = folded; +}