[PATCH] D28031: Allow target to specify early module passes

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 16:40:29 PST 2017


rampitec updated this revision to Diff 82974.
rampitec added a comment.
Herald added a subscriber: wdng.

I have modified the patch to always use module pass manager, as discussed.
Justin, I could extract new pass in a separate file and add INITIALIZE_PASS if you wish, but I'm really not sure you will like the implementation when you see it.
Of course the same change will be needed in the BackendUtil.cpp.
Sorry, I did not split off AMDGPU changes, as I would then need to create all the same wrapper for function pass.
Also note, to make this working I had to patch NVVMIntrRange.cpp. The problem is NVPTXSubtarget::SmVersion is only initialized to value 20 and never modified. The pass expects value from -nvvm-intr-range-sm, and whenever the option or NVPTXSubtarget::SmVersion would take precedence really depends on the initialization order. This is just a w/a for the problem exposed by the change.


Repository:
  rL LLVM

https://reviews.llvm.org/D28031

Files:
  lib/Target/AMDGPU/AMDGPU.h
  lib/Target/AMDGPU/AMDGPUUnifyMetadata.cpp
  lib/Target/NVPTX/NVPTXTargetMachine.cpp
  lib/Target/NVPTX/NVVMIntrRange.cpp
  test/CodeGen/AMDGPU/unify-metadata.ll
  tools/opt/opt.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28031.82974.patch
Type: text/x-patch
Size: 5541 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170104/23f99bcb/attachment.bin>


More information about the llvm-commits mailing list