Skip to content

Revert "[SPIR][InstCombine] Work around SPIR-V translator limitation … #4028

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 1 commit into from
Closed
Show file tree
Hide file tree
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
14 changes: 0 additions & 14 deletions llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,20 +919,6 @@ Instruction *InstCombinerImpl::visitTrunc(TruncInst &Trunc) {
if (Instruction *I = foldVecTruncToExtElt(Trunc, *this))
return I;

// FIXME: This is temporary work-around for a problem reported here:
// https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/645
//
// InstCombine canonical form for this pattern
// ```
// // Example (little endian):
// // trunc (extractelement <4 x i64> %X, 0) to i32
// // --->
// // 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;

// Whenever an element is extracted from a vector, and then truncated,
// canonicalize by converting it to a bitcast followed by an
// extractelement.
Expand Down
14 changes: 0 additions & 14 deletions llvm/test/Transforms/InstCombine/trunc-extractelement-spir.ll

This file was deleted.