Skip to content

Undo #2143 to check if problem in issue #645 still actual #4026

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) {
if (Instruction *I = foldVecTruncToExtElt(Trunc, *this))
return I;

<<<<<<< HEAD
// FIXME: This is temporary work-around for a problem reported here:
// https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/645
//
Expand All @@ -912,9 +913,9 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) {
// // extractelement <8 x i32> (bitcast <4 x i64> %X to <8 x i32>), i32 0
// ```
// can't be lowered by SPIR-V translator to "standard" format.
if (StringRef(Trunc.getModule()->getTargetTriple()).startswith("spir"))
return nullptr;

=======
>>>>>>> parent of 2fb2468474af... [SPIR][InstCombine] Work around SPIR-V translator limitation (#2143)
// Whenever an element is extracted from a vector, and then truncated,
// canonicalize by converting it to a bitcast followed by an
// extractelement.
Expand Down