@@ -1559,6 +1559,12 @@ struct AANoAliasImpl : AANoAlias {
1559
1559
struct AANoAliasFloating final : AANoAliasImpl {
1560
1560
AANoAliasFloating (const IRPosition &IRP) : AANoAliasImpl(IRP) {}
1561
1561
1562
+ // / See AbstractAttribute::initialize(...).
1563
+ void initialize (Attributor &A) override {
1564
+ // TODO: It isn't sound to initialize as the same with `AANoAliasImpl`
1565
+ // because `noalias` may not be valid in the current position.
1566
+ }
1567
+
1562
1568
// / See AbstractAttribute::updateImpl(...).
1563
1569
ChangeStatus updateImpl (Attributor &A) override {
1564
1570
// TODO: Implement this.
@@ -1572,14 +1578,10 @@ struct AANoAliasFloating final : AANoAliasImpl {
1572
1578
};
1573
1579
1574
1580
// / NoAlias attribute for an argument.
1575
- struct AANoAliasArgument final : AANoAliasImpl {
1576
- AANoAliasArgument (const IRPosition &IRP) : AANoAliasImpl(IRP) {}
1577
-
1578
- // / See AbstractAttribute::updateImpl(...).
1579
- ChangeStatus updateImpl (Attributor &A) override {
1580
- // TODO: Implement this.
1581
- return indicatePessimisticFixpoint ();
1582
- }
1581
+ struct AANoAliasArgument final
1582
+ : AAArgumentFromCallSiteArguments<AANoAlias, AANoAliasImpl> {
1583
+ AANoAliasArgument (const IRPosition &IRP)
1584
+ : AAArgumentFromCallSiteArguments<AANoAlias, AANoAliasImpl>(IRP) {}
1583
1585
1584
1586
// / See AbstractAttribute::trackStatistics()
1585
1587
void trackStatistics () const override { STATS_DECLTRACK_ARG_ATTR (noalias) }
@@ -1588,6 +1590,12 @@ struct AANoAliasArgument final : AANoAliasImpl {
1588
1590
struct AANoAliasCallSiteArgument final : AANoAliasImpl {
1589
1591
AANoAliasCallSiteArgument (const IRPosition &IRP) : AANoAliasImpl(IRP) {}
1590
1592
1593
+ // / See AbstractAttribute::initialize(...).
1594
+ void initialize (Attributor &A) override {
1595
+ // TODO: It isn't sound to initialize as the same with `AANoAliasImpl`
1596
+ // because `noalias` may not be valid in the current position.
1597
+ }
1598
+
1591
1599
// / See AbstractAttribute::updateImpl(...).
1592
1600
ChangeStatus updateImpl (Attributor &A) override {
1593
1601
// TODO: Implement this.
@@ -2814,6 +2822,9 @@ void Attributor::identifyDefaultAbstractAttributes(
2814
2822
// Every argument with pointer type might be marked nonnull.
2815
2823
checkAndRegisterAA<AANonNullArgument>(ArgPos, *this , Whitelist);
2816
2824
2825
+ // Every argument with pointer type might be marked noalias.
2826
+ checkAndRegisterAA<AANoAliasArgument>(ArgPos, *this , Whitelist);
2827
+
2817
2828
// Every argument with pointer type might be marked dereferenceable.
2818
2829
checkAndRegisterAA<AADereferenceableArgument>(ArgPos, *this , Whitelist);
2819
2830
@@ -2879,6 +2890,10 @@ void Attributor::identifyDefaultAbstractAttributes(
2879
2890
checkAndRegisterAA<AANonNullCallSiteArgument>(CSArgPos, *this ,
2880
2891
Whitelist);
2881
2892
2893
+ // Call site argument attribute "no-alias".
2894
+ checkAndRegisterAA<AANoAliasCallSiteArgument>(CSArgPos, *this ,
2895
+ Whitelist);
2896
+
2882
2897
// Call site argument attribute "dereferenceable".
2883
2898
checkAndRegisterAA<AADereferenceableCallSiteArgument>(CSArgPos, *this ,
2884
2899
Whitelist);
0 commit comments