HomePhabricator

[OpenCL] Respect calling convention for builtin

Authored by ldrumm on Mar 10 2021, 10:14 AM.

Description

[OpenCL] Respect calling convention for builtin

__translate_sampler_initializer has a calling convention of
spir_func, but clang generated calls to it using the default CC.

Instruction Combining was lowering these mismatching calling conventions
to store i1* undef which itself was subsequently lowered to a trap
instruction by simplifyCFG resulting in runtime SIGILL

There are arguably two bugs here: but whether there's any wisdom in
converting an obviously invalid call into a runtime crash over aborting
with a sensible error message will require further discussion. So for
now it's enough to set the right calling convention on the runtime
helper.

Reviewed By: svenh, bader

Differential Revision: https://reviews.llvm.org/D98411

Details

Committed
ldrummMar 15 2021, 10:26 AM
Reviewer
bader
Differential Revision
D98411: [OpenCL] Respect calling convention for builtin
Parents
rGda408d98d7ce: [flang][docs] Fix the time for the new Flang driver call
Branches
Unknown
Tags
Unknown