mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
71a4b301fd
When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop. The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed %tobool.5 = icmp ne i32 %num, 0 store i1 %tobool.5, i1* %ptr br i1 %tobool.5, label %for.body.lr.ph, label %for.end to store i1 %1, i1* %ptr %0 = call i32 @llvm.ctpop.i32(i32 %num) %1 = icmp ne i32 %0, 0 br i1 %1, label %for.body.lr.ph, label %for.end Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect. The store doesn’t want the result of ctpop. The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses. Reviewed by Hal Finkel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242068 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
ADCE.cpp | ||
AlignmentFromAssumptions.cpp | ||
BDCE.cpp | ||
CMakeLists.txt | ||
ConstantHoisting.cpp | ||
ConstantProp.cpp | ||
CorrelatedValuePropagation.cpp | ||
DCE.cpp | ||
DeadStoreElimination.cpp | ||
EarlyCSE.cpp | ||
FlattenCFGPass.cpp | ||
Float2Int.cpp | ||
GVN.cpp | ||
InductiveRangeCheckElimination.cpp | ||
IndVarSimplify.cpp | ||
JumpThreading.cpp | ||
LICM.cpp | ||
LLVMBuild.txt | ||
LoadCombine.cpp | ||
LoopDeletion.cpp | ||
LoopDistribute.cpp | ||
LoopIdiomRecognize.cpp | ||
LoopInstSimplify.cpp | ||
LoopInterchange.cpp | ||
LoopRerollPass.cpp | ||
LoopRotation.cpp | ||
LoopStrengthReduce.cpp | ||
LoopUnrollPass.cpp | ||
LoopUnswitch.cpp | ||
LowerAtomic.cpp | ||
LowerExpectIntrinsic.cpp | ||
Makefile | ||
MemCpyOptimizer.cpp | ||
MergedLoadStoreMotion.cpp | ||
NaryReassociate.cpp | ||
PartiallyInlineLibCalls.cpp | ||
PlaceSafepoints.cpp | ||
Reassociate.cpp | ||
Reg2Mem.cpp | ||
RewriteStatepointsForGC.cpp | ||
SampleProfile.cpp | ||
Scalar.cpp | ||
Scalarizer.cpp | ||
ScalarReplAggregates.cpp | ||
SCCP.cpp | ||
SeparateConstOffsetFromGEP.cpp | ||
SimplifyCFGPass.cpp | ||
Sink.cpp | ||
SpeculativeExecution.cpp | ||
SROA.cpp | ||
StraightLineStrengthReduce.cpp | ||
StructurizeCFG.cpp | ||
TailRecursionElimination.cpp |