Skip to content
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

Instcombine failure introduced by r269426 #28130

Closed
jmolloy opened this issue May 16, 2016 · 3 comments
Closed

Instcombine failure introduced by r269426 #28130

jmolloy opened this issue May 16, 2016 · 3 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@jmolloy
Copy link

jmolloy commented May 16, 2016

Bugzilla Link 27756
Resolution FIXED
Resolved on May 17, 2016 17:45
Version trunk
OS All
CC @hfinkel,@rotateright

Extended Description

The following testcase causes an assertion failure when run with opt -instcombine. This is a regression introduced in r269426:

[InstCombine] canonicalize* LE/GE vector integer comparisons to LT/GT (#26701 , #27193 )

*We don't currently handle the edge case constants (min/max values), so it's not a complete
canonicalization.

To fully solve the motivating bugs, we need to enhance this to recognize a zero vector
too because that's a ConstantAggregateZero which is a ConstantData, not a ConstantVector
or a ConstantDataVector.

Differential Revision: http://reviews.llvm.org/D17859

; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "bugpoint-output-f90b06d.bc"
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
target triple = "aarch64--linux-gnu"

; Function Attrs: nounwind readnone
declare <16 x i8> @​llvm.aarch64.neon.srshl.v16i8(<16 x i8>, <16 x i8>) #​0

; Function Attrs: nounwind
define fastcc void @​dotests_268() unnamed_addr #​1 {
entry:
%vrshr_n = call <16 x i8> @​llvm.aarch64.neon.srshl.v16i8(<16 x i8> undef, <16 x i8> <i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6, i8 -6>)
%0 = add <16 x i8> zeroinitializer, %vrshr_n
%vset_lane = shufflevector <8 x i16> <i16 -20871, i16 -1, i16 32767, i16 -1, i16 32639, i16 -22537, i16 -1, i16 -4866>, <8 x i16> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 13, i32 7>
%1 = bitcast <8 x i16> %vset_lane to <16 x i8>
%shuffle336 = shufflevector <16 x i8> %1, <16 x i8> undef, <16 x i32> <i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15, i32 15>
%cmp.i = icmp sle <16 x i8> %0, %shuffle336
%sext.i = sext <16 x i1> %cmp.i to <16 x i8>
%and.i = and <16 x i8> %sext.i, <i8 113, i8 45, i8 0, i8 -128, i8 -1, i8 -1, i8 -1, i8 127, i8 55, i8 92, i8 -1, i8 -1, i8 -1, i8 -1, i8 0, i8 0>
ret void
}

attributes #​0 = { nounwind readnone }
attributes #​1 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="cortex-a57" "target-features"="+crc,+crypto,+neon" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.ident = !{#0}

!​0 = !{!"clang version 3.9.0 (trunk 269502) (llvm/trunk 269506)"}

@rotateright
Copy link
Contributor

Patch posted for review:
http://reviews.llvm.org/D20289

@rotateright
Copy link
Contributor

Should be fixed with:
http://reviews.llvm.org/rL269728

But that commit broke the law of patch minimalism by trying to fix a bug and attempt a refactoring in one shot, so caused numerous bot fails and bug 27792...I won't make that mistake again. :(

These commits have hopefully righted the remaining wrongs:
http://reviews.llvm.org/rL269797
http://reviews.llvm.org/rL269831

@nunoplopes
Copy link
Member

mentioned in issue llvm/llvm-bugzilla-archive#43730

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants