Skip to content

Replace OpKill With function call.#2790

Merged
s-perron merged 2 commits intoKhronosGroup:masterfrom
s-perron:opkill
Aug 14, 2019
Merged

Replace OpKill With function call.#2790
s-perron merged 2 commits intoKhronosGroup:masterfrom
s-perron:opkill

Conversation

@s-perron
Copy link
Copy Markdown
Collaborator

We are no able to inline OpKill instructions into a continue construct.
See #2433. However, we have to be able to inline to correctly do
legalization. This commit creates a pass that will wrap OpKill
instructions into a function of its own. That way we are able to inline
the rest of the code.

The follow up to this will be to not inline any function that contains
an OpKill.

Fixes #2726

@s-perron s-perron requested a review from dnovillo August 12, 2019 14:47
@s-perron s-perron self-assigned this Aug 12, 2019
We are no able to inline OpKill instructions into a continue construct.
See KhronosGroup#2433.  However, we have to be able to inline to correctly do
legalization.  This commit creates a pass that will wrap OpKill
instructions into a function of its own.  That way we are able to inline
the rest of the code.

The follow up to this will be to not inline any function that contains
an OpKill.

Fixes KhronosGroup#2726
Pass::Status WrapOpKill::Process() {
bool modified = false;

for (auto& func : *get_module()) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this pass is applied multiple times, it will create opkill wrappers of opkill wrappers. It will also do that if the function contains OpKill as its single instruction.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change this if you think it is a real problem. If you call inlining after this pass, then the wrappers of wrappers will disappear. I can add some pattern matching code to recognize that case if you want, but personally I prefer writing less code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change this if you think it is a real problem. If you call inlining after this pass, then the wrappers of wrappers will disappear. I can add some pattern matching code to recognize that case if you want, but personally I prefer writing less code.

It's not really a big deal. Given the operation you're wrapping, it doesn't really matter if it gets wrapped up in 20 calls. If it becomes a problem, we can address it later.

@s-perron s-perron merged commit 60043ed into KhronosGroup:master Aug 14, 2019
@s-perron s-perron deleted the opkill branch August 14, 2019 13:27
dneto0 pushed a commit to dneto0/SPIRV-Tools that referenced this pull request Sep 14, 2024
Roll third_party/glslang/ 37fc4d2..95609e6 (1 commit)

KhronosGroup/glslang@37fc4d2...95609e6

$ git log 37fc4d2..95609e6 --date=short --no-merges --format='%ad %ae %s'
2019-08-14 johnkslang Set theme jekyll-theme-merlot

Roll third_party/googletest/ 90a443f9c..c9ccac7cb (18 commits)

google/googletest@90a443f...c9ccac7

$ git log 90a443f9c..c9ccac7cb --date=short --no-merges --format='%ad %ae %s'
2019-08-19 misterg Googletest export
2019-08-16 absl-team Googletest export
2019-08-16 absl-team Googletest export
2019-08-16 misterg Googletest export
2019-08-16 misterg Googletest export
2019-08-16 misterg Googletest export
2019-08-15 misterg Googletest export
2019-08-15 absl-team Googletest export
2019-08-12 absl-team Googletest export
2019-08-09 absl-team Googletest export
2019-08-09 absl-team Googletest export
2019-08-13 krystian.kuzniarek remove custom implementations of std::is_same
2019-08-14 krystian.kuzniarek remove a custom implementation of std::is_reference
2019-08-11 adam.f.badura Use -Wa,-mbig-obj for Cygwin/MinGW always
2019-08-11 krystian.kuzniarek remove an outdated comment
2019-08-08 krystian.kuzniarek remove a dead metafunction
2019-08-07 contact Update Bazel on Windows
2019-08-07 contact Prepare for Bazel incompatible changes

Roll third_party/re2/ 67bce690d..be0e1305d (15 commits)

google/re2@67bce69...be0e130

$ git log 67bce690d..be0e1305d --date=short --no-merges --format='%ad %ae %s'
2019-08-19 junyer Add Clang 9 to the Travis CI matrix.
2019-08-19 junyer Don't assume that iterators are just pointers.
2019-08-18 junyer No, it was right before. Try the /cygdrive form.
2019-08-18 junyer Try under 'C:\Program Files (x86)' instead. Sigh.
2019-08-18 junyer Ensure that CMake is in the path on Windows.
2019-08-18 junyer Comment on why we pin to Visual Studio 2015.
2019-08-18 junyer Attempt to avoid VCVARSALL.BAT breakage entirely.
2019-08-18 junyer Attempt to address VCVARSALL.BAT breakage. Sigh.
2019-08-18 junyer Argh. Try a different flag.
2019-08-18 junyer Try to upgrade Bazel harder on Windows.
2019-08-18 junyer Upgrade Bazel before trying to build with it.
2019-08-18 junyer Switch to Starlark for C++ rules.
2019-08-15 junyer Configure Kokoro to run CMake builds on Ubuntu.
2019-08-15 junyer Configure CMake to require version 3.5.1, which is what Xenial has.
2019-08-15 junyer Upgrade Travis CI from Trusty to Xenial.

Roll third_party/spirv-tools/ f701237..bc62722 (8 commits)

KhronosGroup/SPIRV-Tools@f701237...bc62722

$ git log f701237..bc62722 --date=short --no-merges --format='%ad %ae %s'
2019-08-18 stevenperron Handle overflow in wrap-opkill (KhronosGroup#2801)
2019-08-16 stevenperron More handle overflow in sroa (KhronosGroup#2800)
2019-08-16 greg Instrument: Add support for Buffer Device Address extension (KhronosGroup#2792)
2019-08-15 toomas.remmelg Update remquo validation to match the OpenCL Extended Instruction Set Specification (KhronosGroup#2791)
2019-08-15 jaebaek Use ascii code based characters (KhronosGroup#2796)
2019-08-14 jaebaek Change the way to include header (KhronosGroup#2795)
2019-08-14 alanbaker Fix validation of constant matrices (KhronosGroup#2794)
2019-08-14 stevenperron Replace OpKill With function call. (KhronosGroup#2790)

Created with:
  roll-dep third_party/effcee third_party/glslang third_party/googletest third_party/re2 third_party/spirv-cross third_party/spirv-headers third_party/spirv-tools
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spirv-opt: Add transform to wrap OpKill into its own trivial function

2 participants