[PATCH] D36234: [InstCombine] Support sext in foldLogicCastConstant

Evgeny Astigeevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 09:13:09 PDT 2017


eastig reopened this revision.
eastig added a comment.
This revision is now accepted and ready to land.

Hi,

This patch causes an assertion failure on the attached test.ll. Could you please have a look at it?

  $ ../bin/opt test.ll -instcombine -S
  opt: ../lib/IR/Constants.cpp:1551: static llvm::Constant* llvm::ConstantExpr::getTrunc(llvm::Constant*, llvm::Type*, bool): Assertion `C->getType()->getScalarSizeInBits() > Ty->getScalarSizeInBits()&& "SrcTy must be larger than DestTy for Trunc!"' failed.
  #0 0x000000000360ab38 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/evgast01/local/repos/llvm12/build.d/../lib/Support/Unix/Signals.inc:398:0
  #1 0x000000000360abc9 PrintStackTraceSignalHandler(void*) /home/evgast01/local/repos/llvm12/build.d/../lib/Support/Unix/Signals.inc:462:0
  #2 0x0000000003608fde llvm::sys::RunSignalHandlers() /home/evgast01/local/repos/llvm12/build.d/../lib/Support/Signals.cpp:49:0
  #3 0x000000000360a4bb SignalHandler(int) /home/evgast01/local/repos/llvm12/build.d/../lib/Support/Unix/Signals.inc:252:0
  #4 0x00007f37c51e1330 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
  #5 0x00007f37c3fc9c37 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x36c37)
  #6 0x00007f37c3fcd028 abort (/lib/x86_64-linux-gnu/libc.so.6+0x3a028)
  #7 0x00007f37c3fc2bf6 (/lib/x86_64-linux-gnu/libc.so.6+0x2fbf6)
  #8 0x00007f37c3fc2ca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
  #9 0x0000000002e19bc5 llvm::ConstantExpr::getTrunc(llvm::Constant*, llvm::Type*, bool) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/Constants.cpp:1553:0
  #10 0x0000000003103c73 getSelectCondition(llvm::Value*, llvm::Value*, llvm::IRBuilder<llvm::TargetFolder, llvm::IRBuilderCallbackInserter>&) /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1498:0
  #11 0x0000000003103f10 matchSelectFromAndOr(llvm::Value*, llvm::Value*, llvm::Value*, llvm::Value*, llvm::IRBuilder<llvm::TargetFolder, llvm::IRBuilderCallbackInserter>&) /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1522:0
  #12 0x00000000031071fe llvm::InstCombiner::visitOr(llvm::BinaryOperator&) /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1989:0
  #13 0x00000000030e9dbb llvm::InstVisitor<llvm::InstCombiner, llvm::Instruction*>::visit(llvm::Instruction&) /home/evgast01/local/repos/llvm12/build.d/../include/llvm/IR/Instruction.def:146:0
  #14 0x00000000030e48a5 llvm::InstCombiner::run() /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstructionCombining.cpp:2971:0
  #15 0x00000000030e5a86 combineInstructionsOverFunction(llvm::Function&, llvm::InstCombineWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, bool, llvm::LoopInfo*) /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstructionCombining.cpp:3203:0
  #16 0x00000000030e5e0f llvm::InstructionCombiningPass::runOnFunction(llvm::Function&) /home/evgast01/local/repos/llvm12/build.d/../lib/Transforms/InstCombine/InstructionCombining.cpp:3262:0
  #17 0x0000000002f14f46 llvm::FPPassManager::runOnFunction(llvm::Function&) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/LegacyPassManager.cpp:1514:0
  #18 0x0000000002f150d9 llvm::FPPassManager::runOnModule(llvm::Module&) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/LegacyPassManager.cpp:1535:0
  #19 0x0000000002f15474 (anonymous namespace)::MPPassManager::runOnModule(llvm::Module&) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/LegacyPassManager.cpp:1591:0
  #20 0x0000000002f15bcb llvm::legacy::PassManagerImpl::run(llvm::Module&) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/LegacyPassManager.cpp:1694:0
  #21 0x0000000002f15e0b llvm::legacy::PassManager::run(llvm::Module&) /home/evgast01/local/repos/llvm12/build.d/../lib/IR/LegacyPassManager.cpp:1726:0
  #22 0x00000000015ee1ae main /home/evgast01/local/repos/llvm12/build.d/../tools/opt/opt.cpp:759:0
  #23 0x00007f37c3fb4f45 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21f45)
  #24 0x00000000015c7f89 _start (../bin/opt+0x15c7f89)
  Stack dump:
  0.      Program arguments: ../bin/opt test.ll -instcombine -S 
  1.      Running pass 'Function Pass Manager' on module 'test.ll'.
  2.      Running pass 'Combine redundant instructions' on function '@dotests_115'
  Aborted

F5222823: test.ll <https://reviews.llvm.org/F5222823>


Repository:
  rL LLVM

https://reviews.llvm.org/D36234





More information about the llvm-commits mailing list