Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -237,7 +237,7 @@ # List of targets with JIT support: set(LLVM_TARGETS_WITH_JIT X86 PowerPC AArch64 ARM Mips SystemZ) -set(LLVM_TARGETS_TO_BUILD "all" +set(LLVM_TARGETS_TO_BUILD "X86" CACHE STRING "Semicolon-separated list of targets to build, or \"all\".") set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "" @@ -419,7 +419,7 @@ endif() option(LLVM_BUILD_LLVM_DYLIB "Build libllvm dynamic library" ${LLVM_BUILD_LLVM_DYLIB_default}) -option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" OFF) +option(LLVM_OPTIMIZED_TABLEGEN "Force TableGen to be built with optimization" ON) if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS)) set(LLVM_USE_HOST_TOOLS ON) endif() Index: include/llvm/IR/IntrinsicsX86.td =================================================================== --- include/llvm/IR/IntrinsicsX86.td +++ include/llvm/IR/IntrinsicsX86.td @@ -4292,6 +4292,13 @@ } //===----------------------------------------------------------------------===// +// CLFLUSHOPT +let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". + def int_x86_clflushopt : GCCBuiltin<"__builtin_ia32_clflushopt">, + Intrinsic<[], [llvm_ptr_ty], []>; +} + +//===----------------------------------------------------------------------===// // Support protection key let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.". def int_x86_rdpkru : GCCBuiltin <"__builtin_ia32_rdpkru">, Index: lib/Target/X86/X86InstrInfo.td =================================================================== --- lib/Target/X86/X86InstrInfo.td +++ lib/Target/X86/X86InstrInfo.td @@ -2514,7 +2514,7 @@ // def CLFLUSHOPT : I<0xAE, MRM7m, (outs), (ins i8mem:$src), - "clflushopt\t$src", []>, PD; + "clflushopt\t$src", [(int_x86_clflushopt addr:$src)]>, PD; def CLWB : I<0xAE, MRM6m, (outs), (ins i8mem:$src), "clwb\t$src", []>, PD; def PCOMMIT : I<0xAE, MRM_F8, (outs), (ins), "pcommit", []>, PD; Index: test/CodeGen/X86/clflushopt.ll =================================================================== --- test/CodeGen/X86/clflushopt.ll +++ test/CodeGen/X86/clflushopt.ll @@ -0,0 +1,9 @@ +; RUN: llc < %s -mtriple=i686-unknown-unknown -show-mc-encoding | FileCheck %s + +define void @test_clflushopt(i8* %ptr) { +; CHECK-LABEL: test_clflushopt +; CHECK: clflushopt (%eax) # encoding: [0x66,0x0f,0xae,0x38] + call void @llvm.x86.clflushopt(i8* %ptr) + ret void; +} +declare void @llvm.x86.clflushopt(i8*)