Do not call TryToShrinkGlobalToBoolean for address spaces
that don't allow initializers. It inserts an initializer value
while shrinking to bool. Used the target hook introduced with
D109337 to skip this call for the restricted address spaces.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
2–3 | Needs REQUIRES: amdgpu-registered-target, or to move to an AMDGPU test directory |
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
15 | Why is the check and amdgcn line the same, that I don't understand. Should it not trigger for "check"? |
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
15 | The host line won't fail the address space check, and it serves as a sanity check that the transform would be performed otherwise |
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
2 | Probably should use an explicit target for the reference line |
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
2 | I intended to capture the default behavior along with the output for AMDGPU. |
The patch looks reasonable, but I have a question about the test.
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
34–42 | I'm confused. I see no differences between AMDGCN and CHECK anywhere in the test file. AFAICT, the test would work if I were to use CHECK in the test with --mtriple=amdgcn-amd-amdhsa. If both CHECK and AMDGCN are identical, why do we need two different check patterns? Did I miss something? |
llvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll | ||
---|---|---|
34–42 | You did not: https://reviews.llvm.org/D109823#inline-1046556 |
Probably should use an explicit target for the reference line