[PATCH] D109823: [GlobalOpt] Do not shrink global to bool for an unfavorable AS

Christudasan Devadasan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 15 09:01:16 PDT 2021


cdevadas added inline comments.


================
Comment at: llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll:1
+; RUN: opt -passes=globalopt < %s -S | FileCheck %s
+; RUN: opt -passes=globalopt --mtriple=amdgcn-amd-amdhsa < %s -S | FileCheck %s --check-prefix=AMDGCN
----------------
arsenm wrote:
> Probably should use an explicit target for the reference line
I intended to capture the default behavior along with the output for AMDGPU.
The default implementation of `canHaveNonUndefGlobalInitializerInAddressSpace` allows only AS(0) to have an initializer.
There is no target that currently allows initializer for AS(3) and any arbitrary target used here will transform the code similar to AMDGPU. 
I will use x86. The test in the future shouldn't break without one.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109823/new/

https://reviews.llvm.org/D109823



More information about the llvm-commits mailing list