- Apr 24, 2023
-
-
Joshua Cao authored
-
Joshua Cao authored
-
WANG Xuerui authored
This follows v1.00 of the [[ https://loongson.github.io/LoongArch-Documentation/LoongArch-toolchain-conventions-EN.html | LoongArch Toolchain Conventions ]], but notably with [[ https://github.com/loongson/LoongArch-Documentation/pull/80 | this patch ]] applied (a proper version bump to v2.00 was not done, so it is indistinguishable from the "original" but now incompatible v1.00 otherwise). Only `loongarch64` is implemented in `Linux::getMultiarchTriple` because support for LA32 and ILP32* ABIs are incomplete right now. The Debian sysroot layout is based on Han Gao's recent porting effort, specifically the ghcr.io/rabenda/beige:loong64-v23-preview-20230330 container image. Reviewed By: SixWeining Differential Revision: https://reviews.llvm.org/D142688
-
Jean Perier authored
Currently, local allocatables and contiguous/scalar pointers (and some other conditions) are lowered to a set of independent variables in FIR (one for the address, one for each bound and one for character length). The intention was to help LLVM get rids of descriptors. But LLVM knows how to do that anyway in those cases: ``` subroutine foo(x) real, target :: x(100) real, pointer, contiguous :: p(:) p => x call bar(p(50)) end subroutine ``` The output fir the option on or off is the same after llvm opt -O1, there is no descriptor anymore, the indirection is removed. ``` define void @foo_(ptr %0) local_unnamed_addr { %2 = getelementptr [100 x float], ptr %0, i64 0, i64 49 tail call void @bar_(ptr %2) ret void } ``` So the benefit of not using a descriptor in lowering is questionable, and although it is abstracted as much as possible in the so called MutableBoxValue class that represent allocatable/pointer in lowering it is still causing bugs from time to time, and will also be a bit problematic when emitting debug info for the pointer/allocatable. In HLFIR lowering, the simplification to always use a descriptor in lowering was already made. This patch allows decorrelating the impact from this change from the bigger impact HLFIR will have so that it is easier to get feedback if this causes performance issues. The lowering tests relying on the previous behavior are only updated to set back this option to true. The reason is that I think we should preserve coverage of the code dealing with the "non descriptor" approach in lowering until we actually get rid of it. The other reason is that the test will have to be or are already covered by equivalent HLFIR tests, which use descriptors. Differential Revision: https://reviews.llvm.org/D148910 -
Craig Topper authored
I don't think this code would work correctly if the register class used used HwModes. Add asserts to make sure it's not used with HwModes. Also fix a long outdated comment on the function.
-
zhanglimin authored
The effectiveness of the mprotect function depends on whether the first argument is aligned to a page boundary. If mprotect doesn't work, the kernel will not generate a SIGSEGV signal for the process when the calling process tries to access memory in a manner that violates the protection. If so, this test fails. The problem for this test is that it uses a fixed 4 kB page size and is aligned. This fails when the page size is not 4 kB. For example, this fails on LoongArch which uses a 16 kB pagesize. Reviewed By: SixWeining, xen0n, MaskRay, vitalybuka Differential Revision: https://reviews.llvm.org/D148407
-
Christian Ulmann authored
This commit introduces an SFINAE mechanism to make the LLVM hoist into check member function not leak into the users of LoopInfo. Depends on D148235 Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D148504
-
Christian Ulmann authored
This commit splits the generic part of `LoopInfo` into separate files. These new `GenericLoopInfo` files are located in `llvm/Support` to be inline with `GenericDomTree`. Furthermore, this change ensures that MLIR's Bazel build does not have to link against `LLVMAnalysis` just to use these template headers. Depends on D148219 Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D148235
-
Shengchen Kan authored
-
Mehdi Amini authored
Differential Revision: https://reviews.llvm.org/D149036
-
Craig Topper authored
As well as the ForceMode field in PatternToMatch.
-
Wang, Xin10 authored
These codes deleted are dead code, we never go into it. 1. In AggressiveAntiDepBreaker.cpp, have assert AntiDepReg != 0. 2. IfConversion.cpp, Kind can only be one unique value, so isFalse && isRev can never be true. 3. DAGCombiner.cpp, at line 3675, we have considered the condition like ``` // fold (sub x, c) -> (add x, -c) if (N1C) { return DAG.getNode(ISD::ADD, DL, VT, N0, DAG.getConstant(-N1C->getAPIntValue(), DL, VT)); } ``` 4. ScheduleDAGSDNodes.cpp, we have Latency > 1 at line 663 5. MasmParser.cpp, code exists in a switch-case block which decided by the value FirstTokenKind, at line 1621, FirstTokenKind could only be one of AsmToken::Dollar, AsmToken::At and AsmToken::Identifier. Reviewed By: skan Differential Revision: https://reviews.llvm.org/D148610
-
- Apr 23, 2023
-
-
Fabian Tschopp authored
represnted -> represented Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D149031
-
- Apr 24, 2023
-
-
Manna, Soumi authored
Reported by Coverity: AUTO_CAUSES_COPY Unnecessary object copies can affect performance. 1. Inside "SemaDeclCXX.cpp" file, in <unnamed>::DiagnoseUninitializedFields(clang::Sema &, clang::CXXConstructorDecl const *): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier. 2. Inside "ClangAttrEmitter.cpp" file, in clang::EmitClangAttrParsedAttrImpl(llvm::RecordKeeper &, llvm::raw_ostream &): Using the auto keyword without an & causes the copy of an object of type pair. 3. Inside "Marshallers.h" file, in clang::ast_matchers::dynamic::internal::MapAnyOfBuilderDescriptor::buildMatcherCtor(clang::ast_matchers::dynamic::SourceRange, llvm::ArrayRef<clang::ast_matchers::dynamic::ParserValue>, clang::ast_matchers::dynamic::Diagnostics *): Using the auto keyword without an & causes the copy of an object of type ParserValue. 4. Inside "CGVTables.cpp" file, in clang::CodeGen::CodeGenModule::GetVCallVisibilityLevel(clang::CXXRecordDecl const *, llvm::DenseSet<clang::CXXRecordDecl const *, llvm::DenseMapInfo<clang::CXXRecordDecl const *, void>> &): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier. 5. Inside "ASTContext.cpp" file, in hasTemplateSpecializationInEncodedString(clang::Type const *, bool): Using the auto keyword without an & causes the copy of an object of type CXXBaseSpecifier. 6. Inside "ComputeDependence.cpp" file, in clang::computeDependence(clang::DependentScopeDeclRefExpr *): Using the auto keyword without an & causes the copy of an object of type TemplateArgumentLoc. Reviewed By: tahonermann, erichkeane Differential Revision: https://reviews.llvm.org/D148812
-
Teresa Johnson authored
Modifies a104e270 slightly to switch a constexpr used via a lambda capture to a const, due to issues with MSVC. See https://reviews.llvm.org/D140949#inline-1438809 for context.
-
Fangrui Song authored
-
Haojian Wu authored
-
Daniel Kiss authored
Adding BTI to those PLT's which accessed with by a range extension thunk due to those preform an indirect call. Fixes: #62140 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D148704
-
Simon Pilgrim authored
For 8-bit/16-bit vector loads/stores we scalarize and transfer to/from the vector unit, or use the (usually slow) PINSR/PEXTR instructions. Fixes #59867
-
Simon Pilgrim authored
-
Fangrui Song authored
Currently clangDriver passes -femulated-tls and -fno-emulated-tls to cc1. cc1 forwards the option to LLVMCodeGen and ExplicitEmulatedTLS is used to decide the value. Simplify this by moving the Clang decision to clangDriver and moving the LLVM decision to InitTargetOptionsFromCodeGenFlags.
-
Hanhan Wang authored
It adds a `shuffle_16x16` strategy LowerVectorTranspose and renames `shuffle` to `shuffle_1d`. The idea is similar to 8x8 cases in x86Vector::avx2. The general algorithm is: ``` interleave 32-bit lanes using 8x _mm512_unpacklo_epi32 8x _mm512_unpackhi_epi32 interleave 64-bit lanes using 8x _mm512_unpacklo_epi64 8x _mm512_unpackhi_epi64 permute 128-bit lanes using 16x _mm512_shuffle_i32x4 permute 256-bit lanes using again 16x _mm512_shuffle_i32x4 ``` After the first stage, they got transposed to ``` 0 16 1 17 4 20 5 21 8 24 9 25 12 28 13 29 2 18 3 19 6 22 7 23 10 26 11 27 14 30 15 31 32 48 33 49 ... 34 50 35 51 ... 64 80 65 81 ... ... ``` After the second stage, they got transposed to ``` 0 16 32 48 ... 1 17 33 49 ... 2 18 34 49 ... 3 19 35 51 ... 64 80 96 112 ... 65 81 97 114 ... 66 82 98 113 ... 67 83 99 115 ... ... ``` After the thrid stage, they got transposed to ``` 0 16 32 48 8 24 40 56 64 80 96 112 ... 1 17 33 49 ... 2 18 34 50 ... 3 19 35 51 ... 4 20 36 52 ... 5 21 37 53 ... 6 22 38 54 ... 7 23 39 55 ... 128 144 160 176 ... 129 145 161 177 ... ... ``` After the last stage, they got transposed to ``` 0 16 32 48 64 80 96 112 ... 240 1 17 33 49 66 81 97 113 ... 241 2 18 34 50 67 82 98 114 ... 242 ... 15 31 47 63 79 96 111 127 ... 255 ``` Reviewed By: dcaballe Differential Revision: https://reviews.llvm.org/D148685 -
Simon Pilgrim authored
-
Nathan Sidwell authored
Drop unsupported ELF format reloc handling -- RewriteInstance lacks this flexibility elsewhere. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D148946
-
David Green authored
This is a Thumb1 target, so will not have qsat instructions available. There was a mismatch between hasBaseDSP and the instruction patterns when +dsp was present, which is set by clang (but maybe shouldn't be). The target being thumb1-only should override that, implying that it does not have any qadds. Fixes #62273
-
Kazu Hirata authored
-
Mathieu Fehr authored
This patch add support for loading IRDL dialects at runtime with `mlir-opt`. Given the following `dialect.irdl` file: ```mlir module { irdl.dialect @cmath { irdl.type @complex { %0 = irdl.is f32 %1 = irdl.is f64 %2 = irdl.any_of(%0, %1) irdl.parameters(%2) } irdl.operation @norm { %0 = irdl.any %1 = irdl.parametric @complex<%0> irdl.operands(%1) irdl.results(%0) } } ``` the IRDL file can be loaded with the `mlir-opt --irdl-file=dialect.irdl` command, and the following file can then be parsed: ```mlir func.func @conorm(%p: !cmath.complex<f32>, %q: !cmath.complex<f32>) -> f32 { %norm_p = "cmath.norm"(%p) : (!cmath.complex<f32>) -> f32 %norm_q = "cmath.norm"(%q) : (!cmath.complex<f32>) -> f32 %pq = arith.mulf %norm_p, %norm_q : f32 return %pq : f32 } ``` To minimize the size of this patch, the operation, attribute, and type verifier are all always returning `success()`. Depends on D144692 Reviewed By: rriddle, Mogball, mehdi_amini Differential Revision: https://reviews.llvm.org/D144693
-
- Apr 23, 2023
-
-
Simon Pilgrim authored
Similar to the original VPERMILPSri -> VSHUFPSrri mapping added in D143787, replacing VPERMILPDri -> VSHUFPDrri should never be any slower and saves an encoding byte. The sibling VPERMILPDmi -> VPSHUFDmi mapping is trickier as we need the same shuffle mask in every lane (and it needs to be adjusted) - I haven't attempted that yet but we can investigate it in the future if there's interest. Fixes #61060 Differential Revision: https://reviews.llvm.org/D148999
-
Lang Hames authored
This reapplies 85c649bc, which was reverted in 35767e43 due to failures with some example programs. The fix was to add export_executable_symbols to the example programs.
-
Simon Pilgrim authored
PERMILPS is only available on AVX or later (VEX/EVEX encoding)
-
Luo, Yuanke authored
-
Craig Topper authored
-
Akshay Khadse authored
This change fixes static code analysis errors Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D148814
-
Noah Goldstein authored
This previously existed for `C == 0`, but is mostly beneficial for any `C`. There is a slight codesize cost as we get more imm32 (as opposed to imm8) constants in some cases. But the benefit is was get less imm16 constants (LCP stalls) and save instructions in some vec -> scalar codegen. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D148594
-
Serge Pavlov authored
This is a recommit of 75f1f158, reverted in 7a443b1c, because it caused compilation error in compiler-rt/lib/sanitizer_common/symbolizer/sanitizer_symbolize.cpp. The error was fixed by Kasimir Georgiev in de4c038c, but this commit was reverted in de088dd3, because the initial commit was reverted. This commit reverts both the reverting commits, 7a443b1c and de088dd3. Original commit message is below. If llvm-symbolize did not find module, the error looked like: LLVMSymbolizer: error reading file: No such file or directory This message does not follow common practice: LLVMSymbolizer is not an utility name. Also the message did not not contain the name of missed file. With this change the error message looks differently: llvm-symbolizer: error: 'abc': No such file or directory This format is closer to messages produced by other utilities and allow proper coloring. Differential Revision: https://reviews.llvm.org/D148032
-
Craig Topper authored
-
Akshay Khadse authored
This change fixes static code analysis errors Reviewed By: skan Differential Revision: https://reviews.llvm.org/D148912
-
Craig Topper authored
Instead of copying elements to the NewOptionsToMatchVector, we now shift down elements in OptionsToMatch as we create holes by pulling out equal matchers. After we finish processing the vector, we'll trim the size to just the elements that are still in use.
-
Jianjian GUAN authored
Reviewed By: benshi001, jhuber6 Differential Revision: https://reviews.llvm.org/D148908
-
NAKAMURA Takumi authored
-