论文标题
AZP:游戏应用程序中零值的自动专业化
AZP: Automatic Specialization for Zero Values in Gaming Applications
论文作者
论文摘要
最近的研究表明,在游戏应用程序的着色器程序中,动态零可以通过引导,代码为代码的转换有效地利用。此转换重复代码,假设某些关键程序操作数(称为版本化变量)为零,则专门为一条路径而进行了零,并且将另一个路径无关紧要。动态地,根据版本控制变量的值,专用快速路径或默认慢速路径将执行。先前的工作手动应用了此转换,并在游戏应用程序上显示出有希望的收益。在本文中,我们提出了AZP,这是一种自动编译器方法,用于执行上述代码转换变换。我们的框架自动确定哪些版本化变量或它们的组合是有利可图的,并确定代码区域重复和专业化(称为版本范围)。 AZP将操作数零值概率作为输入,然后使用经典技术(例如恒定折叠和消除代码消除)来确定最有利可图的版本控制变量及其版本控制范围。然后,该信息以直接的方式来影响最终变换。我们证明,目标着色器计划的平均速度为16.4%,在NVIDIA GEFORCE RTX 2080 GPU GPU上的现代游戏应用中,平均帧速率加速为3.5%。
Recent research has shown that dynamic zeros in shader programs of gaming applications can be effectively leveraged with a profile-guided, code-versioning transform. This transform duplicates code, specializes one path assuming certain key program operands, called versioning variables, are zero, and leaves the other path unspecialized. Dynamically, depending on the versioning variable's value, either the specialized fast path or the default slow path will execute. Prior work applied this transform manually and showed promising gains on gaming applications. In this paper, we present AZP, an automatic compiler approach to perform the above code-versioning transform. Our framework automatically determines which versioning variables or combinations of them are profitable, and determines the code region to duplicate and specialize (called the versioning scope). AZP takes operand zero value probabilities as input and it then uses classical techniques such as constant folding and dead-code elimination to determine the most profitable versioning variables and their versioning scopes. This information is then used to affect the final transform in a straightforward manner. We demonstrate that AZP is able to achieve an average speedup of 16.4% for targeted shader programs, amounting to an average frame-rate speedup of 3.5% across a collection of modern gaming applications on an NVIDIA GeForce RTX 2080 GPU GPU.