Skip to content

[SLP]Do extra analysis int minbitwidth if some checks return false. #84363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

alexey-bataev
Copy link
Member

The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Created using spr 1.3.5
@llvmbot
Copy link
Member

llvmbot commented Mar 7, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Alexey Bataev (alexey-bataev)

Changes

The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.


Full diff: https://github.com/llvm/llvm-project/pull/84363.diff

2 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+3-3)
  • (modified) llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll (+11-9)
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 1889bc09e85028..c6502c9f77f001 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -13942,7 +13942,7 @@ bool BoUpSLP::collectValuesToDemote(
         !collectValuesToDemote(I->getOperand(1), IsProfitableToDemoteRoot,
                                BitWidth, ToDemote, DemotedConsts, Visited,
                                Level2, IsProfitableToDemote))
-      return false;
+      return IsProfitableToDemote && IsPotentiallyTruncated(I, BitWidth);
     MaxDepthLevel = std::max(Level1, Level2);
     break;
   }
@@ -13958,7 +13958,7 @@ bool BoUpSLP::collectValuesToDemote(
         !collectValuesToDemote(SI->getFalseValue(), IsProfitableToDemoteRoot,
                                BitWidth, ToDemote, DemotedConsts, Visited,
                                Level2, IsProfitableToDemote))
-      return false;
+      return IsProfitableToDemote && IsPotentiallyTruncated(I, BitWidth);
     MaxDepthLevel = std::max(Level1, Level2);
     break;
   }
@@ -13971,7 +13971,7 @@ bool BoUpSLP::collectValuesToDemote(
       if (!collectValuesToDemote(IncValue, IsProfitableToDemoteRoot, BitWidth,
                                  ToDemote, DemotedConsts, Visited,
                                  MaxDepthLevel, IsProfitableToDemote))
-        return false;
+        return IsProfitableToDemote && IsPotentiallyTruncated(I, BitWidth);
     break;
   }
 
diff --git a/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll b/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll
index 1986b51ec94828..02d1f9f60d0ca1 100644
--- a/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll
+++ b/llvm/test/Transforms/SLPVectorizer/AArch64/horizontal.ll
@@ -228,7 +228,7 @@ for.end:                                          ; preds = %for.end.loopexit, %
 ; YAML-NEXT: Function:        test_unrolled_select
 ; YAML-NEXT: Args:
 ; YAML-NEXT:   - String:          'Vectorized horizontal reduction with cost '
-; YAML-NEXT:   - Cost:            '-36'
+; YAML-NEXT:   - Cost:            '-40'
 ; YAML-NEXT:   - String:          ' and with tree size '
 ; YAML-NEXT:   - TreeSize:        '10'
 
@@ -246,15 +246,17 @@ define i32 @test_unrolled_select(ptr noalias nocapture readonly %blk1, ptr noali
 ; CHECK-NEXT:    [[P2_045:%.*]] = phi ptr [ [[BLK2:%.*]], [[FOR_BODY_LR_PH]] ], [ [[ADD_PTR88:%.*]], [[IF_END_86]] ]
 ; CHECK-NEXT:    [[P1_044:%.*]] = phi ptr [ [[BLK1:%.*]], [[FOR_BODY_LR_PH]] ], [ [[ADD_PTR:%.*]], [[IF_END_86]] ]
 ; CHECK-NEXT:    [[TMP0:%.*]] = load <8 x i8>, ptr [[P1_044]], align 1
-; CHECK-NEXT:    [[TMP1:%.*]] = zext <8 x i8> [[TMP0]] to <8 x i32>
+; CHECK-NEXT:    [[TMP1:%.*]] = zext <8 x i8> [[TMP0]] to <8 x i16>
 ; CHECK-NEXT:    [[TMP2:%.*]] = load <8 x i8>, ptr [[P2_045]], align 1
-; CHECK-NEXT:    [[TMP3:%.*]] = zext <8 x i8> [[TMP2]] to <8 x i32>
-; CHECK-NEXT:    [[TMP4:%.*]] = sub nsw <8 x i32> [[TMP1]], [[TMP3]]
-; CHECK-NEXT:    [[TMP5:%.*]] = icmp slt <8 x i32> [[TMP4]], zeroinitializer
-; CHECK-NEXT:    [[TMP6:%.*]] = sub nsw <8 x i32> zeroinitializer, [[TMP4]]
-; CHECK-NEXT:    [[TMP7:%.*]] = select <8 x i1> [[TMP5]], <8 x i32> [[TMP6]], <8 x i32> [[TMP4]]
-; CHECK-NEXT:    [[TMP8:%.*]] = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> [[TMP7]])
-; CHECK-NEXT:    [[OP_RDX]] = add i32 [[TMP8]], [[S_047]]
+; CHECK-NEXT:    [[TMP3:%.*]] = zext <8 x i8> [[TMP2]] to <8 x i16>
+; CHECK-NEXT:    [[TMP4:%.*]] = sub <8 x i16> [[TMP1]], [[TMP3]]
+; CHECK-NEXT:    [[TMP5:%.*]] = trunc <8 x i16> [[TMP4]] to <8 x i1>
+; CHECK-NEXT:    [[TMP6:%.*]] = icmp slt <8 x i1> [[TMP5]], zeroinitializer
+; CHECK-NEXT:    [[TMP7:%.*]] = sub <8 x i16> zeroinitializer, [[TMP4]]
+; CHECK-NEXT:    [[TMP8:%.*]] = select <8 x i1> [[TMP6]], <8 x i16> [[TMP7]], <8 x i16> [[TMP4]]
+; CHECK-NEXT:    [[TMP9:%.*]] = zext <8 x i16> [[TMP8]] to <8 x i32>
+; CHECK-NEXT:    [[TMP10:%.*]] = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> [[TMP9]])
+; CHECK-NEXT:    [[OP_RDX]] = add i32 [[TMP10]], [[S_047]]
 ; CHECK-NEXT:    [[CMP83:%.*]] = icmp slt i32 [[OP_RDX]], [[LIM:%.*]]
 ; CHECK-NEXT:    br i1 [[CMP83]], label [[IF_END_86]], label [[FOR_END_LOOPEXIT:%.*]]
 ; CHECK:       if.end.86:

@alexey-bataev alexey-bataev requested a review from RKSimon March 7, 2024 19:14
Created using spr 1.3.5
Created using spr 1.3.5
Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Created using spr 1.3.5
Created using spr 1.3.5
@alexey-bataev alexey-bataev merged commit ea429e1 into main Mar 14, 2024
@alexey-bataev alexey-bataev deleted the users/alexey-bataev/spr/slpdo-extra-analysis-int-minbitwidth-if-some-checks-return-false branch March 14, 2024 20:16
alexey-bataev added a commit that referenced this pull request Mar 14, 2024
The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: #84363
@glandium
Copy link
Contributor

This caused a crash building libjpeg's jdsample.c. Here's a reduced testcase:

typedef char *JSAMPROW;
int h2v2_fancy_upsample_compptr_0;
void h2v2_fancy_upsample() {
  JSAMPROW inptr0, inptr1, outptr;
  int thiscolsum, lastcolsum, nextcolsum, colctr;
  for (;;) {
    thiscolsum = *inptr0++ * 3 + *inptr1++;
    nextcolsum = *inptr0++ * 3 + *inptr1++;
    lastcolsum = thiscolsum;
    colctr = h2v2_fancy_upsample_compptr_0;
    for (; colctr; colctr--) {
      nextcolsum = *inptr1++;
      *outptr++ = thiscolsum;
      lastcolsum = thiscolsum = nextcolsum;
    }
    *outptr = nextcolsum * lastcolsum;
  }
}

Compile with:

clang-19 "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-obj" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "jdsample.c" "-mrelocation-model" "pic" "-pic-level" "2" "-fhalf-no-semantic-interposition" "-mframe-pointer=all" "-relaxed-aliasing" "-ffp-contract=off" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debug-info-kind=constructor" "-dwarf-version=4" "-debugger-tuning=gdb" "-sys-header-deps" "-O2" "-std=gnu99" "-ferror-limit" "19" "-pthread" "-stack-protector" "2" "-fstack-clash-protection" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-faddrsig" "-x" "c" test.c

(I didn't try to reduce the flags more than removing preprocessing and warning flags)

A debug build shows this:

clang-19: /tmp/llvm/llvm/include/llvm/ADT/DenseMap.h:1270: pointer llvm::DenseMapIterator<const llvm::slpvectorizer::BoUpSLP::TreeEntry *, std::pair<unsigned long, bool>>::operator->() const [KeyT = const llvm::slpvectorizer::BoUpSLP::TreeEntry *, ValueT = std::pair<unsigned long, bool>, KeyInfoT = llvm::DenseMapInfo<const llvm::slpvectorizer::BoUpSLP::TreeEntry *>, Bucket = llvm::detail::DenseMapPair<const llvm::slpvectorizer::BoUpSLP::TreeEntry *, std::pair<unsigned long, bool>>, IsConst = false]: Assertion `Ptr != End && "dereferencing end() iterator"' failed.

alexey-bataev added a commit that referenced this pull request Mar 19, 2024
The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: #84363
@alexey-bataev
Copy link
Member Author

Committed in da118c9

@mstorsjo
Copy link
Member

I found two new cases that trigger failed asserts, based on the new relanded commit, in openh264 and libschroedinger. Those cases are:

typedef int a;
short *b;
short c;
void d() {
  a e, f;
  e = 0;
  for (; e < 16; e += 4) {
    b[e] = (f ^ (f ^ b[e] - f) * c >> 16) - f;
    f = b[e + 1] >> 1;
    b[e + 1] = f ^ ((f ^ b[e + 1] - f) * c >> 16) - f;
    b[e + 2] = f ^ ((f ^ b[e + 2] - f) * c >> 16) - f;
    b[e + 3] = f ^ ((f ^ b[e + 3] - f) * c >> 16) - f;
  }
}
typedef struct {
  short a
} b;
int c, d;
b *e;
b f, g;
short h, i, j;
void k() {
  short l;
  d = 0;
  for (; d < 8; d++) {
    f = e[d];
    l = f.a < -1 ? -1 : f.a > 1 ? 1 : f.a;
    h = f.a < 0 ? 0 : f.a;
    i = h * c;
    j = i >> 2;
    g.a = j * l;
    e[d] = g;
  }
}

Both can be triggered with the following command - but they appear to trigger failed asserts on a couple different source lines:

$ clang -target x86_64-linux-gnu -c repro.c -O2
clang: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:12545: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*, bool): Assertion `(getOperandEntry(E, 0)->State == TreeEntry::NeedToGather || getOperandEntry(E, 1)->State == TreeEntry::NeedToGather || MinBWs.contains(getOperandEntry(E, 0)) || MinBWs.contains(getOperandEntry(E, 1))) && "Expected item in MinBWs."' failed.
$ clang -target x86_64-linux-gnu -c repro.c -O2
clang: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:12299: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*, bool): Assertion `(getOperandEntry(E, 0)->State == TreeEntry::NeedToGather || getOperandEntry(E, 1)->State == TreeEntry::NeedToGather || MinBWs.contains(getOperandEntry(E, 0)) || MinBWs.contains(getOperandEntry(E, 1))) && "Expected item in MinBWs."' failed.

@alexey-bataev
Copy link
Member Author

Thanks, reverting it for the proper fix.

alexey-bataev added a commit that referenced this pull request Mar 20, 2024
…false."

This reverts commit da118c9 to fix
crashes reported in #84363.
alexey-bataev added a commit that referenced this pull request Mar 20, 2024
The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: #84363
@alexey-bataev
Copy link
Member Author

I found two new cases that trigger failed asserts, based on the new relanded commit, in openh264 and libschroedinger. Those cases are:

typedef int a;
short *b;
short c;
void d() {
  a e, f;
  e = 0;
  for (; e < 16; e += 4) {
    b[e] = (f ^ (f ^ b[e] - f) * c >> 16) - f;
    f = b[e + 1] >> 1;
    b[e + 1] = f ^ ((f ^ b[e + 1] - f) * c >> 16) - f;
    b[e + 2] = f ^ ((f ^ b[e + 2] - f) * c >> 16) - f;
    b[e + 3] = f ^ ((f ^ b[e + 3] - f) * c >> 16) - f;
  }
}
typedef struct {
  short a
} b;
int c, d;
b *e;
b f, g;
short h, i, j;
void k() {
  short l;
  d = 0;
  for (; d < 8; d++) {
    f = e[d];
    l = f.a < -1 ? -1 : f.a > 1 ? 1 : f.a;
    h = f.a < 0 ? 0 : f.a;
    i = h * c;
    j = i >> 2;
    g.a = j * l;
    e[d] = g;
  }
}

Both can be triggered with the following command - but they appear to trigger failed asserts on a couple different source lines:

$ clang -target x86_64-linux-gnu -c repro.c -O2
clang: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:12545: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*, bool): Assertion `(getOperandEntry(E, 0)->State == TreeEntry::NeedToGather || getOperandEntry(E, 1)->State == TreeEntry::NeedToGather || MinBWs.contains(getOperandEntry(E, 0)) || MinBWs.contains(getOperandEntry(E, 1))) && "Expected item in MinBWs."' failed.
$ clang -target x86_64-linux-gnu -c repro.c -O2
clang: ../lib/Transforms/Vectorize/SLPVectorizer.cpp:12299: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::TreeEntry*, bool): Assertion `(getOperandEntry(E, 0)->State == TreeEntry::NeedToGather || getOperandEntry(E, 1)->State == TreeEntry::NeedToGather || MinBWs.contains(getOperandEntry(E, 0)) || MinBWs.contains(getOperandEntry(E, 1))) && "Expected item in MinBWs."' failed.

Fixed in 81d9ed6

@mstorsjo
Copy link
Member

Fixed in 81d9ed6

Thanks - from a quick rerun it seems like all these cases are fixed now, and large parts of my builds pass (knowing conclusively takes much longer though).

@mikaelholmen
Copy link
Collaborator

Hi @alexey-bataev
The following crashes with this:

opt --passes slp-vectorizer bbi-93626.ll -o /dev/null

It fails like:

opt: ../include/llvm/ADT/APInt.h:1347: void llvm::APInt::setBits(unsigned int, unsigned int): Assertion `loBit <= BitWidth && "loBit out of range"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: ../../main-github/llvm/build-all/bin/opt --passes slp-vectorizer bbi-93626.ll -o /dev/null
 #0 0x000055b3c282db37 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (../../main-github/llvm/build-all/bin/opt+0x3e18b37)
 #1 0x000055b3c282b60e llvm::sys::RunSignalHandlers() (../../main-github/llvm/build-all/bin/opt+0x3e1660e)
 #2 0x000055b3c282e4ff SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f48507b4630 __restore_rt sigaction.c:0:0
 #4 0x00007f484defb387 raise (/lib64/libc.so.6+0x36387)
 #5 0x00007f484defca78 abort (/lib64/libc.so.6+0x37a78)
 #6 0x00007f484def41a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007f484def4252 (/lib64/libc.so.6+0x2f252)
 #8 0x000055b3c284ed58 llvm::APInt::setBits(unsigned int, unsigned int) APInt.cpp:0:0
 #9 0x000055b3c40731fd llvm::slpvectorizer::BoUpSLP::collectValuesToDemote(llvm::Value*, bool, unsigned int&, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DenseMap<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>, llvm::DenseMapInfo<llvm::Instruction*, void>, llvm::detail::DenseMapPair<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>>>&, llvm::DenseSet<llvm::Value*, llvm::DenseMapInfo<llvm::Value*, void>>&, unsigned int&, bool&, bool) const::$_141::operator()(llvm::Value*, unsigned int&) const SLPVectorizer.cpp:0:0
#10 0x000055b3c4072f56 llvm::slpvectorizer::BoUpSLP::collectValuesToDemote(llvm::Value*, bool, unsigned int&, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DenseMap<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>, llvm::DenseMapInfo<llvm::Instruction*, void>, llvm::detail::DenseMapPair<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>>>&, llvm::DenseSet<llvm::Value*, llvm::DenseMapInfo<llvm::Value*, void>>&, unsigned int&, bool&, bool) const (../../main-github/llvm/build-all/bin/opt+0x565df56)
#11 0x000055b3c40733a5 llvm::slpvectorizer::BoUpSLP::collectValuesToDemote(llvm::Value*, bool, unsigned int&, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DenseMap<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>, llvm::DenseMapInfo<llvm::Instruction*, void>, llvm::detail::DenseMapPair<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>>>&, llvm::DenseSet<llvm::Value*, llvm::DenseMapInfo<llvm::Value*, void>>&, unsigned int&, bool&, bool) const::$_144::operator()(llvm::ArrayRef<llvm::Value*>, bool&) const SLPVectorizer.cpp:0:0
#12 0x000055b3c4072ad1 llvm::slpvectorizer::BoUpSLP::collectValuesToDemote(llvm::Value*, bool, unsigned int&, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DenseMap<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>, llvm::DenseMapInfo<llvm::Instruction*, void>, llvm::detail::DenseMapPair<llvm::Instruction*, llvm::SmallVector<unsigned int, 12u>>>&, llvm::DenseSet<llvm::Value*, llvm::DenseMapInfo<llvm::Value*, void>>&, unsigned int&, bool&, bool) const (../../main-github/llvm/build-all/bin/opt+0x565dad1)
#13 0x000055b3c407442c llvm::slpvectorizer::BoUpSLP::computeMinimumValueSizes() (../../main-github/llvm/build-all/bin/opt+0x565f42c)
#14 0x000055b3c407d0eb llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (../../main-github/llvm/build-all/bin/opt+0x56680eb)
#15 0x000055b3c407e017 llvm::SLPVectorizerPass::tryToVectorize(llvm::Instruction*, llvm::slpvectorizer::BoUpSLP&) (../../main-github/llvm/build-all/bin/opt+0x5669017)
#16 0x000055b3c40ad89d bool llvm::SLPVectorizerPass::vectorizeCmpInsts<std::reverse_iterator<llvm::CmpInst* const*>>(llvm::iterator_range<std::reverse_iterator<llvm::CmpInst* const*>>, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (../../main-github/llvm/build-all/bin/opt+0x569889d)
#17 0x000055b3c4082e07 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&)::$_168::operator()(bool) const SLPVectorizer.cpp:0:0
#18 0x000055b3c4078a64 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (../../main-github/llvm/build-all/bin/opt+0x5663a64)
#19 0x000055b3c4076160 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (../../main-github/llvm/build-all/bin/opt+0x5661160)
#20 0x000055b3c40757c1 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x56607c1)
#21 0x000055b3c3b3eb7d llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
#22 0x000055b3c2a118f4 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (../../main-github/llvm/build-all/bin/opt+0x3ffc8f4)
#23 0x000055b3c3b372ed llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) PassBuilderPipelines.cpp:0:0
#24 0x000055b3c2a169be llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x40019be)
#25 0x000055b3c3b30bad llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) PassBuilderPipelines.cpp:0:0
#26 0x000055b3c2a10466 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (../../main-github/llvm/build-all/bin/opt+0x3ffb466)
#27 0x000055b3c3add3cb llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (../../main-github/llvm/build-all/bin/opt+0x50c83cb)
#28 0x000055b3c27f60ad optMain (../../main-github/llvm/build-all/bin/opt+0x3de10ad)
#29 0x00007f484dee7555 __libc_start_main (/lib64/libc.so.6+0x22555)
#30 0x000055b3c27efc29 _start (../../main-github/llvm/build-all/bin/opt+0x3ddac29)
Abort (core dumped)

bbi-93626.ll.gz

@alexey-bataev
Copy link
Member Author

Thanks, will fix it ASAP.

@alexey-bataev
Copy link
Member Author

bbi-93626.ll.gz

Fixed in 34f0a8a

@mikaelholmen
Copy link
Collaborator

bbi-93626.ll.gz

Fixed in 34f0a8a

Yep, thanks!

chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: llvm#84363
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
…false."

This reverts commit da118c9 to fix
crashes reported in llvm#84363.
chencha3 pushed a commit to chencha3/llvm-project that referenced this pull request Mar 23, 2024
The instruction itself can be considered good for minbitwidth casting,
even if one of the operand checks returns false.

Reviewers: RKSimon

Reviewed By: RKSimon

Pull Request: llvm#84363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants