Page MenuHomePhabricator

[AMDGPU] Remove isLiteralConstant and isLiteralConstantLike
Needs ReviewPublic

Authored by foad on May 17 2022, 3:32 AM.

Details

Reviewers
arsenm
rampitec
Summary

isLiteralConstant and isLiteralConstantLike were similar to
!isInlineConstant with slight differences like handling isReg operands.

To avoid a profusion of similar functions with undocumented differences,
this patch folds isReg handling into isInlineConstant and removes all
the isLiteralConstant* variants.

Diff Detail

Unit TestsFailed

TimeTest
60,060 msx64 debian > AddressSanitizer-x86_64-linux.TestCases::scariness_score_test.cpp
Script: -- : 'RUN: at line 4'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -m64 -O0 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/asan/TestCases/scariness_score_test.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/asan/X86_64LinuxConfig/TestCases/Output/scariness_score_test.cpp.tmp
60,140 msx64 debian > LLVM.CodeGen/NVPTX::wmma.py
Script: -- : 'RUN: at line 5'; "/usr/bin/python3.9" /var/lib/buildkite-agent/builds/llvm-project/llvm/test/CodeGen/NVPTX/wmma.py --ptx=60 --gpu-arch=70 > /var/lib/buildkite-agent/builds/llvm-project/build/test/CodeGen/NVPTX/Output/wmma.py.tmp-ptx60-sm_70.ll
60,230 msx64 debian > LLVM.MC/Mips::mips-jump-pc-region.s
Script: -- : 'RUN: at line 1'; /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-mc -triple=mips -mcpu=mips32 -filetype=obj < /var/lib/buildkite-agent/builds/llvm-project/llvm/test/MC/Mips/mips-jump-pc-region.s | /var/lib/buildkite-agent/builds/llvm-project/build/bin/llvm-objdump -d - | /var/lib/buildkite-agent/builds/llvm-project/build/bin/FileCheck /var/lib/buildkite-agent/builds/llvm-project/llvm/test/MC/Mips/mips-jump-pc-region.s
60,020 msx64 debian > libFuzzer.libFuzzer::fuzzer-leak.test
Script: -- : 'RUN: at line 3'; /var/lib/buildkite-agent/builds/llvm-project/build/./bin/clang --driver-mode=g++ -O2 -gline-tables-only -fsanitize=address,fuzzer -I/var/lib/buildkite-agent/builds/llvm-project/compiler-rt/lib/fuzzer -m64 /var/lib/buildkite-agent/builds/llvm-project/compiler-rt/test/fuzzer/LeakTest.cpp -o /var/lib/buildkite-agent/builds/llvm-project/build/projects/compiler-rt/test/fuzzer/X86_64DefaultLinuxConfig/Output/fuzzer-leak.test.tmp-LeakTest

Event Timeline

foad created this revision.May 17 2022, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 3:32 AM
foad requested review of this revision.May 17 2022, 3:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 3:32 AM
arsenm added inline comments.May 17 2022, 6:27 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
3603–3604

This doesn't make any sense to me

foad added inline comments.May 17 2022, 6:38 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
3603–3604

Yeah, so this function needs a better name - something that means "is this operand guaranteed not to make the instruction 4 bytes bigger?". I suppose that is (the converse of) what the isLiteralConstantLike name was supposed to imply.

arsenm added inline comments.May 17 2022, 7:34 AM
llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
3603–3604

Most of the uses are checking register as is, so could this just assert on registers?