Commit Graph

443217 Commits

Author SHA1 Message Date
Max Kazantsev 0b74cb4231 [SCEV] Introduce field for storing SymbolicMaxNotTaken. NFCI
ritht is initialized with either exact (if available) or
with constant max exit count. In the future, this can be improved.

Hypothetically this is not an NFC (it is possible that exact is not
known and max is known for a particular exit), but for how we use
it now it seems be an NFC (or at least I could not find an example
where it differs). constant max exit count. In the future, this can
be improved.

Differential Revision: https://reviews.llvm.org/D138699
Reviewed By: lebedev.ri
2022-11-28 17:07:33 +07:00
Lorenzo Chelini baca3b382b [MLIR] Simplify logic in `parseDynamicIndexList` (NFC)
We can use `parseCommaSeparatedList` to simplify the logic of
`parseDynamicIndexList`. We don't need to explicitly check delimiters
and comma anymore, this is done for us by `parseCommaSeparatedList`.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D138694
2022-11-28 11:02:09 +01:00
Guillaume Chatelet 702126aec5 [NFC] Add helper method to ensure min alignment on MCSection
Follow up on D138653.

Differential Revision: https://reviews.llvm.org/D138686
2022-11-28 10:00:34 +00:00
Bjorn Pettersson 99c47d9e31 Remove TargetMachine::adjustPassManager
Since opt no longer supports to run default (O0/O1/O2/O3/Os/Oz)
pipelines using the legacy PM, there are no in-tree uses of
TargetMachine::adjustPassManager remaining. This patch removes the
no longer used adjustPassManager functions.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D137796
2022-11-28 10:24:16 +01:00
Haojian Wu 962343a979 [include-cleaner] Fix walkUsed only report a single macro ref. 2022-11-28 10:12:10 +01:00
Sam McCall 2c1fa73459 Reland "[Lex] Fix suggested spelling of /usr/bin/../include/foo"
This reverts commit 1dc0a1e5d2.

Failures were caused by unintentional conversion to native slashes by
remove_dots, so undo that: we always suggest posix slashes for includes.

This could potentially be a change in behavior on windows if people were
spelling headers with backslashes and headermaps contained backslashes,
but that's all underspecified and I don't think anyone uses headermaps
on windows.

Differential Revision: https://reviews.llvm.org/D138709
2022-11-28 10:09:13 +01:00
Viktoriia Bakalova 10d183b889 [include-cleaner] Capture private headers in PragmaIncludes.
Save file IDs of IWYU private headers and report them as private.

Reviewed By: hokein

Differential Revision: https://reviews.llvm.org/D138678
2022-11-28 10:02:02 +01:00
Nicolas Vasilache 6e92d3fead [mlir][Test] Add a test pass to act as a sink towards LLVM conversion
This allows writing simple e2e tests where we can check for the proper materialization
of specific LLVM IR (e.g. `llvm.intr.fmuladd`).

Differential Revision: https://reviews.llvm.org/D138776
2022-11-28 00:59:55 -08:00
Zain Jaffal 6e4cea55f0 [AArch64] Fix cost model for `udiv` instruction when one of the operands is a uniform constant
Currently the model over estimates the cost of a udiv instruction with one constant. The correct cost for a udiv instruction is
insert_cost * extract_cost * num_elements

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D135991
2022-11-28 10:38:17 +02:00
Guillaume Chatelet f5dd9dda63 Remove support for 10.4 Tiger from AsmPrinter
I stumbled on this while trying to tighten Alignment in MCStreamer (D138705).
From the [wikipedia page](https://en.wikipedia.org/wiki/Mac_OS_X_Tiger), last release of MacOSX Tiger was released 15 years ago and is not supported anymore by Apple.

Relevant commit : 9f06f911d1 (diff-17b326b45ef392288420bed274616afa7df81b27576c96723b3c25f5198dc398)

Differential Revision: https://reviews.llvm.org/D138707
2022-11-28 08:31:49 +00:00
Vitaly Buka bc0ae48382 [test][asan] Speedup the test 2022-11-27 23:44:29 -08:00
Vitaly Buka 4880a48ab2 [NFC][asan] Fix typo in names 2022-11-27 23:42:10 -08:00
Vitaly Buka cef078a89d [NFC][asan] Reimplement with FindBadAddress 2022-11-27 23:00:42 -08:00
Vitaly Buka 450ec77037 [NFC][asan] Move a few precondition checks 2022-11-27 23:00:42 -08:00
Zi Xuan Wu (Zeson) e52a41d0a2 [CSKY][NFC] Fix the compiling error of CSKYAsmPrinter.cpp
emitValueToAlignment API changes the interface to use Align object to
wrap integer.
2022-11-28 13:49:11 +08:00
Fangrui Song a273c40820 llvm/tools: Convert tests to opaque pointers 2022-11-27 20:20:04 -08:00
Fangrui Song 270f63b84a MC: Convert tests to opaque pointers 2022-11-27 20:10:29 -08:00
Fangrui Song f01fdd17b4 lld: Convert tests to opaque pointers 2022-11-27 20:06:48 -08:00
Fangrui Song 4e4c89a16e LTO: Convert tests to opaque pointers 2022-11-27 19:51:46 -08:00
Fangrui Song d5d3eb16b7 ThinLTO: Convert tests to opaque pointers 2022-11-27 19:49:43 -08:00
Fangrui Song fc1270dd29 SanitizerCoverage: Convert tests to opaque pointers 2022-11-27 19:36:00 -08:00
Matt Arsenault 256d5ad3e8 LowerMatrixIntrinsics: Convert tests to opaque pointers
store-align-volatile.ll needed manually updated check lines for a
-NEXT check after a deleted bitcast.

Also avoided breaking the example C++ comment in remarks-inlining.ll
2022-11-27 21:42:25 -05:00
Matt Arsenault 5e3a5d163d HotColdSplit: Convert tests to opaque pointers
For some reason the script was deleting the assume declaration in
assumption-cache-invalidation.ll, so fixed that manually.
2022-11-27 21:42:00 -05:00
Matt Arsenault 06612123dc NaryReassociate: Convert tests to opaque pointers
NVPTX/nary-gep.ll had one test that checked for a deleted bitcast
which needed to be updated manually.
2022-11-27 21:41:53 -05:00
Matt Arsenault bcabf0a51f StraightLineStrengthReduce: Convert tests to opaque pointers
Required some manual updates in AMDGPU/pr23975.ll and
slsr-gep.ll. pr23975.ll had another offset 0 GEP that probably should
not have been deleted.
2022-11-27 21:29:33 -05:00
Matt Arsenault 0d2271bb44 SampleProfile: Convert tests to opaque pointers
syntax.ll required removing some diffs that apparently looked like
pointers in message checking.
2022-11-27 21:27:50 -05:00
Matt Arsenault 1c55cc600e PhaseOrdering: Convert tests to opaque pointers
Required manually running update_test_checks:
  AArch64/hoisting-sinking-required-for-vectorization.ll
  AArch64/peel-multiple-unreachable-exits-for-vectorization.ll
  ARM/arm_mult_q15.ll
  X86/hoist-load-of-baseptr.ll
  X86/spurious-peeling.ll
2022-11-27 21:26:41 -05:00
Matt Arsenault 3dc20f0160 Scalarizer: Convert tests to opaque pointers 2022-11-27 21:26:20 -05:00
Kazu Hirata 38a29686d4 [Scalar] Use std::optional in GVN.h (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-27 18:24:43 -08:00
Kazu Hirata 6d5669c723 [IR] Use std::optional in Attributor.h (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-27 18:24:42 -08:00
Kazu Hirata 2b158c972d [Target] Use std::optional in CGPassBuilderOption.h (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-27 18:24:40 -08:00
Kazu Hirata 492a60dc0b [ProfileData] Use std::optional in MemProf.h (NFC)
This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-27 18:24:39 -08:00
Matt Arsenault 21c3df4b85 MemorySanitizer: Convert tests to opaque pointers
Required fixups:
  alloca.ll
  avx2-intrinsics-x86.ll
  csr.ll
  instrumentation-with-call-threshold.ll
  msan_asm_conservative.ll
  msan_basic.ll
  msan_debug_info.ll
  msan_kernel_basic.ll
  msan_x86intrinsics.ll
  mul_by_constant.ll
2022-11-27 21:24:24 -05:00
Matt Arsenault 6f3335f590 HWAsan: Convert tests to opaque pointers
Fixups needed in:
  X86/alloca-with-calls.ll
  X86/alloca.ll
  alloca-with-calls.ll
  atomic.ll
  basic.ll
  dbg-value-tag-offset.ll
  kernel-alloca.ll
  prologue.ll
  use-after-scope.ll
2022-11-27 21:24:24 -05:00
Matt Arsenault 1ab6fa5152 HWAsan: Fix creating unnecessary bitcast with opaque pointers
This was creating a ptr to ptr bitcast. Convert a relevant test to
opaque pointers.
2022-11-27 21:24:24 -05:00
Fangrui Song 34ade57019 PGOProfile: Convert tests to opaque pointers 2022-11-27 18:13:09 -08:00
Matt Arsenault 8570893cfd GlobalDCE: Convert tests to opaque pointers
The script mangled both virtual-functions-base-pointer-call.ll and
virtual-functions-derived-pointer-call.ll pretty badly, deleting the
run line and most of the block comment.

Replaced the bitcast with and addrspacecast in 2002-07-17-CastRef.ll,
based on the apparent intent of the test.

For 2003-07-01-SelfReference.ll, the script produced "call ptr ()
@getfunc" which surprisingly parses as valid.
2022-11-27 21:07:27 -05:00
Matt Arsenault 1ec71a9569 ThreadSanitizer: Convert tests to opaque pointers
Required manual fixes in atomic.ll, missing_dbg.ll
2022-11-27 20:55:15 -05:00
Matt Arsenault 1c6b674473 LowerAtomic: Convert tests to opaque pointers 2022-11-27 20:53:57 -05:00
Matt Arsenault 4cbab1e5ff SeparateConstOffsetFromGEP: Update tests to use opaque pointers
NVPTX/split-gep.ll needed a check for a bitcast replaced.
2022-11-27 20:53:52 -05:00
Matt Arsenault d1c0092163 SeparateConstOffsetFromGEP: Fix creating pointless bitcasts
This was directly creating new BitCastInsts, so under opaque pointers,
would end up producing bitcast from ptr to ptr.
2022-11-27 20:53:48 -05:00
Matt Arsenault e8d4550813 SeparateConstOffsetFromGEP: Add baseline test for opaque pointers
This currently emits a pointless bitcast.
2022-11-27 20:53:43 -05:00
Matt Arsenault 8ff9bdb8e2 Utils: Update tests for opaque pointers
Also use -disable-output
2022-11-27 20:29:13 -05:00
Matt Arsenault 13fc189fe1 SafeStack: Convert tests to opaque pointers
X86/struct.ll, X86/array.ll and X86/array-aligned required manual
updates to reorder instructions.
2022-11-27 20:28:55 -05:00
Matt Arsenault bf6f82a9df StructurizeCFG: Convert tests to opaque pointers 2022-11-27 20:26:16 -05:00
Matt Arsenault 5651af896c InferAddressSpaces: Switch tests to use opt -passes 2022-11-27 20:26:16 -05:00
Matt Arsenault a982f09567 InferAddressSpaces: Convert tests to opaque pointers
Had constantexprs be mangled by the opaquify script; had to update
those lines manually:
  NVPTX/bug31948.ll
  AMDGPU/old-pass-regressions.ll
  AMDGPU/old-pass-regressions-inseltpoison.ll
  AMDGPU/infer-address-space.ll

Required re-reunning update_test_checks:
  AMDGPU/redundant-addrspacecast.ll

In AMDGPU/insert-pos-assert.ll, bitcast_insert_pos_assert_2 deleted a
getelementptr of 0 which I'm guessing was relevant. Replaced with an
offset 1 GEP to ensure another addrspacecast is inserted.

AMDGPU/infer-getelementptr.ll had one case improve by introducing an
inbounds.
2022-11-27 20:26:16 -05:00
Fangrui Song c33511c8df [lld] Change Optional to std::optional
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
2022-11-27 17:25:34 -08:00
Matt Arsenault 66c3444f4c DataFlowSanitizer: Convert most tests to opaque pointers
This was pain every step of the way; there's still one to go.
2022-11-27 20:10:57 -05:00
Matt Arsenault f711452055 DataFlowSanitizer: Don't use anonymous values in test
This interferes with test updates.
2022-11-27 20:10:57 -05:00