This is an archive of the discontinued LLVM Phabricator instance.

[Codegen] support of 'nof' flag lowering on X86 target
Needs ReviewPublic

Authored by magabari on Jan 21 2018, 4:15 AM.

Details

Summary

This patch contains a support of lowering 'nof' flag in https://reviews.llvm.org/D41944
Currently this support is for X86 target and other target may provide their own implementation.

Diff Detail

Event Timeline

magabari created this revision.Jan 21 2018, 4:15 AM
craig.topper added inline comments.Jan 22 2018, 7:23 PM
CodeGen/SelectionDAG/LegalizeVectorOps.cpp
755

What guarantees HalfVT is a legal type for the target?

CodeGen/X86/combine-sdiv.ll
265

FIXME and TODO are the common prefixes for comments like this. No one is ever going to look for "FIX IT"

Target/X86/X86ISelLowering.cpp
38113

hasAVX2 implies hasAVX512. But what's special about AVX2 here?

magabari marked 2 inline comments as done.Jan 29 2018, 7:20 AM

fixed craig notes

CodeGen/SelectionDAG/LegalizeVectorOps.cpp
755

In fact I did this only because as you may notice that i use wider FP types (i32 goes to f64), I assume that when we get to this function the original integer vector type is legal, so if I enlarge the FP type it may be not legal anymore. because of that i did the split.
but in any case i think that Type legalizer should take care of that if HalfVT still not legal.

Target/X86/X86ISelLowering.cpp
38113

fixed.
We have measured this optimization in AVX2 and AVX512 and it gives good speedups but in SSE that may not be the optimized way to do that so we return false.

craig.topper added inline comments.Jan 29 2018, 10:49 AM
CodeGen/SelectionDAG/LegalizeVectorOps.cpp
755

There is another type legalizer run after vector ops legalization, but it shouldn't be legalizing vector types. It's intended to legalize scalar types created by unrolling.

sanjoy resigned from this revision.Jan 29 2022, 5:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 29 2022, 5:32 PM
Herald added a subscriber: pengfei. · View Herald Transcript