Skip to content
Snippets Groups Projects
Commit 5977b746 authored by Richard Biener's avatar Richard Biener Committed by Richard Biener
Browse files

tree-optimization/117000 - elide .REDUC_IOR with compare against zero

The following adds a pattern to elide a .REDUC_IOR operation when
the result is compared against zero with a cbranch.  I've resorted
to using can_compare_p since that's what RTL expansion eventually
checks - while GIMPLE allowed whole vector equality compares for long
I'll notice vector lowering won't lower unsupported ones and RTL
expansion doesn't seem to try using [u]cmp<vector-mode> optabs
(and neither x86 nor aarch64 implements those).  There's cstore
but no target implements that for vector modes either.

	PR tree-optimization/117000
	* match.pd (.REDUC_IOR !=/== 0): New pattern.
	* gimple-match-head.cc: Include memmodel.h and optabs.h.
	* generic-match-head.cc: Likewise.

	* gcc.target/i386/pr117000.c: New testcase.
parent fd883919
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment