Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bmanga committed May 28, 2024
1 parent 48a3e1c commit 918bbe6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions lib/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ int RunPassPipeline(llvm::Module &M, llvm::raw_svector_ostream *binaryStream) {
pm.addPass(clspv::AutoPodArgsPass());
pm.addPass(clspv::DeclarePushConstantsPass());
pm.addPass(clspv::DefineOpenCLWorkItemBuiltinsPass());
// Replace the LLVM intrinsics. This will give them a chance to be better
// optimized through the pipeline. It also helps with generic address space
// lowering.
pm.addPass(clspv::ReplaceLLVMIntrinsicsPass());

// RewritePackedStructsPass will rewrite packed struct types, and
// ReplacePointerBitcastPass will lower the new packed struct type. So,
Expand Down Expand Up @@ -571,9 +575,6 @@ int RunPassPipeline(llvm::Module &M, llvm::raw_svector_ostream *binaryStream) {
// This pass needs to be after every inlining to make sure we are capable of
// removing every addrspacecast. It only needs to run if generic addrspace
// is used.

pm.addPass(clspv::ReplaceLLVMIntrinsicsPass());

if (clspv::Option::LanguageUsesGenericAddressSpace()) {
pm.addPass(clspv::ReplaceOpenCLBuiltinPass());
pm.addPass(clspv::LowerAddrSpaceCastPass());
Expand Down
8 changes: 4 additions & 4 deletions test/LLVMIntrinsics/descend_into_array.cl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ __kernel void foo(__global outer* out, global outer* in) {
// CHECK: [[zero:%[0-9a-zA-Z_]+]] = OpConstant {{.*}} 0
// CHECK: [[dst:%[0-9a-zA-Z_]+]] = OpVariable {{.*}} StorageBuffer
// CHECK: [[src:%[0-9a-zA-Z_]+]] = OpVariable {{.*}} StorageBuffer
// CHECK-DAG: [[src_gep:%[0-9a-zA-Z_]+]] = OpAccessChain {{.*}} [[src]] [[zero]] [[zero]]
// CHECK-DAG: OpLoad {{.*}} [[src_gep]]
// CHECK-DAG: [[dst_gep:%[0-9a-zA-Z_]+]] = OpAccessChain {{.*}} [[dst]] [[zero]] [[zero]]
// CHECK-DAG: OpStore [[dst_gep]]
// CHECK: [[dst_gep:%[0-9a-zA-Z_]+]] = OpAccessChain {{.*}} [[dst]] [[zero]] [[zero]]
// CHECK: [[src_gep:%[0-9a-zA-Z_]+]] = OpAccessChain {{.*}} [[src]] [[zero]] [[zero]]
// CHECK: OpLoad {{.*}} [[src_gep]]
// CHECK: OpStore [[dst_gep]]
2 changes: 1 addition & 1 deletion test/LLVMIntrinsics/memcpy_from_constant.cl
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ void kernel memcpy_from_constant(global float* result) {
// CHECK: OpStore [[ssbo_gep3]] [[gep3]]

// CHECK: [[ssbo_gep4:%[a-zA-Z0-9_]+]] = OpAccessChain [[ptr_ssbo_float]] [[ssbo]] [[uint_0]] [[uint_4]]
// CHECK: OpStore [[ssbo_gep4]] [[gep4]]
// CHECK: OpStore [[ssbo_gep4]] [[gep4]]

0 comments on commit 918bbe6

Please sign in to comment.