aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86TargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r--lib/Target/X86/X86TargetMachine.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index 15c6c4e..4d4d7c0 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -135,10 +135,18 @@ bool X86TargetMachine::addPostRegAlloc(PassManagerBase &PM,
bool X86TargetMachine::addPreEmitPass(PassManagerBase &PM,
CodeGenOpt::Level OptLevel) {
bool ShouldPrint = false;
- if (OptLevel != CodeGenOpt::None &&
- (Subtarget.hasSSE2() || Subtarget.hasAVX())) {
- PM.add(createExecutionDependencyFixPass(&X86::VR128RegClass));
- ShouldPrint = true;
+ if (OptLevel != CodeGenOpt::None) {
+ if (Subtarget.hasXMMInt()) {
+ PM.add(createExecutionDependencyFixPass(&X86::VR128RegClass));
+ ShouldPrint = true;
+ }
+ if (Subtarget.hasAVX2()) {
+ // FIXME this should be turned on for just AVX, but the pass doesn't check
+ // that instructions are valid before replacing them and there are AVX2
+ // integer instructions in the table.
+ PM.add(createExecutionDependencyFixPass(&X86::VR256RegClass));
+ ShouldPrint = true;
+ }
}
if (Subtarget.hasAVX() && UseVZeroUpper) {