[llvm] [SimplifyCFG] Find an arrayless index for the covered lookup table (PR #73269)

Quentin Dian via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 28 14:51:02 PST 2023


DianQK wrote:

> @DianQK Could you please fix the compilation error first?
> 
> ```
> FAILED: lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o 
> ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-build/lib/Transforms/Utils -I/home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/lib/Transforms/Utils -I/home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-build/include -I/home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -w -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fPIC  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o -MF lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o.d -o lib/Transforms/Utils/CMakeFiles/LLVMTransformUtils.dir/SimplifyCFG.cpp.o -c /home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
> /home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp: In function ‘bool SwitchToLookupTable(llvm::SwitchInst*, llvm::IRBuilder<>&, llvm::DomTreeUpdater*, const llvm::DataLayout&, const llvm::TargetTransformInfo&)’:
> /home/dtcxzyw/llvm-opt/actions-runner/_work/llvm-opt-benchmark/llvm-opt-benchmark/llvm/llvm-project/llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6766:27: error: invalid conversion from ‘llvm::Constant*’ to ‘llvm::ConstantInt*’ [-fpermissive]
>  6766 |           ConstantInt::get(MaxCaseVal->getType(), Offset);
>       |           ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       |                           |
>       |                           llvm::Constant*
> ```

No problem. Updated. But please note this PR I am not ready to review.

@khei4 Is there any reason you marked it as ready for review? :)

https://github.com/llvm/llvm-project/pull/73269


More information about the llvm-commits mailing list