llvm-project/llvm/test/Transforms
Roman Lebedev 564d85e090
The maximal representable alignment in LLVM IR is 1GiB, not 512MiB
In LLVM IR, `AlignmentBitfieldElementT` is 5-bit wide
But that means that the maximal alignment exponent is `(1<<5)-2`,
which is `30`, not `29`. And indeed, alignment of `1073741824`
roundtrips IR serialization-deserialization.

While this doesn't seem all that important, this doubles
the maximal supported alignment from 512MiB to 1GiB,
and there's actually one noticeable use-case for that;
On X86, the huge pages can have sizes of 2MiB and 1GiB (!).

So while this doesn't add support for truly huge alignments,
which i think we can easily-ish do if wanted, i think this adds
zero-cost support for a not-trivially-dismissable case.

I don't believe we need any upgrade infrastructure,
and since we don't explicitly record the IR version,
we don't need to bump one either.

As @craig.topper speculates in D108661#2963519,
this might be an artificial limit imposed by the original implementation
of the `getAlignment()` functions.

Differential Revision: https://reviews.llvm.org/D108661
2021-08-26 12:53:39 +03:00
..
ADCE [LICM] Remove AST-based implementation 2021-08-18 20:21:53 +02:00
AddDiscriminators Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
AggressiveInstCombine [AggressiveInstCombine] Add arithmetic shift right instr to `TruncInstCombine` DAG 2021-08-24 10:41:16 +03:00
AlignmentFromAssumptions [AssumeBundles] offset should be added to correctly calculate align 2021-04-02 12:32:05 +09:00
ArgumentPromotion [test] Properly match parameter/argument ABI attributes 2021-05-31 09:12:18 -07:00
AtomicExpand [PowerPC] Add lit.local.cfg in AtomicExpand tests 2021-07-20 09:13:50 +00:00
Attributor The maximal representable alignment in LLVM IR is 1GiB, not 512MiB 2021-08-26 12:53:39 +03:00
BDCE
BlockExtractor
BranchFolding
CallSiteSplitting
CalledValuePropagation
CanonicalizeAliases
CanonicalizeFreezeInLoops [AArch64InstPrinter] Change printAddSubImm to comment imm value when shifted 2021-08-03 02:28:46 -07:00
CodeExtractor [CodeExtractor] Preserve topological order for the return blocks. 2021-08-25 08:09:01 -07:00
CodeGenPrepare [CodeGenPrepare] The instruction to be sunk should be inserted before its user in a block 2021-08-17 18:58:15 +08:00
ConstantHoisting [RISCV] Add zext.h/zext.w to RISCVTTIImpl::getIntImmCostInst. 2021-08-18 09:40:40 -07:00
ConstantMerge [ConstantMerge] Don't merge thread_local constants with non-thread_local constants 2021-04-28 23:44:20 +01:00
ConstraintElimination [ConstraintElimination] Initial support for using info from assumes. 2021-08-26 10:08:00 +01:00
Coroutines Add missing nullptr check 2021-08-17 13:59:52 -07:00
CorrelatedValuePropagation [CVP] add tests for unreachable switch default; NFC 2021-08-20 09:55:59 -04:00
CrossDSOCFI
DCE
DFAJumpThreading Add jump-threading optimization for deterministic finite automata 2021-07-27 14:34:04 -04:00
DeadArgElim [Attributes] Remove nonnull from UB-implying attributes 2021-07-25 18:07:31 +02:00
DeadStoreElimination [DSE] Check post-dominance for malloc+memset->calloc transform. 2021-08-23 12:39:51 -07:00
DivRemPairs [DivRemPairs] make sure we have a valid CFG for hoisting division 2021-07-28 11:09:12 -04:00
EarlyCSE [NewPM] Use parameterized syntax for a couple of more passes 2021-08-20 14:59:21 +02:00
EliminateAvailableExternally
EntryExitInstrumenter [NewPM] Use parameterized syntax for a couple of more passes 2021-08-20 14:59:21 +02:00
ExpandMemCmp [x86] split memcmp tests for 32/64-bit targets; NFC 2021-08-15 13:51:18 -04:00
FixIrreducible
Float2Int
ForcedFunctionAttrs
FunctionAttrs [LLVM IR] Allow volatile stores to trap. 2021-07-26 10:51:00 -07:00
FunctionImport Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
FunctionSpecialization [FuncSpec] Don't specialize function which are easy to inline 2021-08-23 19:20:21 +08:00
GCOVProfiling [GCov] Emit memset instead of stores in __llvm_gcov_reset 2021-08-05 22:40:15 -07:00
GVN The maximal representable alignment in LLVM IR is 1GiB, not 512MiB 2021-08-26 12:53:39 +03:00
GVNHoist PR46874: Reset stack after visiting a node 2021-08-20 11:25:05 -07:00
GVNSink [GVNSink] auto-generate test checks; NFC 2021-04-02 13:16:35 -04:00
GlobalDCE
GlobalMerge
GlobalOpt [GlobalOpt] Fix the assert for null check of global value 2021-08-24 20:47:33 -04:00
GlobalSplit [test] Fix mix of variable use/def and regex match 2021-03-24 17:58:16 +00:00
GuardWidening [GuardWidening] Preserve MemorySSA 2021-08-19 20:23:17 +02:00
HardwareLoops [test, HardwareLoops] Fix use of var defined in CHECK-NOT 2021-03-30 15:06:32 +01:00
HelloNew
HotColdSplit [CodeExtractor] Preserve topological order for the return blocks. 2021-08-25 08:09:01 -07:00
IRCE [SCEV] By more careful when traversing phis in isImpliedViaMerge. 2021-05-07 19:52:29 +01:00
IROutliner [CodeExtractor] Preserve topological order for the return blocks. 2021-08-25 08:09:01 -07:00
IndVarSimplify Revert "Special case common branch patterns in breakLoopBackedge" 2021-08-24 08:53:42 -07:00
IndirectBrExpand
InferAddressSpaces [infer-address-spaces] Handle complex non-pointer constexpr arguments. 2021-07-19 12:15:52 -07:00
InferFunctionAttrs Replace "CHECK-NOT: #{{.*}}" with same-line positive checks. NFC. 2021-08-05 21:55:23 -07:00
Inline [MLGO] Make sure inliner logs when deleting callees 2021-08-23 14:54:46 -07:00
InstCombine The maximal representable alignment in LLVM IR is 1GiB, not 512MiB 2021-08-26 12:53:39 +03:00
InstMerge
InstNamer
InstSimplify [InstSimplify] fold or+shifted -1 to -1 2021-08-24 15:38:38 -04:00
InterleavedAccess [InterleaveAccess] Copy fast math flags when adjusting binary operators in interleave access pass 2021-06-17 09:53:33 +01:00
Internalize [IR] Rename `comdat noduplicates` to `comdat nodeduplicate` 2021-07-20 12:47:10 -07:00
JumpThreading [tests] Stablize tests for possible change in deref semantics 2021-07-14 13:05:43 -07:00
LCSSA
LICM [LICM] Remove AST-based implementation 2021-08-18 20:21:53 +02:00
LoadStoreVectorizer [LoadStoreVectorizer] Support opaque pointers 2021-06-27 15:42:16 +02:00
LoopBoundSplit [LoopBoundSplit] Ignore phi node which is not scevable 2021-06-09 09:44:36 +01:00
LoopDataPrefetch
LoopDeletion Revert "Special case common branch patterns in breakLoopBackedge" 2021-08-24 08:53:42 -07:00
LoopDistribute [SCEVExpander] ReuseOrCreateCast(): use IRBuilder to actually create the cast 2021-04-19 18:38:39 +03:00
LoopFlatten [LoopFlatten] Fix assertion failure 2021-08-19 13:18:57 +01:00
LoopFusion [llvm] Unbreak no-asserts testing after 18839be9c5 2021-04-27 05:46:43 -04:00
LoopIdiom [LoopIdiom] Don't transform loop into memmove when load from body has more than one use 2021-08-25 14:22:40 +02:00
LoopInstSimplify
LoopInterchange [LoopInterchange] Check lcssa phis in the inner latch in scenarios of multi-level nested loops 2021-07-16 11:59:20 -04:00
LoopLoadElim [IndVars] Provide eliminateIVComparison with context 2021-03-19 12:28:22 +07:00
LoopPredication
LoopReroll [SCEV] Fix unsound reasoning in howManyLessThans 2021-07-15 10:32:47 -07:00
LoopRotate [Tests] Remove explicit -enable-mssa-loop-dependency options (NFC) 2021-08-14 21:21:07 +02:00
LoopSimplify [InstCombine] Fully disable select to and/or i1 folding 2021-05-06 09:29:52 +09:00
LoopSimplifyCFG [Tests] Remove explicit -enable-mssa-loop-dependency options (NFC) 2021-08-14 21:21:07 +02:00
LoopStrengthReduce [SCEVExpander] Stop hoisting IR when reusing phis 2021-08-17 09:38:32 -07:00
LoopTransformWarning
LoopUnroll [LoopPeel] Allow peeling with multiple unreachable-terminated exit blocks. 2021-08-25 13:26:40 +01:00
LoopUnrollAndJam [LoopUnrollAndJam] Change LoopUnrollAndJamPass to LoopNest pass 2021-06-08 20:30:02 +09:00
LoopUnswitch [Tests] Remove explicit -enable-mssa-loop-dependency options (NFC) 2021-08-14 21:21:07 +02:00
LoopVectorize Revert rG1c9bec727ab5c53fa060560dc8d346a911142170 : [InstCombine] Fold (gep (oneuse(gep Ptr, Idx0)), Idx1) -> (gep Ptr, (add Idx0, Idx1)) (PR51069) 2021-08-23 21:09:26 +01:00
LoopVersioning [LoopUtils] Fix incorrect RT check bounds of loop-invariant mem accesses 2021-07-19 19:38:24 +08:00
LoopVersioningLICM [LICM] Remove AST-based implementation 2021-08-18 20:21:53 +02:00
LowerAtomic
LowerConstantIntrinsics [LowerConstantIntrinsics] reuse isManifestLogic from ConstantFolding 2021-05-14 15:35:21 -07:00
LowerExpectIntrinsic
LowerGuardIntrinsic
LowerInvoke
LowerMatrixIntrinsics [NewPM] Use parameterized syntax for a couple of more passes 2021-08-20 14:59:21 +02:00
LowerSwitch
LowerTypeTests [ConstantFold] Get rid of special cases for sizeof etc. 2021-07-31 13:20:47 -07:00
LowerWidenableCondition
MakeGuardsExplicit
Mem2Reg [Mem2Reg] Regenerate test checks (NFC) 2021-06-21 11:06:28 +02:00
MemCpyOpt [MemCpyOpt] Remove MemDepAnalysis-based implementation 2021-08-07 22:35:44 +02:00
MergeFunc
MergeICmps [MergeICmps] Allow sinking past non-load/store 2021-08-23 22:03:49 +02:00
MetaRenamer
NameAnonGlobals
NaryReassociate [NARY] Don't optimize min/max if there are side uses (part2) 2021-04-30 19:02:02 +07:00
NewGVN Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
ObjCARC [ObjC][ARC] Don't form a StoreStrong call if it is unsafe to move the 2021-08-11 13:50:19 -07:00
OpenMP The maximal representable alignment in LLVM IR is 1GiB, not 512MiB 2021-08-26 12:53:39 +03:00
PGOProfile [InstrProfiling] Keep profd non-private for non-renamable comdat functions 2021-08-24 20:14:03 -07:00
PartialInlining
PartiallyInlineLibCalls [PartiallyInlineLibCalls] Disable sqrt expansion for strictfp. 2021-06-17 14:15:12 -07:00
PhaseOrdering [AggressiveInstCombine] Add logical shift right instr to `TruncInstCombine` DAG 2021-08-18 22:20:58 +03:00
PlaceSafepoints
PreISelIntrinsicLowering
PruneEH [NewPM] Consistently use 'simplifycfg' rather than 'simplify-cfg' 2021-07-09 09:47:03 +02:00
Reassociate Partial Reapply "[DebugInfo] Use variadic debug values to salvage BinOps and GEP instrs with non-const operands" 2021-06-24 09:46:38 +01:00
Reg2Mem
RelLookupTableConverter/X86 [Passes] Add relative lookup table converter pass 2021-04-13 01:29:41 +00:00
RewriteStatepointsForGC [RS4GC] Use one DVCache for both inlineGetBaseAndOffset() and insertParsePoints() 2021-07-12 18:13:00 +07:00
SCCP [IR] Consider non-willreturn as side effect (PR50511) 2021-07-26 16:35:14 +02:00
SLPVectorizer [SLP][NFC]Add a test for non-optimal PHIs vectorization, NFC. 2021-08-25 15:55:11 -07:00
SROA Reapply "SROA: Enhance speculateSelectInstLoads" 2021-08-11 22:58:54 -04:00
SafeStack [SafeStack] Use proper API to get stack guard 2021-05-30 00:52:48 -07:00
SampleProfile [CSSPGO] Add switch for sample loader to honor global pre-inliner decision from llvm-profgen 2021-08-25 17:20:15 -07:00
ScalarizeMaskedMemIntrin
Scalarizer Update @llvm.powi to handle different int sizes for the exponent 2021-06-17 09:38:28 +02:00
SeparateConstOffsetFromGEP [test] Make global in split-gep-and-gvn.ll not constant 2021-04-19 11:03:19 -07:00
SimpleLoopUnswitch [Tests] Remove explicit -enable-mssa-loop-dependency options (NFC) 2021-08-14 21:21:07 +02:00
SimplifyCFG [NFCI][SimplifyCFG] Rewrite `createUnreachableSwitchDefault()` 2021-08-20 13:28:08 +03:00
Sink
SpeculativeExecution
StraightLineStrengthReduce Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
StripDeadPrototypes
StripSymbols [DebugInfo] Support for signed constants inside DIExpression 2021-03-30 23:20:38 +05:30
StructurizeCFG Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
SyntheticCountsPropagation
TailCallElim [Tests] Add missing willreturn attributes (NFC) 2021-07-24 17:17:48 +02:00
ThinLTOBitcodeWriter ThinLTO: Fix inline assembly references to static functions with CFI 2021-08-03 11:35:30 -07:00
TypePromotion/ARM [ARM][TypePromotion] Re-generate test checks. NFC 2021-08-16 13:42:42 -07:00
UnifyFunctionExitNodes
UnifyLoopExits
Util [PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types. 2021-07-28 19:30:29 +02:00
VectorCombine [VectorCombine] Limit scalarization known non-poison indices. 2021-08-05 15:36:31 +01:00
WholeProgramDevirt [OpaquePtr] Support forward references in textual IR 2021-06-29 20:10:31 +02:00