[PATCH] D147972: ValueTracking: Delete body of isKnownNeverNaN

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 05:15:09 PDT 2023


foad added a comment.

This causes:

  ; RUN: llc -march=amdgcn -mcpu=gfx1030 < %s
  
  define void @f() {
  bb:
    call void @g()
    ret void
  }
  
  define void @g() alwaysinline {
  bb:
    %i = call <4 x i32> @llvm.amdgcn.s.buffer.load.v4i32(<4 x i32> zeroinitializer, i32 0, i32 0)
    %i1 = bitcast <4 x i32> %i to <4 x float>
    %i2 = extractelement <4 x float> %i1, i64 0
    %i3 = fmul float %i2, 0.000000e+00
    %i4 = call float @llvm.maxnum.f32(float %i3, float 0.000000e+00)
    %i5 = call float @llvm.maxnum.f32(float %i4, float %i2)
    %i6 = fcmp olt float %i5, 0.000000e+00
    ret void
  }
  
  declare float @llvm.maxnum.f32(float, float)
  declare <4 x i32> @llvm.amdgcn.s.buffer.load.v4i32(<4 x i32>, i32, i32 immarg)

  PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
  Stack dump:
  0.	Program arguments: /home/jayfoad2/llvm-release/bin/llc -march=amdgcn -mcpu=gfx1030
  1.	Running pass 'Inliner for always_inline functions' on module '<stdin>'.
   #0 0x000000000338afc7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/jayfoad2/llvm-release/bin/llc+0x338afc7)
   #1 0x0000000003388e7e llvm::sys::RunSignalHandlers() (/home/jayfoad2/llvm-release/bin/llc+0x3388e7e)
   #2 0x000000000338b66a SignalHandler(int) Signals.cpp:0:0
   #3 0x00007f1527842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
   #4 0x0000000002b50cb4 llvm::AttributeList::getAttributeAtIndex(unsigned int, llvm::StringRef) const (/home/jayfoad2/llvm-release/bin/llc+0x2b50cb4)
   #5 0x0000000002c2e95d llvm::Function::getDenormalMode(llvm::fltSemantics const&) const (/home/jayfoad2/llvm-release/bin/llc+0x2c2e95d)
   #6 0x00000000024ebbda computeKnownFPClass(llvm::Value const*, llvm::APInt const&, llvm::FPClassTest, llvm::KnownFPClass&, unsigned int, (anonymous namespace)::Query const&, llvm::TargetLibraryInfo const*) ValueTracking.cpp:0:0
   #7 0x00000000024ebf9e computeKnownFPClass(llvm::Value const*, llvm::KnownFPClass&, llvm::FPClassTest, unsigned int, (anonymous namespace)::Query const&, llvm::TargetLibraryInfo const*) ValueTracking.cpp:0:0
   #8 0x000000000250e8a8 cannotBeOrderedLessThanZeroImpl(llvm::Value const*, llvm::DataLayout const&, llvm::TargetLibraryInfo const*, bool, unsigned int)::$_25::operator()(llvm::Value*) const ValueTracking.cpp:0:0
   #9 0x00000000024e94aa cannotBeOrderedLessThanZeroImpl(llvm::Value const*, llvm::DataLayout const&, llvm::TargetLibraryInfo const*, bool, unsigned int) ValueTracking.cpp:0:0
  #10 0x0000000002389456 simplifyFCmpInst(unsigned int, llvm::Value*, llvm::Value*, llvm::FastMathFlags, llvm::SimplifyQuery const&, unsigned int) InstructionSimplify.cpp:0:0
  #11 0x0000000002390a43 simplifyInstructionWithOperands(llvm::Instruction*, llvm::ArrayRef<llvm::Value*>, llvm::SimplifyQuery const&, unsigned int) InstructionSimplify.cpp:0:0
  #12 0x0000000002390fec llvm::simplifyInstruction(llvm::Instruction*, llvm::SimplifyQuery const&) (/home/jayfoad2/llvm-release/bin/llc+0x2390fec)
  #13 0x00000000033cc8b8 (anonymous namespace)::PruningFunctionCloner::CloneBlock(llvm::BasicBlock const*, llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void>, false, true>, std::vector<llvm::BasicBlock const*, std::allocator<llvm::BasicBlock const*>>&) CloneFunction.cpp:0:0
  #14 0x00000000033c90a2 llvm::CloneAndPruneIntoFromInst(llvm::Function*, llvm::Function const*, llvm::Instruction const*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false>>>&, bool, llvm::SmallVectorImpl<llvm::ReturnInst*>&, char const*, llvm::ClonedCodeInfo*) (/home/jayfoad2/llvm-release/bin/llc+0x33c90a2)
  #15 0x00000000033cdd02 llvm::CloneAndPruneFunctionInto(llvm::Function*, llvm::Function const*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false>>>&, bool, llvm::SmallVectorImpl<llvm::ReturnInst*>&, char const*, llvm::ClonedCodeInfo*) (/home/jayfoad2/llvm-release/bin/llc+0x33cdd02)
  #16 0x00000000033f8528 llvm::InlineFunction(llvm::CallBase&, llvm::InlineFunctionInfo&, bool, llvm::AAResults*, bool, llvm::Function*) (/home/jayfoad2/llvm-release/bin/llc+0x33f8528)
  #17 0x000000000360c477 (anonymous namespace)::AlwaysInlineImpl(llvm::Module&, bool, llvm::ProfileSummaryInfo&, llvm::function_ref<llvm::AssumptionCache& (llvm::Function&)>, llvm::function_ref<llvm::AAResults& (llvm::Function&)>, llvm::function_ref<llvm::BlockFrequencyInfo& (llvm::Function&)>) AlwaysInliner.cpp:0:0
  #18 0x000000000360d3f1 (anonymous namespace)::AlwaysInlinerLegacyPass::runOnModule(llvm::Module&) AlwaysInliner.cpp:0:0
  #19 0x0000000002c8078c llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/jayfoad2/llvm-release/bin/llc+0x2c8078c)
  #20 0x0000000001ea64c9 main (/home/jayfoad2/llvm-release/bin/llc+0x1ea64c9)
  #21 0x00007f1527829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  #22 0x00007f1527829e40 call_init ./csu/../csu/libc-start.c:128:20
  #23 0x00007f1527829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
  #24 0x0000000001ea0f25 _start (/home/jayfoad2/llvm-release/bin/llc+0x1ea0f25)
  Segmentation fault (core dumped)

Can you fix or revert please?


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

https://reviews.llvm.org/D147972



More information about the llvm-commits mailing list