Mapping instructions between original and modified scop

6 views
Skip to first unread message

Ejjeh, Adel

unread,
Jul 22, 2022, 4:32:17 PM7/22/22
to poll...@googlegroups.com

Hi

 

I am using polly in my own LLVM pass where I modify the schedule of a given scop then directly invoke “polly::CodeGen()” to codegen the updated loop with the new schedule. I have modified the CodeGen() method to where I always only include the new loop instead of conditionally executing it since that fits with the requirements of my pass. I am trying to find a way to map the memory instructions in the original scop to the newly generated one since I need to do some post processing on them after codegen. Is there an existing data structure or mechanism within the Polly environment that can give me that information?

 

Thanks

-Adel

Michael Kruse

unread,
Jul 26, 2022, 8:38:15 PM7/26/22
to Ejjeh, Adel, poll...@googlegroups.com
If I understand correctly, you are looking for the LoadInst or StoreInst for a given MemoryAccess object? MemoryAccess::getAccessInstruction() will return this.

Be aware that there can be multiple MemoryAccesses associated with the same  llvm::Instructions. For instance, when 

%ld = load i8, ptr %ptr

there can be one MemoryAccess for reading from %ptr, and a write MemoryAccess for storing the result in the register %ld (depends on how %ld is used).

Michael




--
You received this message because you are subscribed to the Google Groups "Polly Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polly-dev+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/polly-dev/DM6PR11MB462805953D31D9DE3CDCF814B2909%40DM6PR11MB4628.namprd11.prod.outlook.com.


--
Tardyzentrismus verboten!
Reply all
Reply to author
Forward
0 new messages