Skip to content

Commit 16c2fc6

Browse files
yu810226keryell
authored andcommitted
Make host code not executing "loop idiom"
"loop idiom" pass will be executed after "SYCL arguments flattening" pass for host.
1 parent 11dc8cd commit 16c2fc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/CodeGen/BackendUtil.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,12 @@ void EmitAssemblyHelper::CreatePasses(legacy::PassManager &MPM,
646646
// choke current Xilinx xocc compiler, the EnableLoopIdiom flag here is set
647647
// to false for not executing "loop idiom" pass when compiling souce code
648648
// of SYCL kernel.
649-
if (LangOpts.SYCLIsDevice)
649+
// And Since argument promotion can only be done with GEP instructions that
650+
// only used by loads. If llvm.memcpy intrinsics, there will always be a
651+
// cast instruction before to cast the pointer, so for the host code, the
652+
// EnableLoopIdiom flag here force skipping "loop idiom" pass. The pass will
653+
// be executed after "SYCL arguments flattening" pass.
654+
if (LangOpts.SYCL)
650655
PMBuilder.EnableLoopIdiom = false;
651656
PMBuilder.populateModulePassManager(MPM);
652657
}

0 commit comments

Comments
 (0)